csuvikv commited on
Commit
9708f41
1 Parent(s): 8ac0962

initial commit

Browse files
Files changed (1) hide show
  1. app.py +19 -0
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()