Spaces:
Build error
Build error
update
Browse files
app.py
CHANGED
@@ -31,13 +31,13 @@ A: Let’s think step by step.
|
|
31 |
"""
|
32 |
|
33 |
|
34 |
-
def text_generate(
|
35 |
|
36 |
#prints to debug
|
37 |
print(f"*****Inside text_generate function******")
|
38 |
-
print(f"Prompt is :{prompt}")
|
39 |
-
print(f"Problem is :{
|
40 |
-
print(f"Template is :{
|
41 |
|
42 |
p = problem + "A: " + template + "\n"
|
43 |
json_ = {"inputs": p,
|
@@ -69,7 +69,7 @@ with demo:
|
|
69 |
)
|
70 |
with gr.Row():
|
71 |
|
72 |
-
example_prompt = gr.Radio( ["Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?\nA: Let’s think step by step.\n", "Q: Roger has 5 tennis balls already. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?\nA: Let’s think step by step.\n", "Q: On an average Joe throws 25 punches per minute. His fight lasts 5 rounds of 3 minutes each. How many punches did he throw?\nA: Let’s think about this logically.\n"], label= "Choose a sample Prompt")
|
73 |
|
74 |
example_problem = gr.Radio( ["Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?\n", "Q: Roger has 5 tennis balls already. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?\n", "Q: On an average Joe throws 25 punches per minute. His fight lasts 5 rounds of 3 minutes each. How many punches did he throw?\n"], label= "Choose a sample Prompt")
|
75 |
|
@@ -80,6 +80,6 @@ with demo:
|
|
80 |
|
81 |
|
82 |
b1 = gr.Button("Generate Text")
|
83 |
-
b1.click(text_generate,inputs=[
|
84 |
|
85 |
demo.launch(enable_queue=True, debug=True)
|
|
|
31 |
"""
|
32 |
|
33 |
|
34 |
+
def text_generate(problem, template): #prompt
|
35 |
|
36 |
#prints to debug
|
37 |
print(f"*****Inside text_generate function******")
|
38 |
+
#print(f"Prompt is :{prompt}")
|
39 |
+
print(f"Problem is :{problem}")
|
40 |
+
print(f"Template is :{template}")
|
41 |
|
42 |
p = problem + "A: " + template + "\n"
|
43 |
json_ = {"inputs": p,
|
|
|
69 |
)
|
70 |
with gr.Row():
|
71 |
|
72 |
+
#example_prompt = gr.Radio( ["Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?\nA: Let’s think step by step.\n", "Q: Roger has 5 tennis balls already. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?\nA: Let’s think step by step.\n", "Q: On an average Joe throws 25 punches per minute. His fight lasts 5 rounds of 3 minutes each. How many punches did he throw?\nA: Let’s think about this logically.\n"], label= "Choose a sample Prompt")
|
73 |
|
74 |
example_problem = gr.Radio( ["Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?\n", "Q: Roger has 5 tennis balls already. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?\n", "Q: On an average Joe throws 25 punches per minute. His fight lasts 5 rounds of 3 minutes each. How many punches did he throw?\n"], label= "Choose a sample Prompt")
|
75 |
|
|
|
80 |
|
81 |
|
82 |
b1 = gr.Button("Generate Text")
|
83 |
+
b1.click(text_generate,inputs=[example_problem, example_template], outputs=generated_txt) #example_prompt
|
84 |
|
85 |
demo.launch(enable_queue=True, debug=True)
|