Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -64,7 +64,7 @@ def meme_generate(img): #prompt, generated_txt): #, input_prompt_sql ): #, input
|
|
| 64 |
"temperature": 2,
|
| 65 |
#"num_return_sequences": 3,
|
| 66 |
"return_full_text": True,
|
| 67 |
-
"do_sample":
|
| 68 |
},
|
| 69 |
"options":
|
| 70 |
{"use_cache": True,
|
|
@@ -86,31 +86,7 @@ def meme_generate(img): #prompt, generated_txt): #, input_prompt_sql ): #, input
|
|
| 86 |
print(f"Response after removing new line entries is: {final_solution}")
|
| 87 |
else:
|
| 88 |
final_solution = solution
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
#if len(generated_txt) == 0 :
|
| 92 |
-
# display_output = final_solution
|
| 93 |
-
#else:
|
| 94 |
-
# display_output = generated_txt[:-len(prompt)] + final_solution
|
| 95 |
-
#new_prompt = final_solution[len(prompt):]
|
| 96 |
-
#print(f"new prompt for next cycle is : {new_prompt}")
|
| 97 |
-
#print(f"display_output for printing on screen is : {display_output}")
|
| 98 |
-
#if len(new_prompt) == 0:
|
| 99 |
-
# temp_text = display_output[::-1]
|
| 100 |
-
# print(f"What is the last character of sentence? : {temp_text[0]}")
|
| 101 |
-
# if temp_text[1] == '.':
|
| 102 |
-
# first_period_loc = temp_text[2:].find('.') + 1
|
| 103 |
-
# print(f"Location of last Period is: {first_period_loc}")
|
| 104 |
-
# new_prompt = display_output[-first_period_loc:-1]
|
| 105 |
-
# print(f"Not sending blank as prompt so new prompt for next cycle is : {new_prompt}")
|
| 106 |
-
# else:
|
| 107 |
-
# print("HERE")
|
| 108 |
-
# first_period_loc = temp_text.find('.')
|
| 109 |
-
# print(f"Location of last Period is : {first_period_loc}")
|
| 110 |
-
# new_prompt = display_output[-first_period_loc:-1]
|
| 111 |
-
# print(f"Not sending blank as prompt so new prompt for next cycle is : {new_prompt}")
|
| 112 |
-
# display_output = display_output[:-1]
|
| 113 |
-
|
| 114 |
meme_image = write_on_image(final_solution)
|
| 115 |
return meme_image #final_solution #display_output, new_prompt #generated_txt+prompt
|
| 116 |
|
|
|
|
| 64 |
"temperature": 2,
|
| 65 |
#"num_return_sequences": 3,
|
| 66 |
"return_full_text": True,
|
| 67 |
+
"do_sample": True,
|
| 68 |
},
|
| 69 |
"options":
|
| 70 |
{"use_cache": True,
|
|
|
|
| 86 |
print(f"Response after removing new line entries is: {final_solution}")
|
| 87 |
else:
|
| 88 |
final_solution = solution
|
| 89 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
meme_image = write_on_image(final_solution)
|
| 91 |
return meme_image #final_solution #display_output, new_prompt #generated_txt+prompt
|
| 92 |
|