hancav commited on
Commit
0e89322
1 Parent(s): 53431b4
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -170,9 +170,9 @@ def on_files_cleared():
170
  return(gr.CheckboxGroup(choices=[]))
171
 
172
  # Define the Gradio interface
173
- title = "Deep Learning - Natural Language Processing"
174
- subtitle = "Questão e Resposta assistida por LLMs sobre documentos PDF"
175
- authors = "Hugo Cavalaria | Nuno Seiça | Ricardo Neves | Wilton Nagase"
176
  custom_layout = "<h1>{}</h1><h2>{}</h2><p>{}</p>".format(title,subtitle,authors)
177
 
178
  # Get the list of languages available
@@ -187,15 +187,15 @@ with gr.Blocks() as interface:
187
 
188
  with gr.Row():
189
  with gr.Column(scale=1):
190
- upload_pdfs = gr.Files(label="Fazer upload de ficheiros PDF", interactive=True, file_types=['.pdf'], container=True)
191
- checkbox_group = gr.CheckboxGroup(label="Selecionar os ficheiros a utilizar.", choices=[], interactive=True)
192
- question_text = gr.Textbox(label="Pergunta:")
193
- answer_language = gr.Dropdown(label="Selecionar uma linguagem para tradução da resposta.", choices=language_names, value="Portuguese")
194
  secret_key = gr.Textbox(label="OpenAI API Key:")
195
  with gr.Column(scale=1):
196
- output_status = gr.Textbox(label="Resposta:")
197
 
198
- btn = gr.Button("Perguntar")
199
 
200
  btn.click(fn=run_qa,
201
  inputs=[upload_pdfs,checkbox_group,question_text,answer_language,secret_key],
 
170
  return(gr.CheckboxGroup(choices=[]))
171
 
172
  # Define the Gradio interface
173
+ title = "Question/Answer over Documents"
174
+ subtitle = "OpenAI GPT 3.5 Turbo LLM assisted Question/Answer over multiple PDF context documents"
175
+ authors = "Hugo Cavalaria "
176
  custom_layout = "<h1>{}</h1><h2>{}</h2><p>{}</p>".format(title,subtitle,authors)
177
 
178
  # Get the list of languages available
 
187
 
188
  with gr.Row():
189
  with gr.Column(scale=1):
190
+ upload_pdfs = gr.Files(label="Upload multiple PDF files.", interactive=True, file_types=['.pdf'], container=True)
191
+ checkbox_group = gr.CheckboxGroup(label="Select the files to question.", choices=[], interactive=True)
192
+ question_text = gr.Textbox(label="Question:")
193
+ answer_language = gr.Dropdown(label="Answer translation to:", choices=language_names, value="Portuguese")
194
  secret_key = gr.Textbox(label="OpenAI API Key:")
195
  with gr.Column(scale=1):
196
+ output_status = gr.Textbox(label="Answer:")
197
 
198
+ btn = gr.Button("Ask")
199
 
200
  btn.click(fn=run_qa,
201
  inputs=[upload_pdfs,checkbox_group,question_text,answer_language,secret_key],