File size: 1,104 Bytes
6caef3b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import gradio as gr
import os
from functools import partial
from full_scraping_script_v3 import run_scrapping
import gdown
from config import json_url_id
download_url = f'https://drive.google.com/uc?id={json_url_id}'
output = 'secret_google_service_account.json'
gdown.download(download_url, output, quiet=False)
title = ""
with gr.Blocks(title=title,theme='nota-ai/theme',css="footer {visibility: hidden}") as demo:
gr.Markdown(f"## {title}")
with gr.Row():
with gr.Column(scale=6):
with gr.Row():
with gr.Column(scale=8):
password = gr.Textbox( lines=1, label="Tatooine password")
cookie = gr.Textbox( lines=1, label="Cookie")
with gr.Column(scale=1):
chat_submit_button = gr.Button(value="Submit ▶")
with gr.Row():
listing = gr.Markdown("Waiting for password...")
fn_chat = run_scrapping
chat_submit_button.click(fn=fn_chat, inputs=[password, cookie], outputs=[listing])
demo.launch(max_threads=40)
|