Skip to content

Commit 826334b

Browse files
authored
feat(model downloader): use HF_TOKEN when needed (#276)
* feat(model downloader): use `HF_TOKEN` when needed * fix: update model recommendations
1 parent e3e0994 commit 826334b

File tree

7 files changed

+247
-51
lines changed

7 files changed

+247
-51
lines changed

llama/addon/addon.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Napi::Value addonGetConsts(const Napi::CallbackInfo& info) {
5757
consts.Set("ggmlTypeF16Size", Napi::Number::New(info.Env(), ggml_type_size(GGML_TYPE_F16)));
5858
consts.Set("ggmlTypeF32Size", Napi::Number::New(info.Env(), ggml_type_size(GGML_TYPE_F32)));
5959
consts.Set("ggmlTensorOverhead", Napi::Number::New(info.Env(), ggml_tensor_overhead()));
60-
consts.Set("llamaMaxRngState", Napi::Number::New(info.Env(), LLAMA_MAX_RNG_STATE));
6160
consts.Set("llamaPosSize", Napi::Number::New(info.Env(), sizeof(llama_pos)));
6261
consts.Set("llamaSeqIdSize", Napi::Number::New(info.Env(), sizeof(llama_seq_id)));
6362

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"filenamify": "^6.0.0",
166166
"fs-extra": "^11.2.0",
167167
"ignore": "^5.3.1",
168-
"ipull": "^3.3.0",
168+
"ipull": "^3.6.0",
169169
"is-unicode-supported": "^2.0.0",
170170
"lifecycle-utils": "^1.4.1",
171171
"log-symbols": "^6.0.0",
@@ -193,7 +193,7 @@
193193
}
194194
},
195195
"optionalDependencies": {
196-
"@node-llama-cpp/win-x64-cuda": "0.1.0",
197-
"@node-llama-cpp/linux-x64-cuda": "0.1.0"
196+
"@node-llama-cpp/linux-x64-cuda": "0.1.0",
197+
"@node-llama-cpp/win-x64-cuda": "0.1.0"
198198
}
199199
}

src/cli/recommendedModels.ts

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,21 @@ export const recommendedModels: ModelRecommendation[] = [{
88

99
fileOptions: [{
1010
huggingFace: {
11-
model: "bartowski/Meta-Llama-3.1-8B-Instruct-GGUF",
11+
model: "mradermacher/Meta-Llama-3.1-8B-Instruct-GGUF",
1212
branch: "main",
13-
file: "Meta-Llama-3.1-8B-Instruct-Q8_0.gguf"
13+
file: "Meta-Llama-3.1-8B-Instruct.Q8_0.gguf"
1414
}
1515
}, {
1616
huggingFace: {
17-
model: "bartowski/Meta-Llama-3.1-8B-Instruct-GGUF",
17+
model: "mradermacher/Meta-Llama-3.1-8B-Instruct-GGUF",
1818
branch: "main",
19-
file: "Meta-Llama-3.1-8B-Instruct-Q6_K_L.gguf"
19+
file: "Meta-Llama-3.1-8B-Instruct.Q6_K.gguf"
2020
}
2121
}, {
2222
huggingFace: {
23-
model: "bartowski/Meta-Llama-3.1-8B-Instruct-GGUF",
23+
model: "mradermacher/Meta-Llama-3.1-8B-Instruct-GGUF",
2424
branch: "main",
25-
file: "Meta-Llama-3.1-8B-Instruct-Q5_K_L.gguf"
26-
}
27-
}, {
28-
huggingFace: {
29-
model: "bartowski/Meta-Llama-3.1-8B-Instruct-GGUF",
30-
branch: "main",
31-
file: "Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf"
25+
file: "Meta-Llama-3.1-8B-Instruct.Q4_K_M.gguf"
3226
}
3327
}]
3428
}, {
@@ -40,33 +34,27 @@ export const recommendedModels: ModelRecommendation[] = [{
4034

4135
fileOptions: [{
4236
huggingFace: {
43-
model: "bartowski/Meta-Llama-3.1-70B-Instruct-GGUF",
37+
model: "mradermacher/Meta-Llama-3.1-70B-Instruct-GGUF",
4438
branch: "main",
45-
file: "Meta-Llama-3.1-70B-Instruct-Q8_0/Meta-Llama-3.1-70B-Instruct-Q8_0-00001-of-00002.gguf"
39+
file: "Meta-Llama-3.1-70B-Instruct.Q8_0.gguf.part1of2"
4640
}
4741
}, {
4842
huggingFace: {
49-
model: "bartowski/Meta-Llama-3.1-70B-Instruct-GGUF",
43+
model: "mradermacher/Meta-Llama-3.1-70B-Instruct-GGUF",
5044
branch: "main",
51-
file: "Meta-Llama-3.1-70B-Instruct-Q6_K_L/Meta-Llama-3.1-70B-Instruct-Q6_K_L-00001-of-00002.gguf"
45+
file: "Meta-Llama-3.1-70B-Instruct.Q6_K.gguf.part1of2"
5246
}
5347
}, {
5448
huggingFace: {
55-
model: "bartowski/Meta-Llama-3.1-70B-Instruct-GGUF",
49+
model: "mradermacher/Meta-Llama-3.1-70B-Instruct-GGUF",
5650
branch: "main",
57-
file: "Meta-Llama-3.1-70B-Instruct-Q5_K_L/Meta-Llama-3.1-70B-Instruct-Q5_K_L-00001-of-00002.gguf"
51+
file: "Meta-Llama-3.1-70B-Instruct.Q4_K_M.gguf"
5852
}
5953
}, {
6054
huggingFace: {
61-
model: "bartowski/Meta-Llama-3.1-70B-Instruct-GGUF",
55+
model: "mradermacher/Meta-Llama-3.1-70B-Instruct-GGUF",
6256
branch: "main",
63-
file: "Meta-Llama-3.1-70B-Instruct-Q4_K_M.gguf"
64-
}
65-
}, {
66-
huggingFace: {
67-
model: "bartowski/Meta-Llama-3.1-70B-Instruct-GGUF",
68-
branch: "main",
69-
file: "Meta-Llama-3.1-70B-Instruct-IQ4_XS.gguf"
57+
file: "Meta-Llama-3.1-70B-Instruct.Q4_K_S.gguf"
7058
}
7159
}]
7260
}, {
@@ -82,6 +70,12 @@ export const recommendedModels: ModelRecommendation[] = [{
8270
branch: "main",
8371
file: "Meta-Llama-3.1-405B-Instruct.Q3_K_L.gguf.part1of5"
8472
}
73+
}, {
74+
huggingFace: {
75+
model: "mradermacher/Meta-Llama-3.1-405B-Instruct-GGUF",
76+
branch: "main",
77+
file: "Meta-Llama-3.1-405B-Instruct.Q3_K_M.gguf.part1of4"
78+
}
8579
}]
8680
}, {
8781
name: "Phi 3 3.8B",

src/gguf/insights/GgufInsights.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ export class GgufInsights {
145145
const uint32TBytes = 4; // sizeof(uint32_t)
146146
const int32TBytes = 4; // sizeof(int32_t)
147147

148-
// source: `llama_get_state_size` in `llama.cpp`
148+
// source: `llama_state_get_size` in `llama.cpp`
149149
const sRngSize = sizeTBytes;
150-
const sRng = this._llama._consts.llamaMaxRngState;
150+
const sRng = 64 * 1024; // LLAMA_MAX_RNG_STATE
151151
const sNOutputs = sizeTBytes;
152152
const sNOutputPos = batchSize * int32TBytes;
153153
const sLogitsSize = sizeTBytes;

0 commit comments

Comments
 (0)