Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,9 +18,9 @@ def getResponseFromHF(api, p, qid, uid):
|
|
| 18 |
qid,
|
| 19 |
uid,
|
| 20 |
]
|
| 21 |
-
})
|
| 22 |
print(response)
|
| 23 |
-
data = response["data"]
|
| 24 |
if (len(data) == 2):
|
| 25 |
return data[1]
|
| 26 |
|
|
@@ -29,10 +29,9 @@ def getResponseFromDefault(api, p, qid, uid):
|
|
| 29 |
"p":p,
|
| 30 |
"qid":qid,
|
| 31 |
"uid":uid
|
| 32 |
-
})
|
| 33 |
print(response)
|
| 34 |
-
|
| 35 |
-
return data["content"]
|
| 36 |
|
| 37 |
def chat(api, p, qid, uid, history):
|
| 38 |
history = history or []
|
|
|
|
| 18 |
qid,
|
| 19 |
uid,
|
| 20 |
]
|
| 21 |
+
})
|
| 22 |
print(response)
|
| 23 |
+
data = response.json()["data"]
|
| 24 |
if (len(data) == 2):
|
| 25 |
return data[1]
|
| 26 |
|
|
|
|
| 29 |
"p":p,
|
| 30 |
"qid":qid,
|
| 31 |
"uid":uid
|
| 32 |
+
})
|
| 33 |
print(response)
|
| 34 |
+
return response.json()["data"]["content"]
|
|
|
|
| 35 |
|
| 36 |
def chat(api, p, qid, uid, history):
|
| 37 |
history = history or []
|