Spaces:
Runtime error
Runtime error
Commit
·
42dda94
1
Parent(s):
baef8bc
Update app.py
Browse files
app.py
CHANGED
@@ -11,13 +11,13 @@ tokenizer = GPT2Tokenizer.from_pretrained(
|
|
11 |
text_generator = pipeline("text-generation", model=AutoModelWithLMHead.from_pretrained('azaninello/GPT2-icc'),
|
12 |
tokenizer='LorenzoDeMattei/GePpeTto',
|
13 |
do_sample=True,
|
14 |
-
max_length=
|
15 |
top_k=50,
|
16 |
top_p=0.95,
|
17 |
repetition_penalty=9.5)
|
18 |
|
19 |
def generator(scrivi_qualcosa = ''):
|
20 |
-
result = text_generator(scrivi_qualcosa, max_length=
|
21 |
return shroom_result[0]["generated_text"]
|
22 |
|
23 |
iface = gr.Interface(fn=generator, inputs="text", outputs="text")
|
|
|
11 |
text_generator = pipeline("text-generation", model=AutoModelWithLMHead.from_pretrained('azaninello/GPT2-icc'),
|
12 |
tokenizer='LorenzoDeMattei/GePpeTto',
|
13 |
do_sample=True,
|
14 |
+
max_length=200,
|
15 |
top_k=50,
|
16 |
top_p=0.95,
|
17 |
repetition_penalty=9.5)
|
18 |
|
19 |
def generator(scrivi_qualcosa = ''):
|
20 |
+
result = text_generator(scrivi_qualcosa, max_length=200)
|
21 |
return shroom_result[0]["generated_text"]
|
22 |
|
23 |
iface = gr.Interface(fn=generator, inputs="text", outputs="text")
|