rasbt-LLMs-from-scratch/ch05/02_alternative_weight_loading
Sebastian Raschka 7bd263144e
Switch from urllib to requests to improve reliability (#867)
* Switch from urllib to requests to improve reliability

* Keep ruff linter-specific

* update

* update

* update
2025-10-07 15:22:59 -05:00
..
README.md Alt weight loading code via PyTorch (#585) 2025-03-27 20:10:23 -05:00
weight-loading-hf-safetensors.ipynb Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00
weight-loading-hf-transformers.ipynb Add PyPI package (#576) 2025-03-23 19:28:49 -05:00
weight-loading-pytorch.ipynb Switch from urllib to requests to improve reliability (#867) 2025-10-07 15:22:59 -05:00

Alternative Approaches to Loading Pretrained Weights

This folder contains alternative weight loading strategies in case the weights become unavailable from OpenAI.

  • weight-loading-pytorch.ipynb: (Recommended) contains code to load the weights from PyTorch state dicts that I created by converting the original TensorFlow weights

  • weight-loading-hf-transformers.ipynb: contains code to load the weights from the Hugging Face Model Hub via the transformers library

  • weight-loading-hf-safetensors.ipynb: contains code to load the weights from the Hugging Face Model Hub via the safetensors library directly (skipping the instantiation of a Hugging Face transformer model)