Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -163,8 +163,13 @@ def chat(id, npc, text):
|
|
163 |
return "no coin"
|
164 |
|
165 |
# model inference
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
-
if
|
168 |
|
169 |
global history
|
170 |
if not npc in npc_story:
|
@@ -216,7 +221,7 @@ def chat(id, npc, text):
|
|
216 |
print(output)
|
217 |
history[npc][id] += f"\n\n### User:\n{text}\n\n### {npc}:{output}"
|
218 |
else:
|
219 |
-
output = "no model"
|
220 |
|
221 |
|
222 |
# add_transaction endpoint
|
|
|
163 |
return "no coin"
|
164 |
|
165 |
# model inference
|
166 |
+
response = requests.post("https://ldhldh-api-for-unity.hf.space/run/predict_7", json={
|
167 |
+
"data": [
|
168 |
+
]}).json()
|
169 |
+
sample_data = eval(response["data"][0])
|
170 |
+
user_num = len(sample_data['gpus'])
|
171 |
|
172 |
+
if user_num>=3:
|
173 |
|
174 |
global history
|
175 |
if not npc in npc_story:
|
|
|
221 |
print(output)
|
222 |
history[npc][id] += f"\n\n### User:\n{text}\n\n### {npc}:{output}"
|
223 |
else:
|
224 |
+
output = "no model, GPU๋ฅผ ๋ ๊ณต์ ํด์ฃผ์ธ์."
|
225 |
|
226 |
|
227 |
# add_transaction endpoint
|