-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for instructur/instructor-xl models #125
Comments
Can you provide a minimal code using just huggingface transformers and sentence-transformers? The instructor models and the package are slightly outdated - I would consider accepting a PR if this is easy to maintain & does not come with extra dependencies. |
I don't use huggingface transformers nor sentence-transformers directly, but rather the "instructor" integration with Langchain. I can give specific examples of that if you wanted? At any rate, the source code clearly uses transformers and sentence-transformers libraries. Wheel is here, open with 7-zip, and look at "Instructor-xl" is better than any of the sentence-transformers and/or huggingface models IMHO, although I haven't tried the recent ones mixing Mistral, etc. with embedding models...I'm referring to the traditional "gtr" etc. Instructor does also have instructions on their github on how to quantize it...perhaps this is a viable alternative if we can't get it implemented in straight-transformers/sentence-transformers/flash-attention2 and all that stuff...Here's how they say to do it, BUT I'VE NEVER AFTER SPENDING HOURS figured out how to get it working!
Taken from: https://github.com/xlang-ai/instructor-embedding?tab=readme-ov-file#quantization If would actually pay someone if they could convert instructor (all three sizes) to ctranslate2...that's how much respect I have for it. With that being said, I love your repository and appreciate your working on hf-hub-translate before that...Here's where I'm contemplating using all ctranslate2 embedding models in my program: BBC-Esq/VectorDB-Plugin-for-LM-Studio#143 It's fun to include multiple models, all of which can be seen here: https://github.com/BBC-Esq/ChromaDB-Plugin-for-LM-Studio/blob/main/src/constants.py If I do move to Infinity in the near future...it'll be lopsided to have all other embedding models incredibly efficient with ctranslate2, basically, except instructor... |
I just tried to do this PR but don't know what I'm doing at all...please help. I noticed that you've done converters before. |
BTW, I think that sentence transformers just started supporting instructor models recently!!! https://www.sbert.net/docs/pretrained_models.html#instructor-models |
But "reportedly" they're only supported up to |
Facing this issue now. Is there any way to work around this if using the |
I finally resolved it myself but haven't had a chance to upload the script to any fork of any repo. |
Here's the modified script. Let me know if it works for you as I'd appreciate the shout out. ;-) name the script "instructor" and replace the "instructor.py" script in the package that's normally pip installed. REVISED INSTRUCTOR SCRIPT HERE
|
Awesome, thank you, will check this out. |
Can you please support the instructor models here?
https://github.com/xlang-ai/instructor-embedding
These are arguably the best models for their sizes.
The text was updated successfully, but these errors were encountered: