mirror of
https://github.com/amazon-science/chronos-forecasting
synced 2026-05-23 17:48:23 +00:00
Remove ALWAYS_DOWNLOAD from CF and S3 (#322)
*Issue #, if available:* *Description of changes:* Remove `ALWAYS_DOWNLOAD` so that Chronos-2 works in a fully offline env if model files are cached. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This commit is contained in:
parent
15ffe8835d
commit
3d08338f37
1 changed files with 2 additions and 3 deletions
|
|
@ -17,7 +17,6 @@ from botocore.exceptions import ClientError, NoCredentialsError
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
MODEL_FILENAMES = ["config.json", "model.safetensors", "LICENSE.txt"]
|
||||
ALWAYS_DOWNLOAD = {"config.json"}
|
||||
CLOUDFRONT_MAPPING = {"s3://autogluon/chronos-2": "https://d7057vjasule5.cloudfront.net"}
|
||||
CHUNK_SIZE = 1024 * 1024 # 1MB
|
||||
|
||||
|
|
@ -34,7 +33,7 @@ def download_model_files_from_cloudfront(
|
|||
dest = local_path / bucket / key
|
||||
url = f"{cloudfront_url}/{filename}"
|
||||
|
||||
if key not in ALWAYS_DOWNLOAD and not force_download and dest.exists():
|
||||
if not force_download and dest.exists():
|
||||
logger.debug(f"skipping (already exists): {key}")
|
||||
continue
|
||||
|
||||
|
|
@ -64,7 +63,7 @@ def download_model_files_from_s3(
|
|||
key = f"{prefix}/{filename}"
|
||||
dest = local_path / bucket / key
|
||||
|
||||
if key not in ALWAYS_DOWNLOAD and not force_download and dest.exists():
|
||||
if not force_download and dest.exists():
|
||||
logger.debug(f"skipping (already exists): {key}")
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue