Spaces:
Build error
Build error
app.py
CHANGED
@@ -34,13 +34,13 @@ A: Let’s think step by step.
|
|
34 |
def text_generate(prompt):
|
35 |
|
36 |
#prints for debug
|
37 |
-
print(f"*****Inside
|
38 |
json_ = {"inputs": prompt,
|
39 |
"parameters":
|
40 |
{
|
41 |
"top_p": 0.9,
|
42 |
"temperature": 1.1,
|
43 |
-
|
44 |
"return_full_text": True
|
45 |
}}
|
46 |
response = requests.post(API_URL, headers=headers, json=json_)
|
@@ -63,7 +63,7 @@ with demo:
|
|
63 |
""" [BigScienceW Bloom](https://twitter.com/BigscienceW) \n\n Large language models have demonstrated a capability of 'Chain-of-thought reasoning'. Some amazing researchers( [Jason Wei et al.](https://arxiv.org/abs/2206.07682)) recently found out that by addding **Lets think step by step** it improves the model's zero-shot performance. Some might say — You can get good results out of LLMs if you know how to speak to them."""
|
64 |
)
|
65 |
with gr.Row():
|
66 |
-
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:
|
67 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
68 |
generated_txt = gr.Textbox(lines=7)
|
69 |
|
|
|
34 |
def text_generate(prompt):
|
35 |
|
36 |
#prints for debug
|
37 |
+
print(f"*****Inside text_generate function - Prompt is :{prompt}")
|
38 |
json_ = {"inputs": prompt,
|
39 |
"parameters":
|
40 |
{
|
41 |
"top_p": 0.9,
|
42 |
"temperature": 1.1,
|
43 |
+
"max_new_tokens": 250,
|
44 |
"return_full_text": True
|
45 |
}}
|
46 |
response = requests.post(API_URL, headers=headers, json=json_)
|
|
|
63 |
""" [BigScienceW Bloom](https://twitter.com/BigscienceW) \n\n Large language models have demonstrated a capability of 'Chain-of-thought reasoning'. Some amazing researchers( [Jason Wei et al.](https://arxiv.org/abs/2206.07682)) recently found out that by addding **Lets think step by step** it improves the model's zero-shot performance. Some might say — You can get good results out of LLMs if you know how to speak to them."""
|
64 |
)
|
65 |
with gr.Row():
|
66 |
+
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")
|
67 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
68 |
generated_txt = gr.Textbox(lines=7)
|
69 |
|