File size: 543 Bytes
ca146e9
677ba43
 
3d08384
677ba43
0707719
 
677ba43
9976475
ca146e9
677ba43
 
 
 
ca55f88
9976475
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from transformers import pipeline
import gradio as gr

model = pipeline("summarization", model="gsasikiran/bart-base-finetuned-cnn", tokenizer="facebook/bart-base")
title = "Article Title Generator"
description = "Generates titles for articles based on the input text."
article = "The quick brown fox jumps over the lazy dog."

hf = gr.Interface(
    fn=model,
    inputs=gr.Textbox(lines=5, label="Input Text"),
    title=title,
    description=description,
    article=article,
    outputs = gr.Textbox(lines=2, label="Title")
)

hf.launch()