nehda10 commited on
Commit
9bd7437
Β·
verified Β·
1 Parent(s): a71a333

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -13,7 +13,6 @@ import numpy as np
13
  from tensorflow.keras.models import load_model
14
  from tensorflow.keras.preprocessing import image
15
  import matplotlib.pyplot as plt
16
- from huggingface_hub import hf_hub_download
17
 
18
 
19
  # ------------------------- PAGE CONFIG -------------------------
@@ -50,12 +49,8 @@ elif app_mode == "🩻 X-ray Classifier":
50
  if uploaded_image:
51
  with st.spinner("πŸ” Predicting..."):
52
  try:
53
- # βœ… Download model from Hugging Face Hub (only once, then cached)
54
- model_path = hf_hub_download(
55
- repo_id="nehda10/covid-xray-model", # πŸ‘ˆ Your HF model repo
56
- filename="covid_xray_model.keras"
57
- )
58
- model = load_model(model_path)
59
  st.success("βœ… Model loaded successfully!")
60
 
61
  # βœ… Process image and predict
 
13
  from tensorflow.keras.models import load_model
14
  from tensorflow.keras.preprocessing import image
15
  import matplotlib.pyplot as plt
 
16
 
17
 
18
  # ------------------------- PAGE CONFIG -------------------------
 
49
  if uploaded_image:
50
  with st.spinner("πŸ” Predicting..."):
51
  try:
52
+ # βœ… Load model from local models/ folder (no download, no 403 error)
53
+ model = load_model("models/covid_xray_model.keras")
 
 
 
 
54
  st.success("βœ… Model loaded successfully!")
55
 
56
  # βœ… Process image and predict