Spaces:
Runtime error
Runtime error
ai-forever
commited on
Commit
•
74e721c
1
Parent(s):
8dc740e
Update app.py
Browse files
app.py
CHANGED
@@ -37,14 +37,16 @@ def generate(prompt: str):
|
|
37 |
no_repeat_ngram_size=5
|
38 |
)
|
39 |
generated_text = list(map(tokenizer.decode, out))[0]
|
40 |
-
return generated_text
|
41 |
|
|
|
|
|
42 |
|
43 |
interface = gr.Interface.load("huggingface/sberbank-ai/mGPT-armenian",
|
44 |
description=description,
|
45 |
examples=examples,
|
46 |
fn=generate,
|
47 |
-
inputs="text",
|
48 |
outputs='text',
|
49 |
thumbnail = 'https://habrastorage.org/r/w1560/getpro/habr/upload_files/26a/fa1/3e1/26afa13e1d1a56f54c7b0356761af7b8.png',
|
50 |
theme = "peach",
|
|
|
37 |
no_repeat_ngram_size=5
|
38 |
)
|
39 |
generated_text = list(map(tokenizer.decode, out))[0]
|
40 |
+
return generated_text #+ '\n\n'+transl(generated_text, src='hy', dest='en')
|
41 |
|
42 |
+
length = gr.inputs.Slider(200, 1000)
|
43 |
+
contexto = gr.inputs.Textbox(lines=10, placeholder="Write your text here")
|
44 |
|
45 |
interface = gr.Interface.load("huggingface/sberbank-ai/mGPT-armenian",
|
46 |
description=description,
|
47 |
examples=examples,
|
48 |
fn=generate,
|
49 |
+
inputs=inputs=[contexto,length],#"text",
|
50 |
outputs='text',
|
51 |
thumbnail = 'https://habrastorage.org/r/w1560/getpro/habr/upload_files/26a/fa1/3e1/26afa13e1d1a56f54c7b0356761af7b8.png',
|
52 |
theme = "peach",
|