Repository navigation
Conversation
The original function was broken on Windows for some unicode paths Paths without a trailing separator now create the last directory too, matching the function name. All current callers already include a trailing separator, so this change does not affect them. Signed-off-by: Adrien Gallouët <angt@huggingface.co>
| return true; | ||
| #endif // _WIN32 | ||
| std::error_code ec; | ||
| std::filesystem::create_directories(std::filesystem::u8path(path), ec); |
There was a problem hiding this comment.
nice, I didn't know about u8path, maybe we should do another pass to use u8path everywhere?
There was a problem hiding this comment.
Yes, I have many iterations to come haha :)
There was a problem hiding this comment.
The only downside is that it will be deprecated in C++20, but it’s easy to replace with a custom helper (and easy to detect)
ServeurpersoCom
left a comment
There was a problem hiding this comment.
LGTM, tested on Windows MSVC, nested creation with a trailing separator works; side note, a non-ASCII LLAMA_CACHE or LOCALAPPDATA still lands in a U+FFFD directory because common_get_env uses std::getenv, which returns ANSI on Windows, but that predates this PR.
|
Here is a possible follow-up for it, reading the environment through _wgetenv and converting to UTF-8 so the cache and config directories keep their non-ASCII characters on Windows: |
|
In fact, I initially started working on the |
Merge upstream commits: - llama: add llama_prec_policy + model-driven W4A4 path (ggml-org#24364) - llama: fix tensor split for fused qkv with uneven K/V head sizes (ggml-org#29294) - metal: split fa kernels into per-dtype libraries (ggml-org#29329) - metal: FWHT kernels for block widths above 512 (ggml-org#29095) - CUDA: fuse RMS_NORM + SCALE into one kernel (ggml-org#29393) - common: extract shared unicode path/string helpers (ggml-org#29415) - common,rpc: simplify fs_create_directory_with_parents() (ggml-org#29432) - rpc: include nb in the get_alloc_size cache key (ggml-org#29283) - [SYCL] support sparse FA (ggml-org#28796) - musa: fix PH1 operator failures and build issues (ggml-org#29193) - HIP: bump HIP_VERSION required for fp8 (ggml-org#29231) - opencl: add q5_k bin kernel (ggml-org#29401) - hexagon: add q5_k quant type support (ggml-org#29123) - hexagon: use DMA for contiguous dim1 CONCAT (ggml-org#29404) - mtmd: fix mel preprocessor in LFM2 audio (ggml-org#29403) - vulkan: fix legacy GLSLC without cooperativeMatrix (ggml-org#29409) - gguf-py: ByteLevel processing defaults bos/eos to False (ggml-org#29422) - gguf-py: TemplateProcessing has final word on add_special_token (ggml-org#29417) Assisted-by: Pi
) The original function was broken on Windows for some unicode paths Paths without a trailing separator now create the last directory too, matching the function name. All current callers already include a trailing separator, so this change does not affect them. Signed-off-by: Adrien Gallouët <angt@huggingface.co> (cherry picked from commit 4b1a27f)

Overview
The original function was broken on Windows for some unicode paths
Additional information
Paths without a trailing separator now create the last directory too, matching the function name.
All current callers already include a trailing separator, so this change does not affect them.
Requirements