vitaliy-sharandin
commited on
Commit
•
a1fb2a8
1
Parent(s):
e06231c
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
model = pipeline('text-generation', model='vitaliy-sharandin/wiseai')
|
5 |
+
|
6 |
+
def generate_text(prompt):
|
7 |
+
result = model(prompt, max_length=200)
|
8 |
+
return result[0]['generated_text']
|
9 |
+
|
10 |
+
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
|
11 |
+
iface.launch()
|