Skip to content

Commit

Permalink
fix when checkpoints are not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
luv-bansal committed Oct 9, 2024
1 parent 75a2b20 commit 621d7ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clarifai/runners/models/model_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def _load_config(config_file: str):
return config

def _validate_config_checkpoints(self):
if not self.config.get("checkpoints"):
logger.info("No checkpoints specified in the config file")
return None, None

assert "type" in self.config.get("checkpoints"), "No loader type specified in the config file"
loader_type = self.config.get("checkpoints").get("type")
Expand Down Expand Up @@ -201,6 +198,10 @@ def tar_file(self):
return f"{self.folder}.tar.gz"

def download_checkpoints(self):
if not self.config.get("checkpoints"):
logger.info("No checkpoints specified in the config file")
return True

repo_id, hf_token = self._validate_config_checkpoints()

loader = HuggingFaceLoader(repo_id=repo_id, token=hf_token)
Expand Down

0 comments on commit 621d7ea

Please sign in to comment.