chiichann commited on
Commit
e5d7069
·
verified ·
1 Parent(s): ca85db8

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -2
src/streamlit_app.py CHANGED
@@ -22,7 +22,7 @@ ECO_TIPS = {
22
  'plastic': "🧴 *Tip:* Not all plastics are recyclable. Check the plastic code and always clean before disposal."
23
  }
24
 
25
- # Determine model path (adjust for local vs Hugging Face)
26
  try:
27
  current_dir = os.path.abspath(os.path.dirname(__file__))
28
  except NameError:
@@ -30,7 +30,7 @@ except NameError:
30
 
31
  if "HF_SPACE_ID" in os.environ:
32
  # Running on Hugging Face Spaces
33
- MODEL_PATH = os.path.join("/app", "src", "models", "trashsort_cnn.h5")
34
  else:
35
  # Local development
36
  MODEL_PATH = os.path.join(current_dir, "src", "models", "trashsort_cnn.h5")
 
22
  'plastic': "🧴 *Tip:* Not all plastics are recyclable. Check the plastic code and always clean before disposal."
23
  }
24
 
25
+ # Determine model path (fix for Hugging Face Spaces)
26
  try:
27
  current_dir = os.path.abspath(os.path.dirname(__file__))
28
  except NameError:
 
30
 
31
  if "HF_SPACE_ID" in os.environ:
32
  # Running on Hugging Face Spaces
33
+ MODEL_PATH = os.path.join("/app", "models", "trashsort_cnn.h5")
34
  else:
35
  # Local development
36
  MODEL_PATH = os.path.join(current_dir, "src", "models", "trashsort_cnn.h5")