File size: 320 Bytes
ed6faba
 
 
c6144cf
ed6faba
c6144cf
ed6faba
c6144cf
 
 
ed6faba
c6144cf
ed6faba
1
2
3
4
5
6
7
8
9
10
11
12
13
import os
import gradio as gr
import numpy as np
from transformers import pipeline

pipe = pipeline("text2text-generation", model="google/flan-t5-large")

def inference(text):
  output = pipe(text)
  return output["generated_text"]

io = gr.Interface.load(inference, gr.Textbox(lines=3), gr.Textbox(lines=3))
io.launch()