MCPcopy
hub / github.com/huggingface/transformers / prepare_batch

Function prepare_batch

tests/models/patchtst/test_modeling_patchtst.py:304–308  ·  view source on GitHub ↗
(repo_id="hf-internal-testing/etth1-hourly-batch", file="train-batch.pt")

Source from the content-addressed store, hash-verified

302
303
304def prepare_batch(repo_id="hf-internal-testing/etth1-hourly-batch", file="train-batch.pt"):
305 file = hf_hub_download(repo_id=repo_id, filename=file, repo_type="dataset")
306 check_torch_load_is_safe()
307 batch = torch.load(file, map_location=torch_device, weights_only=True)
308 return batch
309
310
311# Note: Pretrained model is not yet downloadable.

Callers 4

test_pretrain_headMethod · 0.70
test_prediction_headMethod · 0.70

Calls 1

check_torch_load_is_safeFunction · 0.90

Tested by

no test coverage detected