Spaces:
Running
Running
Saiteja Solleti
commited on
Commit
·
471dc07
1
Parent(s):
9673f4e
ui changes
Browse files
app.py
CHANGED
@@ -99,15 +99,16 @@ def EvaluateRAGModel(question, evaluation_model, reranking_model):
|
|
99 |
return answer, rmsecontextrel, rmsecontextutil, aucscore, execution_time
|
100 |
except Exception as e:
|
101 |
print(f"Error in evaluation: {e}")
|
102 |
-
return "I apologize, but I encountered an error processing your question. Please try again.", 0, 0, 0, time.time() - start_time
|
103 |
|
104 |
# Create Gradio UI
|
105 |
with gr.Blocks() as iface:
|
106 |
gr.Markdown("## Capstone Project Group 10 ")
|
|
|
107 |
|
108 |
with gr.Row():
|
109 |
question_input = gr.Textbox(label="Enter your Question", lines=5)
|
110 |
-
with gr.Column(scale=
|
111 |
|
112 |
dropdown_input = gr.Dropdown(
|
113 |
["LLaMA 3.3", "Mistral 7B","Deepseek 70b"],
|
@@ -123,10 +124,13 @@ with gr.Blocks() as iface:
|
|
123 |
|
124 |
submit_button = gr.Button("Evaluate Model")
|
125 |
|
|
|
|
|
|
|
126 |
with gr.Row():
|
127 |
with gr.Column():
|
128 |
gr.Markdown("### Response")
|
129 |
-
response = gr.Textbox(interactive=False, show_label=False, lines=
|
130 |
|
131 |
with gr.Row():
|
132 |
with gr.Column():
|
|
|
99 |
return answer, rmsecontextrel, rmsecontextutil, aucscore, execution_time
|
100 |
except Exception as e:
|
101 |
print(f"Error in evaluation: {e}")
|
102 |
+
return "I apologize, but I encountered an error processing your question. Please try again.", 0, 0, 0, time.time() - start_time, gr.update(value=f"⚠️ {str(e)}", visible=True)
|
103 |
|
104 |
# Create Gradio UI
|
105 |
with gr.Blocks() as iface:
|
106 |
gr.Markdown("## Capstone Project Group 10 ")
|
107 |
+
|
108 |
|
109 |
with gr.Row():
|
110 |
question_input = gr.Textbox(label="Enter your Question", lines=5)
|
111 |
+
with gr.Column(scale=0.5):
|
112 |
|
113 |
dropdown_input = gr.Dropdown(
|
114 |
["LLaMA 3.3", "Mistral 7B","Deepseek 70b"],
|
|
|
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():
|
132 |
gr.Markdown("### Response")
|
133 |
+
response = gr.Textbox(interactive=False, show_label=False, lines=2)
|
134 |
|
135 |
with gr.Row():
|
136 |
with gr.Column():
|