Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,9 +26,13 @@ def predict(message, history):
|
|
| 26 |
frequency_penalty=0, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
| 27 |
presence_penalty=0, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
| 28 |
)
|
| 29 |
-
|
| 30 |
partial_message = ""
|
| 31 |
for chunk in response:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
if len(chunk['choices'][0]['delta']) != 0:
|
| 33 |
partial_message = partial_message + chunk['choices'][0]['delta']['content']
|
| 34 |
yield partial_message
|
|
|
|
| 26 |
frequency_penalty=0, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
| 27 |
presence_penalty=0, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
| 28 |
)
|
| 29 |
+
print(response.choices[0]['message']['content'])
|
| 30 |
partial_message = ""
|
| 31 |
for chunk in response:
|
| 32 |
+
print(chunk)
|
| 33 |
+
print(chunk['choices'])
|
| 34 |
+
print(chunk['choices'][0])
|
| 35 |
+
print(chunk['choices'][0]['delta'])
|
| 36 |
if len(chunk['choices'][0]['delta']) != 0:
|
| 37 |
partial_message = partial_message + chunk['choices'][0]['delta']['content']
|
| 38 |
yield partial_message
|