File size: 561 Bytes
3f3ca03
 
626e7c3
 
 
 
 
 
 
 
 
 
 
 
3f3ca03
 
4cc3a06
626e7c3
 
3f3ca03
4cc3a06
626e7c3
4cc3a06
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()