ysharma HF staff commited on
Commit
a7e2869
1 Parent(s): f8679fa
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -31,13 +31,13 @@ A: Let’s think step by step.
31
  """
32
 
33
 
34
- def text_generate(prompt, problem, template):
35
 
36
  #prints to debug
37
  print(f"*****Inside text_generate function******")
38
- print(f"Prompt is :{prompt}")
39
- print(f"Problem is :{prompt}")
40
- print(f"Template is :{prompt}")
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=[example_prompt, example_problem, example_template], outputs=generated_txt)
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)