Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +8 -3
src/streamlit_app.py
CHANGED
|
@@ -94,15 +94,20 @@ def recommend(movie):
|
|
| 94 |
def load_model_files():
|
| 95 |
"""Load model files from Hugging Face Hub with caching."""
|
| 96 |
try:
|
|
|
|
|
|
|
|
|
|
| 97 |
# Download files from your Hugging Face repository
|
| 98 |
movie_list_path = hf_hub_download(
|
| 99 |
-
repo_id="N4F1U/Movie_Recommender",
|
| 100 |
-
filename="movie_list.pkl"
|
|
|
|
| 101 |
)
|
| 102 |
|
| 103 |
similarity_path = hf_hub_download(
|
| 104 |
repo_id="N4F1U/Movie_Recommender",
|
| 105 |
-
filename="similarity.pkl"
|
|
|
|
| 106 |
)
|
| 107 |
|
| 108 |
# Load the pickle files
|
|
|
|
| 94 |
def load_model_files():
|
| 95 |
"""Load model files from Hugging Face Hub with caching."""
|
| 96 |
try:
|
| 97 |
+
# Create a cache directory in the current working directory
|
| 98 |
+
cache_dir = "./.hf_cache"
|
| 99 |
+
|
| 100 |
# Download files from your Hugging Face repository
|
| 101 |
movie_list_path = hf_hub_download(
|
| 102 |
+
repo_id="N4F1U/Movie_Recommender",
|
| 103 |
+
filename="movie_list.pkl",
|
| 104 |
+
cache_dir=cache_dir # Specify custom cache directory
|
| 105 |
)
|
| 106 |
|
| 107 |
similarity_path = hf_hub_download(
|
| 108 |
repo_id="N4F1U/Movie_Recommender",
|
| 109 |
+
filename="similarity.pkl",
|
| 110 |
+
cache_dir=cache_dir # Specify custom cache directory
|
| 111 |
)
|
| 112 |
|
| 113 |
# Load the pickle files
|