Update app.py
Browse files
app.py
CHANGED
@@ -70,7 +70,9 @@ def load_questions_short():
|
|
70 |
questions_short = f.readlines()
|
71 |
return questions_short
|
72 |
|
73 |
-
def quad(query,
|
|
|
|
|
74 |
questions = load_questions()
|
75 |
questions_short = load_questions_short()
|
76 |
if (not len(paragraph)==0) and not (len(question)==0):
|
@@ -99,5 +101,5 @@ def quad(query, paragraph):
|
|
99 |
#iface = gr.Interface(fn=get_sustainability, inputs="textbox", title="CONBERT",description="SUSTAINABILITY TOOL", outputs=gr.HighlightedText(), allow_flagging="never")
|
100 |
#iface.launch()
|
101 |
|
102 |
-
iface = gr.Interface(fn=
|
103 |
iface.launch()
|
|
|
70 |
questions_short = f.readlines()
|
71 |
return questions_short
|
72 |
|
73 |
+
def quad(query,file):
|
74 |
+
with open(file) as f:
|
75 |
+
paragraph = f.read()
|
76 |
questions = load_questions()
|
77 |
questions_short = load_questions_short()
|
78 |
if (not len(paragraph)==0) and not (len(question)==0):
|
|
|
101 |
#iface = gr.Interface(fn=get_sustainability, inputs="textbox", title="CONBERT",description="SUSTAINABILITY TOOL", outputs=gr.HighlightedText(), allow_flagging="never")
|
102 |
#iface.launch()
|
103 |
|
104 |
+
iface = gr.Interface(fn=quad, inputs=[gr.inputs.Textbox(label='SEARCH QUERY'),gr.inputs.file(label='TXT FILE')], title="CONBERT",description="SUSTAINABILITY TOOL",theme='hugging face',article='Article', outputs=[gr.outputs.Textbox(label='Answer'),gr.outputs.Textbox(label='Summary')], allow_flagging="never")
|
105 |
iface.launch()
|