Spaces:
Runtime error
Runtime error
fix: get back the stop sequence for now
Browse files
app.py
CHANGED
|
@@ -54,7 +54,7 @@ else:
|
|
| 54 |
prompt_dict = dict(sorted(prompt_dict.items(), key=lambda x: x[1], reverse=True))
|
| 55 |
examples = [[x] for x in prompt_dict.keys()]
|
| 56 |
|
| 57 |
-
stop_sequences = [":پایان","@","#","$",
|
| 58 |
|
| 59 |
# examples = [
|
| 60 |
# ["<$غزل$@بر دلم هر ذره داغی می توان کردن"],
|
|
@@ -155,13 +155,11 @@ def generate(
|
|
| 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 |
-
|
| 162 |
-
#yield output
|
| 163 |
yield output
|
| 164 |
-
|
| 165 |
return output
|
| 166 |
|
| 167 |
additional_inputs=[
|
|
|
|
| 54 |
prompt_dict = dict(sorted(prompt_dict.items(), key=lambda x: x[1], reverse=True))
|
| 55 |
examples = [[x] for x in prompt_dict.keys()]
|
| 56 |
|
| 57 |
+
stop_sequences = ["<|endoftext|>"] # ":پایان","@","#","$",
|
| 58 |
|
| 59 |
# examples = [
|
| 60 |
# ["<$غزل$@بر دلم هر ذره داغی می توان کردن"],
|
|
|
|
| 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 |
+
yield output
|
|
|
|
| 161 |
yield output
|
| 162 |
+
|
| 163 |
return output
|
| 164 |
|
| 165 |
additional_inputs=[
|