File size: 427 Bytes
0126aab
 
 
 
 
 
f48c5be
0126aab
 
 
 
 
0023da7
0126aab
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline

pipeline_flan=pipeline(model="google/flan-t5-xl")

def generatellm(text):
  output_flan = pipeline_flan(text, max_length=100)[0]["generated_text"]
  return output_flan 

gradio_ui= gr.Interface(
    fn=translate,
    title="Translation Demo",
    inputs= gr.components.Textbox(label="Enter your text"),
    outputs=gr.outputs.Textbox(label="Results")
)

gradio_ui.launch()