File size: 376 Bytes
a341bb9
34a917f
 
3a59162
34a917f
 
 
 
 
 
 
eb668fd
8d04d24
34a917f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from transformers import pipeline 
import gradio as gr

summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-base", truncation=True, framework="tf")

def translate(text):
    results = summarizer(text, min_length=180, truncation = True)
    return results

iface = gr.Interface(
    fn=translate, 
    inputs = "text", 
    outputs = "text",
)

iface.launch()