-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
backend: support non-ASCII characters in path to llmodel libs on Windows #2388
Merged
Conversation
This file contains 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
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Using the native path representation allows us to manipulate paths and call LoadLibraryEx without mangling non-ASCII characters. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
manyoso
reviewed
May 31, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
manyoso
reviewed
May 31, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
manyoso
approved these changes
May 31, 2024
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
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.
There were two problems preventing GPT4All from locating the implementation libraries on Windows if the path contained non-ASCII characters:
While I was touching this code I refactored Dlhandle into a proper .cpp/.h split, which greatly improves readability IMO.
Related to #2111 (that issue was about the model path, not the implementation lib path)
Testing
I created a venv called
zz😊
(for tab completion's sake) using pure Python (since using Unicode at the Windows command line is not trivial):Then I activated it (the glob allows this to work even when the console doesn't fully support Unicode):
$ . .\zz??\Scripts\Activate.ps1
Then install the Python binding in that venv. With the current release, this fails:
But with this PR (don't install it editable/
-e
or the resolved path won't be in the venv), it works:I didn't test with the UI since the installer doesn't let you select a path containing non-ASCII characters, but if the user moves GPT4All to a non-ASCII path after-the-fact, this should at least give it a chance of working.