louiecerv commited on
Commit
f83d804
·
1 Parent(s): 8e811e0

handled the HFToken Not Found Error

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -71,8 +71,12 @@ with st.expander("About This App"):
71
  """)
72
 
73
  # Code to upload the trained model to Hugging Face using huggingface_hub
74
- hf_token = os.getenv("HF_TOKEN")
75
- repo_id = "wvsu-dti-aidev-team/advertising_knn_regressor_model"
 
 
 
 
76
 
77
  api = HfApi()
78
  api.upload_file(
 
71
  """)
72
 
73
  # Code to upload the trained model to Hugging Face using huggingface_hub
74
+ try:
75
+ hf_token = os.getenv("HF_TOKEN")
76
+ repo_id = "wvsu-dti-aidev-team/advertising_knn_regressor_model"
77
+ except Exception as e:
78
+ st.error(f"Error: {e}")
79
+ st.stop()
80
 
81
  api = HfApi()
82
  api.upload_file(