Fix module usage#2
Merged
Merged
Conversation
…esent in the latest revision of sugarme repo but it has more changes
Owner
|
Thanks for the fix @lein3000zzz ! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is mostly about addressing the issue #1.
Removed Git LFS for the model file
The Go module system does not fetch Git LFS objects and instead downloads only pointer files. As a result, the model worked only when cloning the repository directly, which is not the intended usage.
Since GitHub supports files up to 100 MB without LFS, the model is now stored directly in the repository, avoiding Git LFS entirely and fixing module-based usage.
Added NewModelBare() constructor
Introduces a constructor that does not implicitly initialize the ONNX Runtime environment, preventing unexpected panics in larger projects where the environment lifecycle is managed explicitly.
Updated dependencies
Updated dependencies, in particular the tokenizer, which now includes fixes that were previously only available in the custom fork used earlier.
Removed ort.DestroyEnvironment from model.Close()
Avoids implicit management of the ONNX Runtime environment and leaves lifecycle control to the caller.