Enable model snapshot downloads to be saved in a specified local directory.
This commit is contained in:
committed by
andre_ramos
parent
e3d45d6568
commit
c1e2094a10
@@ -130,6 +130,7 @@ class TimesFmCheckpoint:
|
|||||||
huggingface_repo_id: str | None = None
|
huggingface_repo_id: str | None = None
|
||||||
type: Any = None
|
type: Any = None
|
||||||
step: int | None = None
|
step: int | None = None
|
||||||
|
local_dir: str | None = None
|
||||||
|
|
||||||
|
|
||||||
class TimesFmBase:
|
class TimesFmBase:
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ class TimesFmTorch(timesfm_base.TimesFmBase):
|
|||||||
checkpoint_path = checkpoint.path
|
checkpoint_path = checkpoint.path
|
||||||
repo_id = checkpoint.huggingface_repo_id
|
repo_id = checkpoint.huggingface_repo_id
|
||||||
if checkpoint_path is None:
|
if checkpoint_path is None:
|
||||||
checkpoint_path = path.join(snapshot_download(repo_id),
|
checkpoint_path = path.join(
|
||||||
|
snapshot_download(repo_id, local_dir=checkpoint.local_dir),
|
||||||
"torch_model.ckpt")
|
"torch_model.ckpt")
|
||||||
self._model = ppd.PatchedTimeSeriesDecoder(self._model_config)
|
self._model = ppd.PatchedTimeSeriesDecoder(self._model_config)
|
||||||
loaded_checkpoint = torch.load(checkpoint_path, weights_only=True)
|
loaded_checkpoint = torch.load(checkpoint_path, weights_only=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user