Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,14 @@ from utils import grammatical_cleaning
|
|
6 |
|
7 |
dante = pipeline('text-generation',model='.', tokenizer='GroNLP/gpt2-small-italian-embeddings')
|
8 |
|
|
|
|
|
|
|
|
|
9 |
def get_text(input):
|
10 |
generated = dante(input, max_length=128)[0]['generated_text']
|
11 |
generated = grammatical_cleaning(generated)
|
12 |
return generated
|
13 |
|
14 |
-
iface = gr.Interface(fn=get_text, inputs="text", outputs="text")
|
15 |
iface.launch()
|
|
|
6 |
|
7 |
dante = pipeline('text-generation',model='.', tokenizer='GroNLP/gpt2-small-italian-embeddings')
|
8 |
|
9 |
+
title = "Dante's style text generation"
|
10 |
+
description = """
|
11 |
+
Play with Dante's style text generation. Base model is gpt-2-small-italian, fine-tuned on Dante Alighieri's corpus.
|
12 |
+
|
13 |
def get_text(input):
|
14 |
generated = dante(input, max_length=128)[0]['generated_text']
|
15 |
generated = grammatical_cleaning(generated)
|
16 |
return generated
|
17 |
|
18 |
+
iface = gr.Interface(fn=get_text, inputs="text", outputs="text",examples=sample_text, description=description)
|
19 |
iface.launch()
|