Skip to content
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

[Request] Allow for using OpenAI or other 3P to generate embeddings #593

Open
rvjosh opened this issue Dec 21, 2023 · 2 comments
Open

[Request] Allow for using OpenAI or other 3P to generate embeddings #593

rvjosh opened this issue Dec 21, 2023 · 2 comments

Comments

@rvjosh
Copy link

rvjosh commented Dec 21, 2023

I know this is likely the opposite of the requests you all usually get on here, but I have an Obsidian vault that is ~2000 documents and it is taking a long time (40 min and counting to do the first 900 documents) to embed my vault running a Docker container locally. I see that you use the "thenlper/gte-small" model by default to do the embeddings - would you consider allowing for using 3P models to do the embeddings that are called via API such as OpenAI's text-ada-002? Thank you for the great app!

@debanjum
Copy link
Collaborator

debanjum commented Jan 1, 2024

Are you on a machine with GPU? It's pretty fast when running on GPU enabled machines.

  • You can choose any sentence transformer compatible model for indexing
  • Using the standard sentence transformer models is generally faster for search as they're smaller in size and of decently good quality. Ada's larger embedding size slows down the speed of search
  • For large datasets, the first run will be slower but subsequent runs should be fine as only the updated embeddings are regenerated.

We haven't seen a strong enough need to support generating embedding via API yet. But open to considering this if there's a strong enough reason to do so in the future

@sabaimran
Copy link
Collaborator

@rvjosh I've just worked on adding in support to use 3P embeddings API hosted on huggingface (if you configure it to be run as a Sentence Embedding task). See PRs #609 , #616 . This should be fairly extensible with using the OpenAI service directly (eventually), but it would also work for any model via HuggingFace now. Will be available in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants