[Misc] Fix issues reported by torchfix (#4837)

This commit is contained in:
Brayden Zhong
2025-03-27 23:10:32 -04:00
committed by GitHub
parent b149b39353
commit e84f4ba0ab
3 changed files with 5 additions and 5 deletions

View File

@@ -586,5 +586,5 @@ def load_token_map(token_map_path: str) -> List[int]:
ignore_patterns=["*.bin", "*.safetensors"],
)
token_map_path = os.path.join(cache_dir, os.path.basename(token_map_path))
hot_token_id = torch.load(token_map_path)
hot_token_id = torch.load(token_map_path, weights_only=True)
return torch.tensor(hot_token_id, dtype=torch.int32)