mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
fixed unicode paths
This commit is contained in:
parent
75ec0ba279
commit
f841b29c41
4 changed files with 46 additions and 7 deletions
|
@ -19,6 +19,7 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
|
||||
#include "ggml-alloc.h"
|
||||
#include "ggml-backend.h"
|
||||
|
@ -218,7 +219,12 @@ __STATIC_INLINE__ void print_ggml_tensor(struct ggml_tensor* tensor, bool shape_
|
|||
}
|
||||
|
||||
__STATIC_INLINE__ ggml_tensor* load_tensor_from_file(ggml_context* ctx, const std::string& file_path) {
|
||||
std::ifstream file(file_path, std::ios::binary);
|
||||
#ifdef _WIN32
|
||||
std::filesystem::path fpath = std::filesystem::u8path(file_path);
|
||||
#else
|
||||
std::filesystem::path fpath = std::filesystem::path(file_path);
|
||||
#endif
|
||||
std::ifstream file(fpath, std::ios::binary);
|
||||
if (!file.is_open()) {
|
||||
LOG_ERROR("failed to open '%s'", file_path.c_str());
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue