File size: 422 Bytes
bc925c7
 
2f6a99d
bc925c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from transformers import pipeline
import gradio as gr
# I add cmt

# Initialize the summarization model
model = pipeline("summarization")


def predict(prompt):
    summary = model(prompt)[0]["summary_text"]
    return summary


# Create a Gradio interface
interface = gr.Interface(fn=predict, inputs=gr.Textbox(placeholder="Enter text to summarize", lines=4), outputs="text")


# Launch the interface
interface.launch()