Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -90,28 +90,28 @@ def meme_generate(img): #prompt, generated_txt): #, input_prompt_sql ): #, input
|
|
| 90 |
final_solution = solution
|
| 91 |
|
| 92 |
|
| 93 |
-
if len(generated_txt) == 0 :
|
| 94 |
-
|
| 95 |
-
else:
|
| 96 |
-
|
| 97 |
-
new_prompt = final_solution[len(prompt):]
|
| 98 |
-
print(f"new prompt for next cycle is : {new_prompt}")
|
| 99 |
-
print(f"display_output for printing on screen is : {display_output}")
|
| 100 |
-
if len(new_prompt) == 0:
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
|
| 116 |
meme_image = write_on_image(final_solution)
|
| 117 |
return meme_image #final_solution #display_output, new_prompt #generated_txt+prompt
|
|
|
|
| 90 |
final_solution = solution
|
| 91 |
|
| 92 |
|
| 93 |
+
#if len(generated_txt) == 0 :
|
| 94 |
+
# display_output = final_solution
|
| 95 |
+
#else:
|
| 96 |
+
# display_output = generated_txt[:-len(prompt)] + final_solution
|
| 97 |
+
#new_prompt = final_solution[len(prompt):]
|
| 98 |
+
#print(f"new prompt for next cycle is : {new_prompt}")
|
| 99 |
+
#print(f"display_output for printing on screen is : {display_output}")
|
| 100 |
+
#if len(new_prompt) == 0:
|
| 101 |
+
# temp_text = display_output[::-1]
|
| 102 |
+
# print(f"What is the last character of sentence? : {temp_text[0]}")
|
| 103 |
+
# if temp_text[1] == '.':
|
| 104 |
+
# first_period_loc = temp_text[2:].find('.') + 1
|
| 105 |
+
# print(f"Location of last Period is: {first_period_loc}")
|
| 106 |
+
# new_prompt = display_output[-first_period_loc:-1]
|
| 107 |
+
# print(f"Not sending blank as prompt so new prompt for next cycle is : {new_prompt}")
|
| 108 |
+
# else:
|
| 109 |
+
# print("HERE")
|
| 110 |
+
# first_period_loc = temp_text.find('.')
|
| 111 |
+
# print(f"Location of last Period is : {first_period_loc}")
|
| 112 |
+
# new_prompt = display_output[-first_period_loc:-1]
|
| 113 |
+
# print(f"Not sending blank as prompt so new prompt for next cycle is : {new_prompt}")
|
| 114 |
+
# display_output = display_output[:-1]
|
| 115 |
|
| 116 |
meme_image = write_on_image(final_solution)
|
| 117 |
return meme_image #final_solution #display_output, new_prompt #generated_txt+prompt
|