LunarBs commited on
Commit
7bc77d3
·
verified ·
1 Parent(s): 4c5d842

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,10 +27,10 @@ def darkgpt_chat(
27
  temperature=temperature,
28
  top_p=top_p,
29
  ):
30
- token = resp.choices[0].delta.content
31
  if token:
32
  response_text += token
33
- yield response_text
34
 
35
  darkgpt_interface = gr.ChatInterface(
36
  darkgpt_chat,
@@ -45,4 +45,4 @@ darkgpt_interface = gr.ChatInterface(
45
  )
46
 
47
  if __name__ == "__main__":
48
- darkgpt_interface.launch()
 
27
  temperature=temperature,
28
  top_p=top_p,
29
  ):
30
+ token = resp.choices[0].delta.get("content", "")
31
  if token:
32
  response_text += token
33
+ yield response_text
34
 
35
  darkgpt_interface = gr.ChatInterface(
36
  darkgpt_chat,
 
45
  )
46
 
47
  if __name__ == "__main__":
48
+ darkgpt_interface.launch()