Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit fb4abbe

Browse files
authored
feat: impl session snapshot, add comments for llama-rs parameters (#33)
1 parent 70c7c34 commit fb4abbe

File tree

14 files changed

+373
-62
lines changed

14 files changed

+373
-62
lines changed

Cargo.lock

Lines changed: 60 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@llama-node/examples",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"description": "",
55
"main": "index.js",
66
"type": "module",
@@ -18,9 +18,9 @@
1818
"langchain": "^0.0.56"
1919
},
2020
"dependencies": {
21-
"@llama-node/core": "0.0.32",
22-
"@llama-node/llama-cpp": "0.0.32",
23-
"@llama-node/rwkv-cpp": "0.0.32",
24-
"llama-node": "0.0.32"
21+
"@llama-node/core": "0.0.33",
22+
"@llama-node/llama-cpp": "0.0.33",
23+
"@llama-node/rwkv-cpp": "0.0.33",
24+
"llama-node": "0.0.33"
2525
}
2626
}

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "llama-node",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"description": "Node.js Library for Large Language Model LLaMA/RWKV",
55
"keywords": [
66
"llama",
@@ -59,10 +59,10 @@
5959
"packageManager": "[email protected]",
6060
"homepage": "https://llama-node.vercel.app/",
6161
"devDependencies": {
62-
"@llama-node/cli": "0.0.32",
63-
"@llama-node/core": "0.0.32",
64-
"@llama-node/llama-cpp": "0.0.32",
65-
"@llama-node/rwkv-cpp": "0.0.32",
62+
"@llama-node/cli": "0.0.33",
63+
"@llama-node/core": "0.0.33",
64+
"@llama-node/llama-cpp": "0.0.33",
65+
"@llama-node/rwkv-cpp": "0.0.33",
6666
"@napi-rs/cli": "^2.15.2",
6767
"@tensorflow/tfjs-node": "^4.2.0",
6868
"@types/node": "^18.15.5",
@@ -80,17 +80,17 @@
8080
"vitest": "^0.30.1"
8181
},
8282
"dependencies": {
83-
"@llama-node/cli": "0.0.32"
83+
"@llama-node/cli": "0.0.33"
8484
},
8585
"optionalDependencies": {
86-
"@llama-node/core": "0.0.32",
87-
"@llama-node/llama-cpp": "0.0.32",
88-
"@llama-node/rwkv-cpp": "0.0.32"
86+
"@llama-node/core": "0.0.33",
87+
"@llama-node/llama-cpp": "0.0.33",
88+
"@llama-node/rwkv-cpp": "0.0.33"
8989
},
9090
"peerDependencies": {
91-
"@llama-node/cli": "0.0.32",
92-
"@llama-node/core": "0.0.32",
93-
"@llama-node/llama-cpp": "0.0.32",
94-
"@llama-node/rwkv-cpp": "0.0.32"
91+
"@llama-node/cli": "0.0.33",
92+
"@llama-node/core": "0.0.33",
93+
"@llama-node/llama-cpp": "0.0.33",
94+
"@llama-node/rwkv-cpp": "0.0.33"
9595
}
9696
}

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@llama-node/cli",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"description": "",
55
"main": "index.js",
66
"type": "commonjs",
@@ -12,7 +12,7 @@
1212
"test": "tsx src/index.ts"
1313
},
1414
"dependencies": {
15-
"@llama-node/core": "0.0.32",
15+
"@llama-node/core": "0.0.33",
1616
"yargs": "^17.7.1"
1717
},
1818
"author": "",

packages/core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ napi = { version = "2.12.4", default-features = false, features = ["napi6", "asy
1919
napi-derive = "2.12.3"
2020
tokio = { version = "1.26.0", features = ["full"] }
2121
futures = "0.3"
22+
zstd = {version = "0.12", default-features = false}
23+
anyhow = "1.0.70"
24+
bincode = "1.3.3"
2225

2326

2427
[build-dependencies]

packages/core/example/inference.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { InferenceResultType, LLama } from "../index";
22
import path from "path";
33

44
const model = path.resolve(process.cwd(), "../../ggml-alpaca-7b-q4.bin");
5+
// const persistSession = path.resolve(process.cwd(), "./tmp/session.bin");
56

67
LLama.enableLogger();
78

@@ -31,6 +32,7 @@ llama.inference(
3132
repeatLastN: 64,
3233
seed: 0,
3334
feedPrompt: true,
35+
// persistSession,
3436
},
3537
(response) => {
3638
switch (response.type) {

0 commit comments

Comments
 (0)