Spaces:
Runtime error
Runtime error
upd
Browse files
app.py
CHANGED
|
@@ -81,8 +81,13 @@ def text_generate(prompt, generated_txt): #, input_prompt_sql ): #, input_prompt
|
|
| 81 |
# poem = output_tmp.split("\n\n")[0] # +"."
|
| 82 |
#poem = poem.replace('?','')
|
| 83 |
#print(f"Poem being returned is: {poem}")
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
demo = gr.Blocks()
|
|
|
|
| 81 |
# poem = output_tmp.split("\n\n")[0] # +"."
|
| 82 |
#poem = poem.replace('?','')
|
| 83 |
#print(f"Poem being returned is: {poem}")
|
| 84 |
+
if len(generated_txt) == 0 :
|
| 85 |
+
display_output = final_solution
|
| 86 |
+
else:
|
| 87 |
+
display_output = generated_txt[:len(prompt)] + final_solution
|
| 88 |
+
new_prompt = final_solution[len(prompt):]
|
| 89 |
+
|
| 90 |
+
return display_output, new_prompt #generated_txt+prompt #final_solution
|
| 91 |
|
| 92 |
|
| 93 |
demo = gr.Blocks()
|