mirror of
https://github.com/ollama/ollama.git
synced 2026-07-23 09:10:53 -05:00
compat: use UTF-8-safe file open (#16999)
Use ggml_fopen for compat tensor reads so Windows paths with Unicode characters are converted through the same UTF-8-to-wide path as llama.cpp model loading. Fixes #16493
This commit is contained in:
2
llama/compat/llama-ollama-compat-util.cpp
vendored
2
llama/compat/llama-ollama-compat-util.cpp
vendored
@@ -275,7 +275,7 @@ bool take_load_op(const char * dest_name, LoadOp & out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool read_at(const char * path, size_t offset, void * dst, size_t size) {
|
bool read_at(const char * path, size_t offset, void * dst, size_t size) {
|
||||||
FILE * f = std::fopen(path, "rb");
|
FILE * f = ggml_fopen(path, "rb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
std::fprintf(stderr, "%s: open failed path=%s offset=%zu size=%zu errno=%d (%s)\n",
|
std::fprintf(stderr, "%s: open failed path=%s offset=%zu size=%zu errno=%d (%s)\n",
|
||||||
__func__, path, offset, size, errno, std::strerror(errno));
|
__func__, path, offset, size, errno, std::strerror(errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user