Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,8 @@ async def send_chat_message(LLM_URL, LLM_API, user_input):
|
|
46 |
continue
|
47 |
try:
|
48 |
print("Received line:", line)
|
49 |
-
|
|
|
50 |
if "answer" in data:
|
51 |
decoded_answer = urllib.parse.unquote(data["answer"])
|
52 |
full_response.append(decoded_answer)
|
|
|
46 |
continue
|
47 |
try:
|
48 |
print("Received line:", line)
|
49 |
+
json_str = line.split("data: ", 1)[-1]
|
50 |
+
data = json.loads(json_str)
|
51 |
if "answer" in data:
|
52 |
decoded_answer = urllib.parse.unquote(data["answer"])
|
53 |
full_response.append(decoded_answer)
|