-
Notifications
You must be signed in to change notification settings - Fork 44.6k
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
Add ability to use local embeddings model #1320
Conversation
Sounds useful. |
Thanks for the feedback. I agree that it's not a good approach and only did so as a temporary solution which I overlooked. To improve it, I created a variable that holds a dictionary with the embeder name as the key and the dimension as the value. This variable is dynamically assigned to the dimension based on the embeder used at runtime. Then, this variable is imported and used in memory backends. |
Changed all occurrences of "embeder" to "embedder".
- Fixed "embeder" typo to "embedder" - Added newline at the end of test unit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a crazy EOF error now too. I'm approving.
get_embedding function uses config
Just noticed and patched some issues with the test unit, as well as resolved issues with the new |
@Tymec There are conflicts now |
@Tymec There are conflicts now |
Run flake8 autogpt/ tests/ --select E303,W293,W291,W292,E305,E231,E302 |
Add ability to use local embeddings model
Background
This change adds the ability to use a local embeddings model (sBERT) using the SentenceTransformers library. This change gives the users an alternative to OpenAI's ada embeder which costs money.
Changes
get_ada_embedding
function toget_embedding
get_embedding
function now uses either ada or sBERT embeder based onmemory_embeder
config optionmemory_embeder
that defaults to ada, which can also be configured by setting the MEMORY_EMBEDER environment variable.sentence_transformers
as a requirementDocumentation
Test Plan
PR Quality Checklist