toolkit / examples /summarize_website.py
lgaleana's picture
Ad example
2f0960b
raw
history blame
519 Bytes
import gradio as gr
from components import AITask, CodeTask
from examples import demo_buttons, demo_tasks
DEMO_ID = __name__
tasks = [
CodeTask(
0,
"https://huggingface.co/",
visible=True,
code_value="Get text from a website. No html. No empty lines.",
),
AITask(1, "Summarize: {t0}", visible=True),
]
demo_tasks[DEMO_ID] = tasks
def render():
demo_id = gr.Textbox(DEMO_ID, visible=False)
tasks[0].render()
tasks[1].render()
demo_buttons(demo_id, tasks)