.pt PyTorch Model ->PreTrainedModel
Similar to (How can I share a pytorch saved model on huggingFace hub), I am attempting to convert/utilize a PyTorch model with the .pt extension with Huggingface.I have been reading through the docs on the ‘PreTrainedModel’ class, but have Not found a one-for-one solution. The model is a GPT based on this repository (GitHub - karpathy/nanoGPT: The simplest, fastest repository for training/finetuning medium-sized GPTs.).
2023-04-03T17:29:02Z
You can’t use model written in other libraries inside Transformers.
2023-04-03T17:45:54Z
Ah okay, thank you !
2024-05-01T10:47:08Z
But is there no way to convert at all?
2024-05-01T13:05:06Z
Technically you can convert models to the Transformers format, if the model exists in the Transformers library and all parameters can be converted.e.g. to convert llama from the original repository to the Transformers format =>transformers/src/transformers/models/llama/convert_llama_weights_to_hf.py at main · huggingface/transformers · GitHub. Each model folder in the Transformers library has this so-called conversion script to convert weights from the original format to the Transformers format.