HB_GPT_text / app.py
0xharib's picture
Update app.py
c2580fc
raw
history blame contribute delete
991 Bytes
import gradio as gr
def urlProcess(url,urlQuery):
return urlQuery
def uploadProcess(upload,uploadQuery):
return uploadQuery
with gr.Blocks() as demo:
gr.Markdown("Upload a text file or provide a URL")
with gr.Tab("URL"):
with gr.Row():
url = gr.Textbox(label='URL to be parsed:',lines=8)
urlQuery = gr.Textbox(label='Your query:',lines=8)
urlButton = gr.Button("Submit")
urlOutput = gr.Textbox(label='Results:',lines=8)
with gr.Tab("Upload File"):
with gr.Row():
upload = gr.File(file_count="multiple",file_types=["text"],label="Upload File")
uploadQuery = gr.Textbox(label='Your query:',lines=8)
uploadButton = gr.Button("Submit")
uploadOutput = gr.Textbox(label='Results:',lines=8)
urlButton.click(fn=urlProcess, inputs=[url,urlQuery],outputs=urlOutput)
uploadButton.click(fn=uploadProcess, inputs=[upload,uploadQuery],outputs=uploadOutput)
demo.launch()