MCPcopy Create free account
hub / github.com/THUDM/GLM / s3_get

Function s3_get

data_utils/file_utils.py:156–160  ·  view source on GitHub ↗

Pull a file directly from S3.

(url, temp_file)

Source from the content-addressed store, hash-verified

154
155@s3_request
156def s3_get(url, temp_file):
157 """Pull a file directly from S3."""
158 s3_resource = boto3.resource("s3")
159 bucket_name, s3_path = split_s3_path(url)
160 s3_resource.Bucket(bucket_name).download_fileobj(s3_path, temp_file)
161
162
163def http_get(url, temp_file):

Callers 1

get_from_cacheFunction · 0.85

Calls 1

split_s3_pathFunction · 0.85

Tested by

no test coverage detected