Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ A: Let’s think step by step.
|
|
32 |
|
33 |
|
34 |
|
35 |
-
def text_generate(prompt): #, input_prompt_sql ): #, input_prompt_dalle2):
|
36 |
|
37 |
print(f"*****Inside poem_generate - Prompt is :{prompt}")
|
38 |
#if input_prompt_sql != '':
|
@@ -82,7 +82,7 @@ def text_generate(prompt): #, input_prompt_sql ): #, input_prompt_dalle2):
|
|
82 |
#poem = poem.replace('?','')
|
83 |
#print(f"Poem being returned is: {poem}")
|
84 |
prompt = final_solution[len(prompt):]
|
85 |
-
return
|
86 |
|
87 |
|
88 |
demo = gr.Blocks()
|
@@ -107,7 +107,8 @@ with demo:
|
|
107 |
#with gr.Row():
|
108 |
input_prompt = gr.Textbox(label="Write some text to get started...", lines=3) #input_prompt_sql
|
109 |
#input_prompt_dalle2 = gr.Textbox(label="Or Write sample Dalle2 prompts to get more Prompt ideas...")
|
110 |
-
#input_prompt2 = gr.Textbox(label="Write some text to get started...", lines=
|
|
|
111 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
112 |
with gr.Row():
|
113 |
generated_txt = gr.Textbox(lines=7, visible = True)
|
@@ -116,7 +117,7 @@ with demo:
|
|
116 |
b1 = gr.Button("Generate Text")
|
117 |
#b2 = gr.Button("Generate Image")
|
118 |
|
119 |
-
b1.click(text_generate, inputs=input_prompt, outputs=[generated_txt, input_prompt]) #input_word #input_prompt_dalle2 #input_prompt_sql #example_prompt
|
120 |
#b2.click(poem_to_image, poem_txt, output_image)
|
121 |
#examples=examples
|
122 |
|
|
|
32 |
|
33 |
|
34 |
|
35 |
+
def text_generate(prompt, generated_txt): #, input_prompt_sql ): #, input_prompt_dalle2):
|
36 |
|
37 |
print(f"*****Inside poem_generate - Prompt is :{prompt}")
|
38 |
#if input_prompt_sql != '':
|
|
|
82 |
#poem = poem.replace('?','')
|
83 |
#print(f"Poem being returned is: {poem}")
|
84 |
prompt = final_solution[len(prompt):]
|
85 |
+
return generated_txt+prompt, prompt #final_solution
|
86 |
|
87 |
|
88 |
demo = gr.Blocks()
|
|
|
107 |
#with gr.Row():
|
108 |
input_prompt = gr.Textbox(label="Write some text to get started...", lines=3) #input_prompt_sql
|
109 |
#input_prompt_dalle2 = gr.Textbox(label="Or Write sample Dalle2 prompts to get more Prompt ideas...")
|
110 |
+
#input_prompt2 = gr.Textbox(label="Write some text to get started...", lines=3, visible=False) #input_prompt_sql
|
111 |
+
|
112 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
113 |
with gr.Row():
|
114 |
generated_txt = gr.Textbox(lines=7, visible = True)
|
|
|
117 |
b1 = gr.Button("Generate Text")
|
118 |
#b2 = gr.Button("Generate Image")
|
119 |
|
120 |
+
b1.click(text_generate, inputs=[input_prompt, generated_txt], outputs=[generated_txt, input_prompt]) #input_word #input_prompt_dalle2 #input_prompt_sql #example_prompt
|
121 |
#b2.click(poem_to_image, poem_txt, output_image)
|
122 |
#examples=examples
|
123 |
|