Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
generator = pipeline('text-generation', model='
|
5 |
|
6 |
def generate(text):
|
7 |
result = generator(text, max_length=30, num_return_sequences=1)
|
@@ -12,11 +12,7 @@ examples = [
|
|
12 |
["Zoe only recently began writing songs."],
|
13 |
]
|
14 |
|
15 |
-
demo = gr.Interface(
|
16 |
-
|
17 |
-
inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
|
18 |
-
outputs=gr.outputs.Textbox(label="Generated Text"),
|
19 |
-
examples=examples
|
20 |
-
)
|
21 |
|
22 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
generator = pipeline('text-generation', model='huggingface/bigscience/bloomz-1b7')
|
5 |
|
6 |
def generate(text):
|
7 |
result = generator(text, max_length=30, num_return_sequences=1)
|
|
|
12 |
["Zoe only recently began writing songs."],
|
13 |
]
|
14 |
|
15 |
+
demo = gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label="Input Text"), outputs=gr.outputs.Textbox(label="Generated Text"),
|
16 |
+
examples=examples)
|
|
|
|
|
|
|
|
|
17 |
|
18 |
demo.launch()
|