How can I download the model architecture of my AutoTrain mode to be able to use outside of the transformers library?
Hi,I trained several models using AutoTrain, in the resultant repo I see apytorch_model.binfile which I’m guessing is the weights? If so, where can I download the main model architecture file? I assume it will have a.ptextension.Currently I can load and use the model fine using the transformers library, but I want to be able to use it outside transformers, by loading it using pytorch’smodel.load()function…Additional info:In the config.json for thearchitecturesvalue I see “SwinForImageClassification”my specific repo is a privae one (tkpop777/autotrain-meowbuddy-61144134682)
2023-05-24T06:38:48Z
The weights are contained in the pytorch_model.bin file, so you can just doimport torch

state_dict = torch.load("path_to_pytorch_model.bin", map_location="cpu")and then for your custom model:model = CustomModel.load_state_dict(state_dict)Note that .bin and .pt are just different extensions:What are the difference between .bin and .pt pytorch saved model types? - Stack Overflow