jeremierostan commited on
Commit
6c30aba
·
verified ·
1 Parent(s): bfc5546

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -177,10 +177,10 @@ with gr.Blocks() as iface:
177
  gr.Markdown("# Data Protection Team")
178
  gr.Markdown("Get responses combining advanced RAG, Long Context, and SOTA models to data protection related questions.")
179
 
180
- with gr.Row():
181
- gdpr_checkbox = gr.Checkbox(label="GDPR (EU)")
182
- ferpa_checkbox = gr.Checkbox(label="FERPA (US)")
183
- coppa_checkbox = gr.Checkbox(label="COPPA (US <13)")
184
 
185
  gr.Markdown("**Optional: upload additional PDFs if needed (national regulation, school policy)**")
186
  additional_pdfs = gr.File(
@@ -202,14 +202,12 @@ with gr.Blocks() as iface:
202
  gemini_output = gr.Textbox(label="Long Context (Gemini 1.5 Pro) Response")
203
  final_output = gr.HTML(label="Final (GPT-4o) Response")
204
 
 
 
 
205
  load_button.click(
206
- load_pdfs,
207
- inputs=[
208
- gdpr_checkbox,
209
- ferpa_checkbox,
210
- coppa_checkbox,
211
- additional_pdfs
212
- ],
213
  outputs=load_output
214
  )
215
 
 
177
  gr.Markdown("# Data Protection Team")
178
  gr.Markdown("Get responses combining advanced RAG, Long Context, and SOTA models to data protection related questions.")
179
 
180
+ regulations_checkboxes = gr.CheckboxGroup(
181
+ choices=["GDPR (EU)", "FERPA (US)", "COPPA (US <13)"],
182
+ label="Select Regulations"
183
+ )
184
 
185
  gr.Markdown("**Optional: upload additional PDFs if needed (national regulation, school policy)**")
186
  additional_pdfs = gr.File(
 
202
  gemini_output = gr.Textbox(label="Long Context (Gemini 1.5 Pro) Response")
203
  final_output = gr.HTML(label="Final (GPT-4o) Response")
204
 
205
+ def prepare_regulations(selected):
206
+ return [reg.split()[0] for reg in selected]
207
+
208
  load_button.click(
209
+ lambda selected, additional: load_pdfs(prepare_regulations(selected), additional),
210
+ inputs=[regulations_checkboxes, additional_pdfs],
 
 
 
 
 
211
  outputs=load_output
212
  )
213