Spaces:
Runtime error
Runtime error
Download utils/model_loader.py from arifa-batool/spam-filter-app: direct link, hf CLI and curl.
- Browser
- Download file 372 Bytes
-
https://huggingface.co/spaces/arifa-batool/spam-filter-app/resolve/main/utils/model_loader.py
- Command line
-
hf download hf://spaces/arifa-batool/spam-filter-app/utils/model_loader.py
-
curl -L -o model_loader.py https://huggingface.co/spaces/arifa-batool/spam-filter-app/resolve/main/utils/model_loader.py
372 Bytes
| import pickle | |
| def load_models(vectorizer_path="saved_models/vectorizer_TF-IDF.pkl", | |
| model_path="saved_models/SVM_TF-IDF.pkl"): | |
| """Load vectorizer and SVM model.""" | |
| with open(vectorizer_path, "rb") as f: | |
| vectorizer = pickle.load(f) | |
| with open(model_path, "rb") as f: | |
| model = pickle.load(f) | |
| return vectorizer, model | |