File size: 386 Bytes
cb87193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from scraper import scrape_site
from cleaner import clean_data

def chatbot(message, history):

    if message.startswith("scrape"):

        url = message.replace("scrape ", "")

        data = scrape_site(url)

        clean = clean_data(data)

        return "\n".join(clean[:10])

    return "Tape: scrape URL"

demo = gr.ChatInterface(fn=chatbot)

demo.launch()