xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
11.06k stars 681 forks source link

v3: custom pipelines #747

Closed Th3G33k closed 4 months ago

Th3G33k commented 4 months ago

Add get_text_embeddings and get_similarities methods to ImageFeatureExtractionPipeline

xenova commented 4 months ago

Thanks! Are these methods present in the python version of the image feature extraction pipeline? If so, can you please link to the original documentation? If not, please note that we're trying to match the python API as closely as possible, and may make it difficult to merge the PR.

Th3G33k commented 4 months ago

I don't think there in an equivalent in Python transformers.

https://github.com/xenova/transformers.js/blob/880cd3ea657b3cd3b7a30fca5067838e312b9eba/src/models.js#L5816-L5821

However, I think it would be really handful to have those fonctions directly into the library transformers.js image feature extraction pipeline.

It's used in hugging face spaces and in examples model code

Th3G33k commented 4 months ago

To not differ from the Python library, I will add the custom pipeline separetely, with register_pipeline. #684