Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from gradio import routes
|
|
5 |
from typing import List, Type
|
6 |
from petals import AutoDistributedModelForCausalLM
|
7 |
from transformers import AutoTokenizer
|
8 |
-
import requests, os, re, asyncio, json
|
9 |
|
10 |
loop = asyncio.get_event_loop()
|
11 |
|
@@ -260,6 +260,7 @@ def chat(id, npc, text):
|
|
260 |
)
|
261 |
output = response.choices[0].message.content
|
262 |
output = output.replace(".",".\n")
|
|
|
263 |
print(output)
|
264 |
history[npc][id] += f"\n\n{id}:\n{text}\n\n{npc}:{output}"
|
265 |
else:
|
|
|
5 |
from typing import List, Type
|
6 |
from petals import AutoDistributedModelForCausalLM
|
7 |
from transformers import AutoTokenizer
|
8 |
+
import requests, os, re, asyncio, json, time
|
9 |
|
10 |
loop = asyncio.get_event_loop()
|
11 |
|
|
|
260 |
)
|
261 |
output = response.choices[0].message.content
|
262 |
output = output.replace(".",".\n")
|
263 |
+
time.sleep(10)
|
264 |
print(output)
|
265 |
history[npc][id] += f"\n\n{id}:\n{text}\n\n{npc}:{output}"
|
266 |
else:
|