Spaces:
Runtime error
Runtime error
fix: no yield for now
Browse files
app.py
CHANGED
|
@@ -146,7 +146,7 @@ def generate(
|
|
| 146 |
|
| 147 |
output = ""
|
| 148 |
for response in stream:
|
| 149 |
-
print('stream',response)
|
| 150 |
|
| 151 |
if len(ENDPOINT)>0:
|
| 152 |
output += response.generated_text if response.generated_text else ""
|
|
@@ -155,10 +155,12 @@ def generate(
|
|
| 155 |
|
| 156 |
for stop_str in stop_sequences:
|
| 157 |
if output.endswith(stop_str):
|
|
|
|
| 158 |
output = output[:-len(stop_str)]
|
| 159 |
output = output.rstrip()
|
| 160 |
-
|
| 161 |
-
|
|
|
|
| 162 |
|
| 163 |
return output
|
| 164 |
|
|
|
|
| 146 |
|
| 147 |
output = ""
|
| 148 |
for response in stream:
|
| 149 |
+
#print('stream',response)
|
| 150 |
|
| 151 |
if len(ENDPOINT)>0:
|
| 152 |
output += response.generated_text if response.generated_text else ""
|
|
|
|
| 155 |
|
| 156 |
for stop_str in stop_sequences:
|
| 157 |
if output.endswith(stop_str):
|
| 158 |
+
print(stop_str, output)
|
| 159 |
output = output[:-len(stop_str)]
|
| 160 |
output = output.rstrip()
|
| 161 |
+
print(output)
|
| 162 |
+
#yield output
|
| 163 |
+
#yield output
|
| 164 |
|
| 165 |
return output
|
| 166 |
|