load adapters from safetensor files (enhancement)
swoldemichael opened this issue · comments
I tried loading my adapter after converting the pickle files into safetensors.
AutoAdapterModel.from_pretrained loads with safetensors (GOOD)
For example: model = AutoAdapterModel.from_pretrained("roberta-base", use_safetensors=True)
However when loading the adapter to the model, it is always looking for the pickle (bin) versions. (NOT SUPPORTED)
Moving forward, I think support for safetensors should be provided.
Afterwards, I uploaded the pickle versions and it did work with those.
For example load_adapters should be enhanced with:
model.load_adapter("solwol/my-awesome-adapter", source="hf", set_active=True, use_safetensors=True)
I mentioned the use of use_safetensors in AutoAdapterModel.from_pretrained("roberta-base", use_safetensors=True).
But the flag is not required as models like roberta-base are converted into safetensors.
The issue with the load_adapter method is that it always looks for the pickle binaries to load the weights. When I put the pickle bins back, it downloaded all files including safetensors, but uses the pickle bins.
Moving forward the enhancement should work with no pickle files present but all binaries provided in safetensors. I hope this makes sense.