Spaces:
Build error
Build error
update
Browse files
app.py
CHANGED
@@ -39,7 +39,8 @@ def text_generate(problem, template): #prompt
|
|
39 |
print(f"Problem is :{problem}")
|
40 |
print(f"Template is :{template}")
|
41 |
|
42 |
-
p = problem + "A: " + template
|
|
|
43 |
json_ = {"inputs": p,
|
44 |
"parameters":
|
45 |
{
|
@@ -71,9 +72,9 @@ with demo:
|
|
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
|
75 |
|
76 |
-
example_template = gr.Radio( ["Let’s think step by step
|
77 |
|
78 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
79 |
generated_txt = gr.Textbox(lines=10)
|
|
|
39 |
print(f"Problem is :{problem}")
|
40 |
print(f"Template is :{template}")
|
41 |
|
42 |
+
p = problem + "A: " + template #+ "\n"
|
43 |
+
print(f"Final prompt is : {p}")
|
44 |
json_ = {"inputs": p,
|
45 |
"parameters":
|
46 |
{
|
|
|
72 |
|
73 |
#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")
|
74 |
|
75 |
+
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 Problem")
|
76 |
|
77 |
+
example_template = gr.Radio( ["Let’s think step by step.\n"," First, ", " Let’s think about this logically.\n", "Let’s solve this problem by splitting it into steps.\n", " Let’s be realistic and think step by step.\n", "Let’s think like a detective step by step.\n", "Let’s think ", "Before we dive into the answer, ", "The answer is after the proof.\n"], label= "Choose a sample Template for Zero-Shot CoT")
|
78 |
|
79 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
80 |
generated_txt = gr.Textbox(lines=10)
|