Download model.py from Ahmedtem/models: direct link, hf CLI and curl.
- Browser
- Download file 304 Bytes
-
https://huggingface.co/spaces/Ahmedtem/models/resolve/main/model.py
- Command line
-
hf download hf://spaces/Ahmedtem/models/model.py
-
curl -L -o model.py https://huggingface.co/spaces/Ahmedtem/models/resolve/main/model.py
304 Bytes
| import torch | |
| # ุชุญู ูู ุงูู ูุฏูู | |
| model = YourModelClass() | |
| model.load_state_dict(torch.load("full_model.pth")) | |
| model.eval() | |
| # ุญูุธู ุจุตูุบุฉ safetensors (ุงูุฃูุถู ูู HF) | |
| from safetensors.torch import save_file | |
| state_dict = model.state_dict() | |
| save_file(state_dict, "model.safetensors") |