@ariacompute/engine-rn 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/package.json +1 -1
- package/src/index.js +2 -2
package/README.md
CHANGED
|
@@ -19,5 +19,5 @@ reused without re-downloading. The zip streaming + extraction is delegated to th
|
|
|
19
19
|
native `AriaEngineModule` bridge.
|
|
20
20
|
|
|
21
21
|
```js
|
|
22
|
-
const eng = await AriaEngine.open("gemma-4-e2b-it_q4", { token: "
|
|
22
|
+
const eng = await AriaEngine.open("gemma-4-e2b-it_q4", { token: "API_TOKEN" });
|
|
23
23
|
```
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function isLocalRef(ref) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async function downloadModel(model, token, site = DEFAULT_SITE) {
|
|
54
|
-
if (!token) throw new Error('
|
|
54
|
+
if (!token) throw new Error('api token is required to download a model');
|
|
55
55
|
const { slug, quant } = parseBundleName(model);
|
|
56
56
|
const cache = cacheDir(model);
|
|
57
57
|
if (require('fs').existsSync(cache) && (await AriaEngineModule?.isValidBundle?.(cache))) {
|
|
@@ -80,7 +80,7 @@ export class AriaEngine {
|
|
|
80
80
|
static async open(modelRef, opts = {}) {
|
|
81
81
|
if (isLocalRef(modelRef)) return new AriaEngine(modelRef);
|
|
82
82
|
if (!opts.token) {
|
|
83
|
-
throw new Error(`model name '${modelRef}' requires
|
|
83
|
+
throw new Error(`model name '${modelRef}' requires an api token to download`);
|
|
84
84
|
}
|
|
85
85
|
const bundle = await downloadModel(modelRef, opts.token, opts.site ?? DEFAULT_SITE);
|
|
86
86
|
return new AriaEngine(bundle);
|