michaelfeil / infinity

Infinity is a high-throughput, low-latency REST API for serving vector embeddings, supporting a wide range of text-embedding models and frameworks.
https://michaelfeil.eu/infinity/
MIT License
971 stars 72 forks source link

Include `einops` in docker image #231

Closed chiragjn closed 1 month ago

chiragjn commented 1 month ago

Feature request

As the title states, add einops as dependency either for infinity_emb package or in the Dockerfile

Motivation

Few models rely on einops for their modeling code. It would be nice to be able to run these models directly without having to build custom docker image. example: https://huggingface.co/Snowflake/snowflake-arctic-embed-m-long/blob/08e7a4449e3f07709fb9387bc3172d393a6cc5e2/modeling_hf_nomic_bert.py#L18

I realise that models on HF Hub are free to use arbitrary dependencies but einops seems common enough to include for convenience

Your contribution

Happy to open a PR based on decision

michaelfeil commented 1 month ago

There are related threads. Honestly, I am annoyed by the einops package + the tendency to ship custom code.

https://github.com/michaelfeil/infinity/issues/185 https://github.com/michaelfeil/infinity/issues/197 https://github.com/michaelfeil/infinity/issues/123

https://huggingface.co/nomic-ai/nomic-embed-text-v1.5/discussions/16

michaelfeil commented 1 month ago

But if you open a new group with einops = "*" as optional package, that is part of the default group (installed via pip install infinity_emb[all] and infinity_emb[einops] that would be OKAY. @chiragjn Are you up for such a PR?