DeepLearning101 commited on
Commit
4a8a1fb
·
verified ·
1 Parent(s): a97fead

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- data = json.loads(line.split("data: ")[1])
 
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)