Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
| 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()
|