ananttripathiak commited on
Commit
704fdd8
Β·
verified Β·
1 Parent(s): 52992f2

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. src/app.py +12 -4
src/app.py CHANGED
@@ -195,13 +195,21 @@ def main() -> None:
195
 
196
  st.header("πŸ“Š Quick Stats")
197
  if is_in_space:
 
198
  if config.HF_TOKEN and config.HF_MODEL_REPO:
199
- st.success("βœ… Model Available")
200
- st.caption("Model will be loaded from Hugging Face Hub")
201
  else:
202
- st.error("❌ HF_TOKEN not configured")
203
- st.caption("Set HF_TOKEN as Space secret")
 
 
 
 
 
 
204
  else:
 
205
  if os.path.exists(config.BEST_MODEL_LOCAL_PATH):
206
  st.success("βœ… Model Available")
207
  st.caption("Trained model found locally")
 
195
 
196
  st.header("πŸ“Š Quick Stats")
197
  if is_in_space:
198
+ # In Space: always show HF model status
199
  if config.HF_TOKEN and config.HF_MODEL_REPO:
200
+ st.success("βœ… Model Ready")
201
+ st.caption(f"Loading from: {config.HF_MODEL_REPO}")
202
  else:
203
+ st.error("❌ Configuration Missing")
204
+ st.caption("Set HF_TOKEN as Space secret in Settings")
205
+ st.markdown("""
206
+ **To fix:**
207
+ 1. Go to Space Settings
208
+ 2. Add secret: `HF_TOKEN`
209
+ 3. Restart Space
210
+ """)
211
  else:
212
+ # Local development: check local model
213
  if os.path.exists(config.BEST_MODEL_LOCAL_PATH):
214
  st.success("βœ… Model Available")
215
  st.caption("Trained model found locally")