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

Improve "embeddings" example #525

Merged
merged 5 commits into from
Feb 20, 2024

Conversation

swharden
Copy link
Contributor

@swharden swharden commented Feb 20, 2024

Previously the embeddings example throws an exception because EmbeddingMode was not set to true.

This PR fixes that and adds extra documentation to the embeddings example.

image

prevents an exception from being thrown when GetEmbeddings() is called
If EmbeddingMode is not set to true, GetEmbeddings() throws an exception
The previous commit 6c9ff31 was inaccurate
displays the example description after the model is loaded to ensure the text is on the screen at the time the prompt is first requested
@martindevans
Copy link
Member

Thanks again. Our docs and examples have really fallen behind recently, so these fixes are really valuable!

@martindevans martindevans merged commit efa49cc into SciSharp:master Feb 20, 2024
3 checks passed
@swharden swharden deleted the example-embedding branch February 20, 2024 15:48
@xuzeyu91
Copy link

What kind of model should be used for embedding? When I use nomic-embed-text-v1.5.f32.gguf, it will report protected memory, while when I use tinyllama-1.1b-chat.gguf, it can run normally. However, I feel that the returned float array is not correct. When I use the same text for vector matching, the similarity is only 0.42

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.

3 participants