Shredder commited on
Commit
8027117
1 Parent(s): 3090b4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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, paragraph):
 
 
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=get_sustainability, 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")
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()