mirror of
https://github.com/tcsenpai/easy-web-summarizer.git
synced 2025-06-06 10:35:20 +00:00
Add web UI for document summarization
This commit is contained in:
parent
c18dd8eeb5
commit
f22044abf1
20
webui.py
Normal file
20
webui.py
Normal file
@ -0,0 +1,20 @@
|
||||
import gradio as gr
|
||||
from summarizer import setup_summarization_chain, load_document
|
||||
|
||||
|
||||
def summarize(url):
|
||||
docs = load_document(url)
|
||||
llm_chain = setup_summarization_chain()
|
||||
result = llm_chain.run(docs)
|
||||
return result
|
||||
|
||||
|
||||
iface = gr.Interface(
|
||||
fn=summarize,
|
||||
inputs="text",
|
||||
outputs="text",
|
||||
title="Summarizer",
|
||||
description="Enter a URL to get a summary of the document.",
|
||||
)
|
||||
|
||||
iface.launch()
|
Loading…
x
Reference in New Issue
Block a user