Skip to content

Commit c23d34c

Browse files
authored
Add FutureWarning for CloudFront (#357)
*Issue #, if available:* *Description of changes:* By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent c5aa5f4 commit c23d34c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/chronos/boto_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import os
88
import re
9+
import warnings
910
from pathlib import Path
1011

1112
import boto3
@@ -110,6 +111,12 @@ def cache_model_from_s3(
110111

111112
# Use CloudFront CDN for faster, cached downloads if available
112113
if cloudfront_url:
114+
warnings.warn(
115+
f"Loading {s3_uri} from CloudFront is deprecated and will be removed in a future version. "
116+
f'Please specify a HuggingFace model_id instead. For example: Chronos2Pipeline.from_pretrained("amazon/chronos-2")',
117+
category=FutureWarning,
118+
stacklevel=3,
119+
)
113120
try:
114121
download_model_files_from_cloudfront(
115122
cloudfront_url=cloudfront_url,

0 commit comments

Comments
 (0)