Spaces:
Runtime error
Runtime error
fix: if the response is str then handle it properly
Browse files
app.py
CHANGED
|
@@ -600,7 +600,10 @@ def generate(
|
|
| 600 |
#print('stream',response)
|
| 601 |
|
| 602 |
if len(ENDPOINT)>0:
|
| 603 |
-
|
|
|
|
|
|
|
|
|
|
| 604 |
else:
|
| 605 |
output += response
|
| 606 |
|
|
|
|
| 600 |
#print('stream',response)
|
| 601 |
|
| 602 |
if len(ENDPOINT)>0:
|
| 603 |
+
if isinstance(response, str):
|
| 604 |
+
output += response if response else ""
|
| 605 |
+
else:
|
| 606 |
+
output += response.generated_text if response.generated_text else ""
|
| 607 |
else:
|
| 608 |
output += response
|
| 609 |
|