rutsam commited on
Commit
0126aab
1 Parent(s): 5f2b5ac

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipeline_flan=pipeline(model="google/flan-t5-xl")
5
+
6
+ def generatellm(text):
7
+ output_flan = pipe_flan(text, max_length=100)[0]["generated_text"]
8
+ return output_flan
9
+
10
+ gradio_ui= gr.Interface(
11
+ fn=translate,
12
+ title="Translation Demo",
13
+ inputs= gr.components.Textbox(label="Enter your text")
14
+
15
+ outputs=gr.outputs.Textbox(label="Results")
16
+ )
17
+
18
+ gradio_ui.launch()