File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,16 @@ std::string pfx_file_path(std::string pfx) {
7979#else
8080
8181 static std::hash<std::string> hasher;
82- static std::__fs::filesystem::path dir = " ./llama_cache" ;
82+ static const char * dir = " ./llama_cache" ;
8383
8484 // create the cache dir if it does not exist yet
85- std::__fs::filesystem::create_directory (dir);
85+ struct stat info;
86+ if (stat (dir, &info) != 0 ) {
87+ mkdir (dir, 0777 );
88+ }
8689
8790 // default generated file name
88- std::string pfx_path (dir. c_str () );
91+ std::string pfx_path (dir);
8992 std::string full_file_path = pfx_path + " /" + std::to_string (hasher (pfx));
9093
9194#endif // _WIN32
@@ -325,7 +328,7 @@ int slm_inference(xbapp_params& xbparams) {
325328 }
326329
327330 int64_t t_start_generation = ggml_time_us ();
328- printf (" Prompt TTFT = %.2fms (size = %lld )\n " ,
331+ printf (" Prompt TTFT = %.2fms (size = %zu )\n " ,
329332 ((t_start_generation - t_start_decoding) / 1000 .0f ),
330333 embd.size ());
331334
Original file line number Diff line number Diff line change 1818#include < filesystem>
1919
2020#ifdef _WIN32
21+
2122#if !defined WIN32_LEAN_AND_MEAN
2223 #define WIN32_LEAN_AND_MEAN
2324#endif // WIN32_LEAN_AND_MEAN
3031#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
3132#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
3233#endif
34+
35+ #else
36+
37+ #include < sys/stat.h>
38+ #include < sys/types.h>
39+
3340#endif // WIN32
3441
3542struct xbapp_params {
You can’t perform that action at this time.
0 commit comments