Sample / app.py
Shredder's picture
Update app.py
626e7c3
raw
history blame
561 Bytes
import gradio as gr
def load_questions():
questions = []
with open('questions.txt') as f:
questions = f.readlines()
return questions
questions = load_questions()
def con(file):
with open(file.name) as f:
text = f.read()
return text
demo = gr.Blocks()
with demo:
txt_file = gr.File(type="txt",label='CONTRACT')
text = gr.Textbox(lines=10)
selected_ques=gr.Dropdown(choices=questions,label='SEARCH QUERY')
b1 = gr.Button("Analyze File")
b1.click(con, inputs=txt_file, outputs=text)
demo.launch()