Download convert.py from unkmaster/EAGLE3-LLaMA3.1-Instruct-8B: direct link, hf CLI and curl.
- Browser
- Download file 452 Bytes
-
https://huggingface.co/unkmaster/EAGLE3-LLaMA3.1-Instruct-8B/resolve/main/convert.py
- Command line
-
hf download hf://unkmaster/EAGLE3-LLaMA3.1-Instruct-8B/convert.py
-
curl -L -o convert.py https://huggingface.co/unkmaster/EAGLE3-LLaMA3.1-Instruct-8B/resolve/main/convert.py
452 Bytes
| from safetensors.torch import save_file | |
| import torch | |
| # Load your PyTorch .bin file | |
| # Replace 'path/to/your/pytorch_model.bin' with the actual path | |
| state_dict = torch.load('pytorch_model.bin') | |
| # Define the output path for the .safetensors file | |
| # Replace 'path/to/your/model.safetensors' with your desired output path | |
| output_path = 'model.safetensors' | |
| # Save the state_dict in safetensors format | |
| save_file(state_dict, output_path) | |