Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -14,7 +14,7 @@ app = FastAPI()
|
|
| 14 |
def streaming(userText,idf):
|
| 15 |
|
| 16 |
if str(idf)=="1":
|
| 17 |
-
openaikey =
|
| 18 |
openai.api_key = openaikey
|
| 19 |
print(idf)
|
| 20 |
|
|
@@ -85,7 +85,7 @@ def streaming(userText,idf):
|
|
| 85 |
|
| 86 |
for chunk in response:
|
| 87 |
try:
|
| 88 |
-
print(chunk.choices[0].delta.content)
|
| 89 |
yield chunk.choices[0].delta.content
|
| 90 |
except:
|
| 91 |
yield ""
|
|
|
|
| 14 |
def streaming(userText,idf):
|
| 15 |
|
| 16 |
if str(idf)=="1":
|
| 17 |
+
openaikey = api_key
|
| 18 |
openai.api_key = openaikey
|
| 19 |
print(idf)
|
| 20 |
|
|
|
|
| 85 |
|
| 86 |
for chunk in response:
|
| 87 |
try:
|
| 88 |
+
#print(chunk.choices[0].delta.content)
|
| 89 |
yield chunk.choices[0].delta.content
|
| 90 |
except:
|
| 91 |
yield ""
|