songhieng commited on
Commit
c3d7a4c
·
verified ·
1 Parent(s): f31a765

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -899,11 +899,13 @@ with tab5:
899
  if st.button("Evaluate Model", type="primary", width="stretch"):
900
  with st.spinner("Evaluating model..."):
901
  try:
902
- # Initialize evaluator
903
- evaluator = ModelEvaluator(
904
- model_path=st.session_state.model_path,
905
- use_cuda=st.session_state.cuda_status['available'] if st.session_state.cuda_status else False
906
- )
 
 
907
 
908
  # Prepare test data (use validation split from uploaded data)
909
  df = st.session_state.uploaded_data
 
899
  if st.button("Evaluate Model", type="primary", width="stretch"):
900
  with st.spinner("Evaluating model..."):
901
  try:
902
+ # Initialize evaluator and load model
903
+ evaluator = ModelEvaluator()
904
+
905
+ # Load the trained model
906
+ if not evaluator.load_model(st.session_state.model_path):
907
+ st.error("Failed to load model for evaluation")
908
+ st.stop()
909
 
910
  # Prepare test data (use validation split from uploaded data)
911
  df = st.session_state.uploaded_data