Saiteja Solleti commited on
Commit
4601ab4
·
1 Parent(s): 0d85ff6
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -124,8 +124,9 @@ with gr.Blocks() as iface:
124
 
125
  submit_button = gr.Button("Evaluate Model")
126
 
127
- # Alert for Errors (Initially Hidden)
128
- error_alert = gr.Textbox(visible=False, interactive=False, label="Error", elem_id="error_alert")
 
129
 
130
  with gr.Row():
131
  with gr.Column():
@@ -151,7 +152,11 @@ with gr.Blocks() as iface:
151
 
152
 
153
  # Connect submit button to evaluation function
154
- submit_button.click(EvaluateRAGModel, inputs=[question_input, dropdown_input,reranker_dropdown], outputs=[response, rmsecontextrel, rmsecontextutil, aucscore, processingTime, error_alert])
 
 
 
 
155
 
156
  # Run the Gradio app
157
  iface.launch()
 
124
 
125
  submit_button = gr.Button("Evaluate Model")
126
 
127
+ with gr.Modal() as error_popup:
128
+ gr.Markdown("⚠️ **Error Alert**")
129
+ error_text = gr.Textbox(interactive=False, show_label=False)
130
 
131
  with gr.Row():
132
  with gr.Column():
 
152
 
153
 
154
  # Connect submit button to evaluation function
155
+ submit_button.click(
156
+ EvaluateRAGModel,
157
+ inputs=[question_input, dropdown_input,reranker_dropdown],
158
+ outputs=[response, rmsecontextrel, rmsecontextutil, aucscore, processingTime, error_text]
159
+ ).then(error_popup.show, inputs=[], outputs=[])
160
 
161
  # Run the Gradio app
162
  iface.launch()