Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import os
|
2 |
import openai
|
3 |
import gradio as gr
|
4 |
-
import time
|
5 |
|
6 |
# Set up password
|
7 |
username = os.getenv('username')
|
@@ -38,9 +37,8 @@ def chat_with_assistant(message, history):
|
|
38 |
# Handle the streaming response
|
39 |
response_text = ""
|
40 |
for chunk in response:
|
41 |
-
|
42 |
-
|
43 |
-
response_text += delta['content']
|
44 |
yield response_text
|
45 |
|
46 |
# Custom CSS for chat bubbles and colors
|
|
|
1 |
import os
|
2 |
import openai
|
3 |
import gradio as gr
|
|
|
4 |
|
5 |
# Set up password
|
6 |
username = os.getenv('username')
|
|
|
37 |
# Handle the streaming response
|
38 |
response_text = ""
|
39 |
for chunk in response:
|
40 |
+
if hasattr(chunk.choices[0].delta, 'content'):
|
41 |
+
response_text += chunk.choices[0].delta.content
|
|
|
42 |
yield response_text
|
43 |
|
44 |
# Custom CSS for chat bubbles and colors
|