Spaces:
Sleeping
Sleeping
Download python_backend/src/Predictors/components/model_downloader.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/Predictors/components/model_downloader.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/src/Predictors/components/model_downloader.py
-
curl -L -o model_downloader.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/Predictors/components/model_downloader.py
673 Bytes
| import os | |
| import mlflow | |
| import torch | |
| from src.Predictors.entity.config_entity import JobSimilarityModelConfig | |
| import logging | |
| from utils.asyncHandler import asyncHandler | |
| class ModelDownloader: | |
| def __init__(self, config: JobSimilarityModelConfig): | |
| self.config = config | |
| async def download_model(self): | |
| logging.info("Downloading model") | |
| mlflow.set_tracking_uri(self.config.mlflow_tracking_uri) | |
| path=mlflow.artifacts.download_artifacts(artifact_uri=self.config.model_uri,dst_path=self.config.local_model_path) | |
| logging.info("Downloaded Model Uri",path) | |
| logging.info("Model Downloaded") | |