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