huggingface / swift-transformers

Swift Package to implement a transformers-like API in Swift
Apache License 2.0
536 stars 46 forks source link

Read model weights #91

Open shavit opened 2 months ago

shavit commented 2 months ago

Read model weights from safetensors.

Related https://github.com/huggingface/swift-transformers/pull/86

shavit commented 2 months ago

Weights are now accessible independently of configurations for flexibility and without MLModel or conversion.

pcuenca commented 2 months ago

That's very cool @shavit! May I ask what use case you have in mind for this?

Edit: Oh, I see it's for your embeddings work. Any highlights on the general architecture you're considering?

shavit commented 2 months ago

Yes

The plan is to use models directly from local files or the hub, and maybe support more types like mlx/numpy.