Skip to content

Fix a bug in demo code and add a demo for custom embedding_function #28

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

conanak99
Copy link

@conanak99 conanak99 commented Jun 11, 2023

  • The result of this line indemo/demo.py returns a list of tuple(document, similarity), so the demo code will not work correctly. This is fixed in this PR..
results = db.query("Likes to sleep.", top_k=5)
  • The current demo requires an OPENAI_API_KEY. Added demo/demo_custom_embed.py that makes use of SentenceTransformers/ to generate embedding, which can be run locally.

@jdagdelen
Copy link
Owner

Can this be run locally on cpu only?

@jdagdelen
Copy link
Owner

I would like to avoid adding dependencies just for the purpose of demos.

@conanak99
Copy link
Author

conanak99 commented Jun 28, 2023

hi @jdagdelen , it can be run on CPU only, all-MiniLM-L6-v2 is a lightweight model.

I understand the concern about adding new dependencies. Fixed that, add a comment in the demo so people know which dependencies to install instead :D

One more thing to note is the embedding from local model is not as good as OpenAI, based on my test.

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

Successfully merging this pull request may close these issues.

2 participants