@ariacompute/engine-ts 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,5 +22,5 @@ into `~/.ariacompute/models/{model}` and then loads it. A valid cached bundle is
|
|
|
22
22
|
reused without re-downloading.
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
|
-
const eng = await Engine.open("gemma-4-e2b-it_q4", { token: "
|
|
25
|
+
const eng = await Engine.open("gemma-4-e2b-it_q4", { token: "API_TOKEN" });
|
|
26
26
|
```
|
package/dist/index.js
CHANGED
|
@@ -130,7 +130,7 @@ const encoder = new TextEncoder();
|
|
|
130
130
|
* Skips the download when a valid bundle is already cached. */
|
|
131
131
|
async function downloadModel(model, token, site = DEFAULT_SITE) {
|
|
132
132
|
if (!token)
|
|
133
|
-
throw new Error("
|
|
133
|
+
throw new Error("api token is required to download a model");
|
|
134
134
|
const { slug, quant } = parseBundleName(model);
|
|
135
135
|
const cache = cacheDir(model);
|
|
136
136
|
if (fs.existsSync(cache) && isValidBundle(cache))
|
|
@@ -192,7 +192,7 @@ class Engine {
|
|
|
192
192
|
if (isLocalRef(modelRef))
|
|
193
193
|
return new Engine(modelRef, opts);
|
|
194
194
|
if (!opts.token) {
|
|
195
|
-
throw new Error(`model name '${modelRef}' requires
|
|
195
|
+
throw new Error(`model name '${modelRef}' requires an api token to download`);
|
|
196
196
|
}
|
|
197
197
|
const bundle = await downloadModel(modelRef, opts.token, opts.site ?? DEFAULT_SITE);
|
|
198
198
|
return new Engine(bundle, opts);
|