Update src/streamlit_app.py
Browse files9 unmodified lines101112131415161718192021222324252627289 unmodified lines# ========== Load Model ==========MODEL_PATH = os.path.join("models", "model.h5") # No ".." needed anymoreif not os.path.exists(MODEL_PATH):st.error(f"Model file not found at: {MODEL_PATH}")st.stop()model = tf.keras.models.load_model(MODEL_PATH)if not os.path.exists(MODEL_PATH):st.error(f"❌ Model file not found at: {MODEL_PATH}")st.stop()else:model = tf.keras.models.load_model(MODEL_PATH)# ========== Class Labels ==========# Replace with your actual class names if needed9 unmodified lines10111213141516171819202122232425262728293031323334353637383940414243449 unmodified lines# ========== Load Model ==========MODEL_PATH = os.path.join("models", "model.h5") # This is the current correct path# --- Debugging Lines ---st.write(f"Current working directory: {os.getcwd()}")st.write(f"Absolute path being checked: {os.path.abspath(MODEL_PATH)}")# List contents of the current working directorytry:st.write(f"Contents of CWD ({os.getcwd()}): {os.listdir(os.getcwd())}")except Exception as e:st.write(f"Error listing CWD: {e}")# List contents of the 'models' directory if it existsmodels_dir_abs = os.path.join(os.getcwd(), "models")st.write(f"Does 'models' directory exist at {models_dir_abs}: {os.path.exists(models_dir_abs)}")if os.path.exists(models_dir_abs):try:st.write(f"Contents of 'models' directory: {os.listdir(models_dir_abs)}")except Exception as e:st.write(f"Error listing 'models' directory: {e}")else:st.write("The 'models' directory itself was not found in CWD.")# --- End Debugging Lines ---if not os.path.exists(MODEL_PATH):st.error(f"Model file not found at: {MODEL_PATH}")st.stop()model = tf.keras.models.load_model(MODEL_PATH)# ========== Class Labels ==========# Replace with your actual class names if needed
src/streamlit_app.py+24-8