Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -67,9 +67,10 @@ def text_generate(prompt):
|
|
| 67 |
print(f"Response is : {response}")
|
| 68 |
output = response.json()
|
| 69 |
print(f"output is : {output}") #{output}")
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
| 73 |
#if "\n\n" not in output_tmp:
|
| 74 |
# if output_tmp.find('.') != -1:
|
| 75 |
# idx = output_tmp.find('.')
|
|
@@ -92,7 +93,7 @@ with demo:
|
|
| 92 |
"""Testing Bloom """
|
| 93 |
)
|
| 94 |
with gr.Row():
|
| 95 |
-
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?
|
| 96 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
| 97 |
generated_txt = gr.Textbox(lines=7)
|
| 98 |
#output_image = gr.Image(type="filepath", shape=(256,256))
|
|
|
|
| 67 |
print(f"Response is : {response}")
|
| 68 |
output = response.json()
|
| 69 |
print(f"output is : {output}") #{output}")
|
| 70 |
+
output_tmp = output[0]['generated_text']
|
| 71 |
+
print(f"Bloom response without splits is: {output_tmp}")
|
| 72 |
+
solution = output[0]['generated_text'].split("\n\n")[0] # +"."
|
| 73 |
+
print(f"Final response after splits is: {solution}")
|
| 74 |
#if "\n\n" not in output_tmp:
|
| 75 |
# if output_tmp.find('.') != -1:
|
| 76 |
# idx = output_tmp.find('.')
|
|
|
|
| 93 |
"""Testing Bloom """
|
| 94 |
)
|
| 95 |
with gr.Row():
|
| 96 |
+
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")
|
| 97 |
#input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
|
| 98 |
generated_txt = gr.Textbox(lines=7)
|
| 99 |
#output_image = gr.Image(type="filepath", shape=(256,256))
|