Spaces:
Runtime error
Runtime error
File size: 853 Bytes
cbcc9fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
from main import fetch_webpage_content, parse_and_segment_content, summarize_text
def summarize_webpage(url):
html_content = fetch_webpage_content(url)
if html_content:
chunks = parse_and_segment_content(html_content)
summary = summarize_text(chunks)
if summary:
return summary
else:
return "Failed to generate a summary."
else:
return "Failed to fetch or process webpage content."
interface = gr.Interface(fn=summarize_webpage,
inputs=gr.Textbox(lines=2, placeholder="Enter URL Here..."),
outputs="text",
title="Webpage Summarizer",
description="Paste the URL of a webpage to get a summarized content.")
if __name__ == "__main__":
interface.launch() |