app.py
CHANGED
@@ -170,9 +170,9 @@ def on_files_cleared():
|
|
170 |
return(gr.CheckboxGroup(choices=[]))
|
171 |
|
172 |
# Define the Gradio interface
|
173 |
-
title = "
|
174 |
-
subtitle = "
|
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,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="
|
191 |
-
checkbox_group = gr.CheckboxGroup(label="
|
192 |
-
question_text = gr.Textbox(label="
|
193 |
-
answer_language = gr.Dropdown(label="
|
194 |
secret_key = gr.Textbox(label="OpenAI API Key:")
|
195 |
with gr.Column(scale=1):
|
196 |
-
output_status = gr.Textbox(label="
|
197 |
|
198 |
-
btn = gr.Button("
|
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],
|