sparseml icon indicating copy to clipboard operation
sparseml copied to clipboard

Add AutoModel support for SparseAutoModel

Open mgoin opened this issue 1 year ago • 0 comments

Add support for loading Transformers models without specifying task attributes. This is especially useful for exporting models for embedding extraction. This current accessed by "model" or "base" task - I'm very much open to a better name here

example:

> huggingface-cli download sentence-transformers/all-MiniLM-L6-v2 --local-dir all-MiniLM-L6-v2
> sparseml.export --task model all-MiniLM-L6-v2
> ll all-MiniLM-L6-v2/deployment 
total 88M
-rw-rw-r-- 1 mgoin mgoin  612 Jan 24 19:50 config.json
-rw-rw-r-- 1 mgoin mgoin  87M Jan 24 19:50 model.onnx
-rw-rw-r-- 1 mgoin mgoin  350 Jan 24 19:50 tokenizer_config.json
-rw-rw-r-- 1 mgoin mgoin 456K Jan 24 19:50 tokenizer.json

mgoin avatar Jan 24 '24 20:01 mgoin