Skip to content

Commit 3d8072e

Browse files
committed
For the M4
1 parent 1f737b4 commit 3d8072e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

__readme__.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
Offspring for hoivb612
22
https://github.com/hoivb612/llama.cpp
3+
4+
#include <sys/stat.h>
5+
#include <sys/types.h>
6+
#include <string>
7+
#include <hash>
8+
9+
static std::hash<std::string> hasher;
10+
static const char* dir = "./llama_cache";
11+
12+
// create the cache dir if it does not exist yet
13+
struct stat info;
14+
if (stat(dir, &info) != 0) {
15+
mkdir(dir, 0777);
16+
}
17+
18+
// default generated file name
19+
std::string pfx_path(dir);
20+
std::string full_file_path = pfx_path + "/" + std::to_string(hasher(pfx));

0 commit comments

Comments
 (0)