mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 11:26:34 +00:00
fix: open model files with UTF-8 paths on Windows (#2144)
This commit is contained in:
1 parent
8cd731e7b4
commit
8c442fb0ad
11 files changed
+35
-25
No files matched your search
@@ -10,6 +10,7 @@
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
|
||||
static IMatrixCollector imatrix_collector;
|
||||
|
||||
@@ -227,7 +228,7 @@ void IMatrixCollector::save_imatrix(std::string fname, int ncall) const {
|
||||
LOG_WARN("storing only %zu out of %zu entries\n", to_store.size(), stats_.size());
|
||||
}
|
||||
|
||||
std::ofstream out(fname, std::ios::binary);
|
||||
std::ofstream out(std::filesystem::u8path(fname), std::ios::binary);
|
||||
out.write((const char*)&n_entries, sizeof(n_entries));
|
||||
for (const auto& name : to_store) {
|
||||
const auto& stat = stats_.at(name);
|
||||
@@ -251,7 +252,7 @@ void IMatrixCollector::save_imatrix(std::string fname, int ncall) const {
|
||||
}
|
||||
|
||||
bool IMatrixCollector::load_imatrix(const char* fname) {
|
||||
std::ifstream in(fname, std::ios::binary);
|
||||
std::ifstream in(std::filesystem::u8path(fname), std::ios::binary);
|
||||
if (!in) {
|
||||
LOG_ERROR("failed to open %s\n", fname);
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user