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

KernelMemory bug fix #726

Merged
merged 2 commits into from
May 12, 2024
Merged

Conversation

zsogitbe
Copy link
Contributor

While using WithLLamaSharpDefaults it was not possible to dispose GPU memory because the embedding was not defined well. This PR fixes that issue and also fixes some small problems with not setting all important model parameters.

While using WithLLamaSharpDefaults it was not possible to dispose GPU memory because the embedding was not defined well. This PR fixes that issue and also fixes some small problems with not setting all important model parameters.
@AsakusaRinne
Copy link
Collaborator

Hi, may I ask why this change will fix GPU memory disposing problem?

@zsogitbe
Copy link
Contributor Author

zsogitbe commented May 10, 2024

Hi, may I ask why this change will fix GPU memory disposing problem?

Because in WithLLamaSharpDefaults the embedding generator was created but without an owner, so it does not get disposed... When using the LLamaSharpTextEmbeddingGenerator() constructor instead of the LLamaEmbedder() constructor the LLamaSharpTextEmbeddingGenerator will have full ownership and the embedder will be disposed.

@martindevans
Copy link
Member

martindevans commented May 10, 2024

Is config allowed to be null when passed in? It's not marked with nullable annotations (implying it's not) but it is using null coalescing to fall back to defaults (implying it is).

@martindevans martindevans merged commit e2a770e into SciSharp:master May 12, 2024
6 checks passed
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