Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,18 +9,10 @@ tokenizer = AutoTokenizer.from_pretrained("google/flan-ul2")
|
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
outputs = model.generate(**inputs)
|
| 20 |
-
code=tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 21 |
-
return code
|
| 22 |
-
|
| 23 |
-
demo = gr.ChatInterface(reply)
|
| 24 |
-
|
| 25 |
-
if __name__ == "__main__":
|
| 26 |
-
demo.launch()
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
+
|
| 13 |
+
def slow_echo(message, history):
|
| 14 |
+
for i in range(len(message)):
|
| 15 |
+
time.sleep(0.3)
|
| 16 |
+
yield "You typed: " + message[: i+1]
|
| 17 |
+
|
| 18 |
+
gr.ChatInterface(slow_echo).queue().launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|