Download claudson/save_model.py from joebruce1313/claudeson: direct link, hf CLI and curl.
- Browser
- Download file 467 Bytes
-
https://huggingface.co/joebruce1313/claudeson/resolve/main/claudson/save_model.py
- Command line
-
hf download hf://joebruce1313/claudeson/claudson/save_model.py
-
curl -L -o save_model.py https://huggingface.co/joebruce1313/claudeson/resolve/main/claudson/save_model.py
467 Bytes
| import torch | |
| # ... (import your model definition and ModelArgs from model.py and model_args.py) | |
| def main(): | |
| args = ModelArgs() | |
| model = CombinedMultiModalTransformer(args) | |
| # ... (optional: load pre-trained weights if available) | |
| # Save the entire model | |
| torch.save(model, 'my_model.pth') | |
| # Alternatively, save the model's state dictionary | |
| # torch.save(model.state_dict(), 'my_model_state_dict.pth') | |
| if __name__ == "__main__": | |
| main() |