Pavithiran commited on
Commit
d5d2932
·
verified ·
1 Parent(s): 59cbc81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -29,7 +29,6 @@ def respond(
29
  response = ""
30
 
31
  try:
32
- response_dict = {"response": ""}
33
  for message in client.chat_completion(
34
  messages,
35
  max_tokens=max_tokens,
@@ -38,9 +37,9 @@ def respond(
38
  top_p=top_p,
39
  ):
40
  token = message.choices[0].delta.content
41
- print(token)
42
- response_dict["response"] += token
43
- yield json.dumps(response_dict)
44
  except Exception as e:
45
  yield f"Error: {e}"
46
  """
 
29
  response = ""
30
 
31
  try:
 
32
  for message in client.chat_completion(
33
  messages,
34
  max_tokens=max_tokens,
 
37
  top_p=top_p,
38
  ):
39
  token = message.choices[0].delta.content
40
+
41
+ response += token
42
+ yield response
43
  except Exception as e:
44
  yield f"Error: {e}"
45
  """