-
Notifications
You must be signed in to change notification settings - Fork 10.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
Add Unicode model filename support for Windows #5927
Conversation
When using llama.cpp from the command line, for me this does not change anything, I am already able to open models with unicode characters in master. How are you testing this? The model file is also opened in |
This might be related to what code page is being used for the "ANSI" Win32 functions on your system. It might even be UTF-8. But generally, you do need to use the wide version of fopen to support Unicode on older versions of Windows. |
@slaren I was able to test this out on a different Windows machine today (running Windows 11) and I did not see the unicode problem in that case, as you observed. The machine I was testing on when I saw the behaviour was older, here is a dump of some of the system info where I can reproduce the issue:
For reference, I was testing by running the server example: You're correct that the logic in |
My locale is the same as yours, but I have no problem loading models with unicode characters. Here is an example:
The only difference that I can see is that I am using Windows 11 instead of server 2022. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of copy-pasting this code across several locations, let's use a function. Maybe we could put a static function in a utility header and use it everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can expose the function through the ggml
API:
FILE * ggml_fopen(const char * fname, const char * mode);
Unfortunately, we would have to include <stdio.h>
which is not great, but I guess it is the best option
Closing this for now as I was working through some build issues. I'll re-open when I have time to come back to it. |
This change adds unicode support for model file paths on Windows.
Example:
C:\Users\Željko\mistral-7b-instruct-v0.2.Q4_K_S.gguf
Before:
Now it should work.
Fixes #5802