handled the HFToken Not Found Error
Browse files
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 |
-
|
75 |
-
|
|
|
|
|
|
|
|
|
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(
|