michaljach commited on
Commit
6e85ee6
·
verified ·
1 Parent(s): 0522f09

Model card: @nodd 0.2.0 API (import { nodd })

Browse files
Files changed (1) hide show
  1. README.md +6 -3
README.md CHANGED
@@ -44,13 +44,16 @@ npm install @nodd/browser # or @nodd/node on a server
44
  ```
45
 
46
  ```ts
47
- import { Nodd } from "@nodd/browser";
48
 
49
- const m = await Nodd.load("/models/sentiment/v1");
50
  const d = await m.decide("..."); // { label, probabilities, confidence, ... }
51
- if (!m.isConfident(d)) { /* escalate */ }
 
52
  ```
53
 
 
 
54
  ## Files
55
 
56
  - `onnx/model_quantized.onnx`: int8 model used by default; `onnx/model.onnx`: fp32 (`dtype: "fp32"`)
 
44
  ```
45
 
46
  ```ts
47
+ import { nodd } from "@nodd/browser"; // or "@nodd/node": same API, reads the folder from disk
48
 
49
+ const m = await nodd.load("/models/sentiment/v1");
50
  const d = await m.decide("..."); // { label, probabilities, confidence, ... }
51
+ if (!m.isConfident(d)) { /* below the calibrated threshold: escalate */ }
52
+ m.dispose(); // stops the worker
53
  ```
54
 
55
+ Needs `@nodd/browser` / `@nodd/node` ≥ 0.2.0.
56
+
57
  ## Files
58
 
59
  - `onnx/model_quantized.onnx`: int8 model used by default; `onnx/model.onnx`: fp32 (`dtype: "fp32"`)