Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,13 @@ from transformers import pipeline
|
|
4 |
generator = pipeline('text-generation', model='gpt2')
|
5 |
|
6 |
def generate(text):
|
7 |
-
result = generator(text, max_length=
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|
11 |
["The Moon's orbit around Earth has"],
|
12 |
["The smooth Borealis basin in the Northern Hemisphere covers 40%"],
|
|
|
13 |
]
|
14 |
|
15 |
demo = gr.Interface(
|
|
|
4 |
generator = pipeline('text-generation', model='gpt2')
|
5 |
|
6 |
def generate(text):
|
7 |
+
result = generator(text, max_length=50, num_return_sequences=1)
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|
11 |
["The Moon's orbit around Earth has"],
|
12 |
["The smooth Borealis basin in the Northern Hemisphere covers 40%"],
|
13 |
+
["The tallest mountain on Mars is located"],
|
14 |
]
|
15 |
|
16 |
demo = gr.Interface(
|