Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -58,15 +58,11 @@ def respond(
|
|
58 |
|
59 |
response = ""
|
60 |
|
61 |
-
isFirst = True
|
62 |
for event in resp:
|
63 |
data = json.loads(event['data'])
|
64 |
token = data['Choices'][0]['Delta']['Content']
|
65 |
|
66 |
response += token
|
67 |
-
if isFirst:
|
68 |
-
print(event)
|
69 |
-
isFirst = False
|
70 |
yield response
|
71 |
|
72 |
except TencentCloudSDKException as err:
|
|
|
58 |
|
59 |
response = ""
|
60 |
|
|
|
61 |
for event in resp:
|
62 |
data = json.loads(event['data'])
|
63 |
token = data['Choices'][0]['Delta']['Content']
|
64 |
|
65 |
response += token
|
|
|
|
|
|
|
66 |
yield response
|
67 |
|
68 |
except TencentCloudSDKException as err:
|