Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,16 +2,15 @@ import gradio as gr
|
|
2 |
import modal
|
3 |
import time
|
4 |
|
5 |
-
|
6 |
user_input = ""
|
7 |
history = ""
|
8 |
|
9 |
def echo(message, history):
|
10 |
message = "Human: "+message+"\nAssistant: "
|
11 |
answer = ""
|
12 |
-
for t in
|
13 |
answer += t
|
14 |
-
time.sleep(1)
|
15 |
yield answer
|
16 |
|
17 |
demo = gr.ChatInterface(fn=echo, title="Tutor Bot").queue()
|
|
|
2 |
import modal
|
3 |
import time
|
4 |
|
5 |
+
f = modal.Function.lookup("tutor_mixtral_1000", "Model.generate")
|
6 |
user_input = ""
|
7 |
history = ""
|
8 |
|
9 |
def echo(message, history):
|
10 |
message = "Human: "+message+"\nAssistant: "
|
11 |
answer = ""
|
12 |
+
for t in f.remote_gen(prompt):
|
13 |
answer += t
|
|
|
14 |
yield answer
|
15 |
|
16 |
demo = gr.ChatInterface(fn=echo, title="Tutor Bot").queue()
|