Spaces:
Sleeping
Sleeping
Update helper.py
Browse files
helper.py
CHANGED
@@ -39,9 +39,8 @@ def get_fn(model_name: str, **model_kwargs) -> Callable:
|
|
39 |
response_text = ""
|
40 |
# Iterate over the streaming response
|
41 |
for chunk in response:
|
42 |
-
if
|
43 |
-
|
44 |
-
content = delta.get('content', '')
|
45 |
if content:
|
46 |
response_text += content
|
47 |
yield response_text.strip()
|
|
|
39 |
response_text = ""
|
40 |
# Iterate over the streaming response
|
41 |
for chunk in response:
|
42 |
+
if len(chunk.choices[0]) > 0:
|
43 |
+
content = chunk.choices[0].delta.content
|
|
|
44 |
if content:
|
45 |
response_text += content
|
46 |
yield response_text.strip()
|