Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -198,6 +198,7 @@ def submit_message(detectFrom, detectTo, user_token, prompt):
|
|
| 198 |
]
|
| 199 |
|
| 200 |
try:
|
|
|
|
| 201 |
openai_response = openai.ChatCompletion.create(
|
| 202 |
model="gpt-3.5-turbo",
|
| 203 |
messages=prompt_msg,
|
|
@@ -208,6 +209,7 @@ def submit_message(detectFrom, detectTo, user_token, prompt):
|
|
| 208 |
frequency_penalty=1,
|
| 209 |
presence_penalty=1,
|
| 210 |
)
|
|
|
|
| 211 |
|
| 212 |
combined = ""
|
| 213 |
for resp in openai_response:
|
|
@@ -217,6 +219,7 @@ def submit_message(detectFrom, detectTo, user_token, prompt):
|
|
| 217 |
yield combined
|
| 218 |
|
| 219 |
except Exception as e:
|
|
|
|
| 220 |
return f"Error: {e}"
|
| 221 |
|
| 222 |
css = """
|
|
|
|
| 198 |
]
|
| 199 |
|
| 200 |
try:
|
| 201 |
+
print(prompt_msg)
|
| 202 |
openai_response = openai.ChatCompletion.create(
|
| 203 |
model="gpt-3.5-turbo",
|
| 204 |
messages=prompt_msg,
|
|
|
|
| 209 |
frequency_penalty=1,
|
| 210 |
presence_penalty=1,
|
| 211 |
)
|
| 212 |
+
print(openai_response)
|
| 213 |
|
| 214 |
combined = ""
|
| 215 |
for resp in openai_response:
|
|
|
|
| 219 |
yield combined
|
| 220 |
|
| 221 |
except Exception as e:
|
| 222 |
+
print(e)
|
| 223 |
return f"Error: {e}"
|
| 224 |
|
| 225 |
css = """
|