server : drop u8path() and use generic_string() (#31682)

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
Adrien Gallouët authored and GitHub committed 2026-11-05 08:37:13 +01:00
1 parent 7e42b95f23
commit 5a081c0a70
4 files changed
+24 -36

No files matched your search

+4 -4
View File
@@ -2828,7 +2828,7 @@ private:
if (slot.prompt.checkpoints.empty()) {
return true;
}
std::ofstream ofs(std::filesystem::u8path(filepath), std::ios::binary | std::ios::app);
std::ofstream ofs(filepath, std::ios::binary | std::ios::app);
if (!ofs) {
SLT_WRN(slot, "failed to append context checkpoints to '%s'\n", filepath.c_str());
return false;
@@ -2859,7 +2859,7 @@ private:
// returns the number of bytes consumed, 0 if there is no usable appendix
size_t load_slot_checkpoints(const std::string & filepath, size_t offset, server_slot & slot) const {
std::ifstream ifs(std::filesystem::u8path(filepath), std::ios::binary | std::ios::ate);
std::ifstream ifs(filepath, std::ios::binary | std::ios::ate);
const size_t file_size = ifs ? (size_t) ifs.tellg() : 0;
if (!ifs || file_size < offset || !ifs.seekg(offset)) {
return 0;
@@ -2934,7 +2934,7 @@ private:
if (data_dft.empty() && data_spec.empty()) {
return true;
}
std::ofstream ofs(std::filesystem::u8path(filepath), std::ios::binary | std::ios::app);
std::ofstream ofs(filepath, std::ios::binary | std::ios::app);
if (!ofs) {
SLT_WRN(slot, "failed to append the draft state to '%s'\n", filepath.c_str());
return false;
@@ -2960,7 +2960,7 @@ private:
if (ctx_dft != nullptr) {
llama_memory_seq_rm(llama_get_memory(ctx_dft), slot.id, -1, -1);
}
std::ifstream ifs(std::filesystem::u8path(filepath), std::ios::binary | std::ios::ate);
std::ifstream ifs(filepath, std::ios::binary | std::ios::ate);
const size_t file_size = ifs ? (size_t) ifs.tellg() : 0;
if (!ifs || file_size < offset || !ifs.seekg(offset)) {
return 0;