Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,9 @@ import os
|
|
7 |
title = "BLOOM"
|
8 |
description = """Gradio Demo for BLOOM. To use it, simply add your text, or click one of the examples to load them.
|
9 |
|
10 |
-
Tips:
|
11 |
-
|
|
|
12 |
Start a paragraph as if YOU were writing a blog, webpage, math post, coding article and BLOOM will generate a coherent follow-up. Longer prompts usually give more interesting results.
|
13 |
|
14 |
Options:
|
@@ -22,9 +23,15 @@ HF_API_TOKEN = os.getenv("HF_API_TOKEN")
|
|
22 |
hf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, "huggingface/bloom_internal_prompts", organization="huggingface")
|
23 |
|
24 |
|
|
|
|
|
|
|
25 |
examples = [
|
26 |
['A "whatpu" is a small, furry animal native to Tanzania. An example of a sentence that uses the word whatpu is: We were traveling in Africa and we saw these very cute whatpus. To do a "farduddle" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:', 32, "Sample", "Sample 1"],
|
|
|
27 |
["Pour déguster un ortolan, il faut tout d'abord", 32, "Sample", "Sample 1"],
|
|
|
|
|
28 |
["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 32, "Sample", "Sample 1"],
|
29 |
["Math exercise - answers:\n34+10=44\n54+20=", 16, "Greedy", "Sample 1"],
|
30 |
["Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:", 24, "Greedy", "Sample 1"],
|
@@ -70,7 +77,7 @@ gr.Interface(
|
|
70 |
gr.inputs.Textbox(label="Input"),
|
71 |
gr.inputs.Slider(1, 64, default=32, step=1, label="Tokens to generate"),
|
72 |
gr.inputs.Radio(["Sample", "Greedy"], label="Sample or greedy"),
|
73 |
-
gr.inputs.Radio(["Sample 1", "Sample 2", "Sample 3"], label="Sample other generations", type="index"),
|
74 |
],
|
75 |
gr.outputs.Textbox(label="Output"),
|
76 |
examples=examples,
|
|
|
7 |
title = "BLOOM"
|
8 |
description = """Gradio Demo for BLOOM. To use it, simply add your text, or click one of the examples to load them.
|
9 |
|
10 |
+
Tips:
|
11 |
+
- Do NOT talk to BLOOM as an entity, it's not a chatbot but a webpage/blog/article completion model.
|
12 |
+
- For the best results: MIMIC a few sentences of a webpage similar to the content you want to generate.
|
13 |
Start a paragraph as if YOU were writing a blog, webpage, math post, coding article and BLOOM will generate a coherent follow-up. Longer prompts usually give more interesting results.
|
14 |
|
15 |
Options:
|
|
|
23 |
hf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, "huggingface/bloom_internal_prompts", organization="huggingface")
|
24 |
|
25 |
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
examples = [
|
30 |
['A "whatpu" is a small, furry animal native to Tanzania. An example of a sentence that uses the word whatpu is: We were traveling in Africa and we saw these very cute whatpus. To do a "farduddle" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:', 32, "Sample", "Sample 1"],
|
31 |
+
['A poem about the beauty of science by Alfred Edgar Brittle\nTitle: The Magic Craft\nIn the old times', 50, "Sample", "Sample 1"],
|
32 |
["Pour déguster un ortolan, il faut tout d'abord", 32, "Sample", "Sample 1"],
|
33 |
+
['Traduce español de España a español de Argentina\nEl coche es rojo - el auto es rojo\nEl ordenador es nuevo - la computadora es nueva\nel boligrafo es negro -', 16, "Sample", "Sample 1"],
|
34 |
+
['Estos ejemplos quitan vocales de las palabras\nEjemplos:\nhola - hl\nmanzana - mnzn\npapas - pps\nalacran - lcrn\npapa -', 16, "Sample", "Sample 1"],
|
35 |
["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 32, "Sample", "Sample 1"],
|
36 |
["Math exercise - answers:\n34+10=44\n54+20=", 16, "Greedy", "Sample 1"],
|
37 |
["Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:", 24, "Greedy", "Sample 1"],
|
|
|
77 |
gr.inputs.Textbox(label="Input"),
|
78 |
gr.inputs.Slider(1, 64, default=32, step=1, label="Tokens to generate"),
|
79 |
gr.inputs.Radio(["Sample", "Greedy"], label="Sample or greedy"),
|
80 |
+
gr.inputs.Radio(["Sample 1", "Sample 2", "Sample 3", "Sample 4", "Sample 5"], label="Sample other generations (only work in 'Sample' mode", type="index"),
|
81 |
],
|
82 |
gr.outputs.Textbox(label="Output"),
|
83 |
examples=examples,
|