LenDigLearn commited on
Commit
87fc746
·
1 Parent(s): 8b3dbaa

disabled streaming

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -25,20 +25,14 @@ def respond(
25
 
26
  messages.append({"role": "user", "content": message})
27
 
28
- response = ""
29
-
30
- for message in client.chat_completion(
31
  messages,
32
  max_tokens=max_tokens,
33
- stream=True,
34
  temperature=temperature,
35
- top_p=top_p,
36
- # frequency_penalty=frequency_penalty
37
- ):
38
- token = message.choices[0].delta.content
39
 
40
- response += token
41
- yield response
42
 
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
25
 
26
  messages.append({"role": "user", "content": message})
27
 
28
+ response = client.chat_completion(
 
 
29
  messages,
30
  max_tokens=max_tokens,
31
+ stream=False,
32
  temperature=temperature,
33
+ top_p=top_p).choices[0].message.content
 
 
 
34
 
35
+ yield response
 
36
 
37
  """
38
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface