ysharma HF staff commited on
Commit
fba21b8
1 Parent(s): 3e4f50c
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -43,19 +43,18 @@ A: Joy had 5 balls. 2 cans of 3 balls each is 6 balls. 5 + 6 = 11. Answer is 11.
43
  Q: Jane has 16 balls. Half balls are golf balls, and half golf balls are red. How many red golf balls are there?
44
  A: """
45
 
46
- prompt = """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?
47
  A: Let’s think step by step.
48
  """
49
 
50
  examples = [["river"], ["night"], ["trees"],["table"],["laughs"]]
51
 
52
 
53
- def text_generate(word):
54
 
55
  #p = prompt + word.lower() + "\n" + "poem using word: "
56
- p = prompt #+ word.lower()
57
- print(f"*****Inside poem_generate - Prompt is :{p}")
58
- json_ = {"inputs": p,
59
  "parameters":
60
  {
61
  "top_p": 0.9,
@@ -91,14 +90,15 @@ with demo:
91
  """Testing Bloom """
92
  )
93
  with gr.Row():
94
- input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
 
95
  generated_txt = gr.Textbox(lines=7)
96
  #output_image = gr.Image(type="filepath", shape=(256,256))
97
 
98
  b1 = gr.Button("Generate Text")
99
  #b2 = gr.Button("Generate Image")
100
 
101
- b1.click(text_generate,inputs=input_word, outputs=generated_txt) #input_word
102
  #b2.click(poem_to_image, poem_txt, output_image)
103
  #examples=examples
104
 
 
43
  Q: Jane has 16 balls. Half balls are golf balls, and half golf balls are red. How many red golf balls are there?
44
  A: """
45
 
46
+ prompt3 = """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?
47
  A: Let’s think step by step.
48
  """
49
 
50
  examples = [["river"], ["night"], ["trees"],["table"],["laughs"]]
51
 
52
 
53
+ def text_generate(prompt):
54
 
55
  #p = prompt + word.lower() + "\n" + "poem using word: "
56
+ print(f"*****Inside poem_generate - Prompt is :{prompt}")
57
+ json_ = {"inputs": prompt,
 
58
  "parameters":
59
  {
60
  "top_p": 0.9,
 
90
  """Testing Bloom """
91
  )
92
  with gr.Row():
93
+ 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"], label= "Choose a sample Prompt")
94
+ #input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
95
  generated_txt = gr.Textbox(lines=7)
96
  #output_image = gr.Image(type="filepath", shape=(256,256))
97
 
98
  b1 = gr.Button("Generate Text")
99
  #b2 = gr.Button("Generate Image")
100
 
101
+ b1.click(text_generate,inputs=example_prompt, outputs=generated_txt) #input_word
102
  #b2.click(poem_to_image, poem_txt, output_image)
103
  #examples=examples
104