initial commit
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline, set_seed
|
3 |
+
|
4 |
+
|
5 |
+
generator = pipeline('text-generation', model='gpt2')
|
6 |
+
set_seed(42)
|
7 |
+
|
8 |
+
|
9 |
+
def Bemenet(bemenet):
|
10 |
+
return generator(bemenet, max_length=100, num_return_sequences=2)[1]['generated_text']
|
11 |
+
|
12 |
+
|
13 |
+
interface = gr.Interface(fn=Bemenet,
|
14 |
+
title="Cím..",
|
15 |
+
description="Leírás..",
|
16 |
+
inputs="text",
|
17 |
+
outputs="text")
|
18 |
+
|
19 |
+
interface.launch()
|