Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
-
|
2 |
-
from gradio.mix import Parallel
|
3 |
|
4 |
-
|
5 |
-
|
|
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
generator = pipeline('text-generation', model='bigscience/bloom-560m')
|
|
|
2 |
|
3 |
+
def generate(text):
|
4 |
+
result = generator(text, max_length=100, num_return_sequences=1)
|
5 |
+
return result[0]["generated_text"]
|
6 |
|
7 |
+
examples = [
|
8 |
+
["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
|
9 |
+
["Zoe only recently began writing songs."],
|
10 |
+
]
|
11 |
+
|
12 |
+
demo = gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label="Input Text"), outputs=gr.outputs.Textbox(label="Generated Text"),
|
13 |
+
examples=examples)
|
14 |
+
|
15 |
+
demo.launch()
|