Update app.py
Browse files
app.py
CHANGED
@@ -76,8 +76,12 @@ async def complete(
|
|
76 |
seed=seed,
|
77 |
stream=True
|
78 |
)
|
79 |
-
for
|
80 |
-
|
|
|
|
|
|
|
|
|
81 |
et = time()
|
82 |
output["time"] = et - st
|
83 |
#return output
|
|
|
76 |
seed=seed,
|
77 |
stream=True
|
78 |
)
|
79 |
+
for chunk in output:
|
80 |
+
delta = chunk['choices'][0]['delta']
|
81 |
+
if 'role' in delta:
|
82 |
+
print(delta['role'], end=': ')
|
83 |
+
elif 'content' in delta:
|
84 |
+
print(delta['content'], end='')
|
85 |
et = time()
|
86 |
output["time"] = et - st
|
87 |
#return output
|