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

Commit

Permalink
feat: impl session snapshot, add comments for llama-rs parameters (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlhr202 authored Apr 30, 2023
1 parent 70c7c34 commit fb4abbe
Show file tree
Hide file tree
Showing 14 changed files with 373 additions and 62 deletions.
66 changes: 60 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llama-node/examples",
"version": "0.0.32",
"version": "0.0.33",
"description": "",
"main": "index.js",
"type": "module",
Expand All @@ -18,9 +18,9 @@
"langchain": "^0.0.56"
},
"dependencies": {
"@llama-node/core": "0.0.32",
"@llama-node/llama-cpp": "0.0.32",
"@llama-node/rwkv-cpp": "0.0.32",
"llama-node": "0.0.32"
"@llama-node/core": "0.0.33",
"@llama-node/llama-cpp": "0.0.33",
"@llama-node/rwkv-cpp": "0.0.33",
"llama-node": "0.0.33"
}
}
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llama-node",
"version": "0.0.32",
"version": "0.0.33",
"description": "Node.js Library for Large Language Model LLaMA/RWKV",
"keywords": [
"llama",
Expand Down Expand Up @@ -59,10 +59,10 @@
"packageManager": "[email protected]",
"homepage": "https://llama-node.vercel.app/",
"devDependencies": {
"@llama-node/cli": "0.0.32",
"@llama-node/core": "0.0.32",
"@llama-node/llama-cpp": "0.0.32",
"@llama-node/rwkv-cpp": "0.0.32",
"@llama-node/cli": "0.0.33",
"@llama-node/core": "0.0.33",
"@llama-node/llama-cpp": "0.0.33",
"@llama-node/rwkv-cpp": "0.0.33",
"@napi-rs/cli": "^2.15.2",
"@tensorflow/tfjs-node": "^4.2.0",
"@types/node": "^18.15.5",
Expand All @@ -80,17 +80,17 @@
"vitest": "^0.30.1"
},
"dependencies": {
"@llama-node/cli": "0.0.32"
"@llama-node/cli": "0.0.33"
},
"optionalDependencies": {
"@llama-node/core": "0.0.32",
"@llama-node/llama-cpp": "0.0.32",
"@llama-node/rwkv-cpp": "0.0.32"
"@llama-node/core": "0.0.33",
"@llama-node/llama-cpp": "0.0.33",
"@llama-node/rwkv-cpp": "0.0.33"
},
"peerDependencies": {
"@llama-node/cli": "0.0.32",
"@llama-node/core": "0.0.32",
"@llama-node/llama-cpp": "0.0.32",
"@llama-node/rwkv-cpp": "0.0.32"
"@llama-node/cli": "0.0.33",
"@llama-node/core": "0.0.33",
"@llama-node/llama-cpp": "0.0.33",
"@llama-node/rwkv-cpp": "0.0.33"
}
}
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llama-node/cli",
"version": "0.0.32",
"version": "0.0.33",
"description": "",
"main": "index.js",
"type": "commonjs",
Expand All @@ -12,7 +12,7 @@
"test": "tsx src/index.ts"
},
"dependencies": {
"@llama-node/core": "0.0.32",
"@llama-node/core": "0.0.33",
"yargs": "^17.7.1"
},
"author": "",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ napi = { version = "2.12.4", default-features = false, features = ["napi6", "asy
napi-derive = "2.12.3"
tokio = { version = "1.26.0", features = ["full"] }
futures = "0.3"
zstd = {version = "0.12", default-features = false}
anyhow = "1.0.70"
bincode = "1.3.3"


[build-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions packages/core/example/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { InferenceResultType, LLama } from "../index";
import path from "path";

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

LLama.enableLogger();

Expand Down Expand Up @@ -31,6 +32,7 @@ llama.inference(
repeatLastN: 64,
seed: 0,
feedPrompt: true,
// persistSession,
},
(response) => {
switch (response.type) {
Expand Down
Loading

0 comments on commit fb4abbe

Please sign in to comment.