File size: 782 Bytes
790c6c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from summarizer import summarize_text

def create_gradio_interface():
    # Define the Gradio interface
    interface = gr.Interface(fn=summarize_text,
                             inputs=gr.Textbox(label="Enter Text", placeholder="Paste the text you want to summarize here...", lines=10),
                             outputs=gr.Textbox(label="Summary", placeholder="Here is the summary..."),
                             title="Text Summarizer App",
                             description="This app uses a machine learning model to summarize text while preserving its meaning and making it easy to understand.")
    return interface

if __name__ == "__main__":
    # Run the app
    gradio_interface = create_gradio_interface()
    gradio_interface.launch()