umer-wasim commited on
Commit
dd15de2
·
verified ·
1 Parent(s): 28e3615

Load the classifier from Devseis/devseis-ai-act-classifier-v6 (pinned) instead of the bundled copy

Browse files

The model repo's download count now shows how many browsers ran the check. Pinned to 7c594f6; outputs checked identical to the bundled copy with transformers.js 3.0.0. Privacy page updated.

Files changed (4) hide show
  1. HANDBOOK.md +1 -1
  2. README.md +5 -3
  3. index.html +9 -5
  4. privacy.html +2 -2
HANDBOOK.md CHANGED
@@ -18,7 +18,7 @@ certificate. It is a **demo and marketing tool, not a compliance tool and not le
18
  ### On the Hugging Face Hub (organisation `Devseis`)
19
  | Repo | What it is | Licence |
20
  |---|---|---|
21
- | [`spaces/Devseis/Caveat`](https://huggingface.co/spaces/Devseis/Caveat) | The live page (static Space). Loads a runtime copy of the model from `models/devseis-ai-act-classifier-v6/`. | page CC BY 4.0; model folder CC BY-SA 4.0 |
22
  | [`Devseis/devseis-ai-act-classifier-v6`](https://huggingface.co/Devseis/devseis-ai-act-classifier-v6) | **Current model**: weights, int8 ONNX, card, evaluation reports | **CC BY-SA 4.0** (required, see §5) |
23
  | [`datasets/Devseis/devseis-ai-act-classifier-v6-data`](https://huggingface.co/datasets/Devseis/devseis-ai-act-classifier-v6-data) | Current training/val/test data | CC BY 4.0 |
24
  | `Devseis/devseis-ai-act-classifier-v5` (+ `-v5-data`) | Previous version, removed 2026-10-12: its test rows are all in v6-data (`test_v6.csv`) and its change notes in `CHANGES_v5.md` there | — |
 
18
  ### On the Hugging Face Hub (organisation `Devseis`)
19
  | Repo | What it is | Licence |
20
  |---|---|---|
21
+ | [`spaces/Devseis/Caveat`](https://huggingface.co/spaces/Devseis/Caveat) | The live page (static Space). Loads the model from `Devseis/devseis-ai-act-classifier-v6` at commit `7c594f6` (`MODEL_REVISION`); the old copy in `models/` is no longer used. | page CC BY 4.0; model folder CC BY-SA 4.0 |
22
  | [`Devseis/devseis-ai-act-classifier-v6`](https://huggingface.co/Devseis/devseis-ai-act-classifier-v6) | **Current model**: weights, int8 ONNX, card, evaluation reports | **CC BY-SA 4.0** (required, see §5) |
23
  | [`datasets/Devseis/devseis-ai-act-classifier-v6-data`](https://huggingface.co/datasets/Devseis/devseis-ai-act-classifier-v6-data) | Current training/val/test data | CC BY 4.0 |
24
  | `Devseis/devseis-ai-act-classifier-v5` (+ `-v5-data`) | Previous version, removed 2026-10-12: its test rows are all in v6-data (`test_v6.csv`) and its change notes in `CHANGES_v5.md` there | — |
README.md CHANGED
@@ -59,9 +59,11 @@ points there), so the page makes no third-party CDN requests.
59
  HTML/CSS/vanilla JS, no framework, no build step.
60
  - **Part 1 (fine-tuned classifier)**: runs **entirely in the visitor's
61
  browser**. No server call. Devseis AI Act Classifier v6 (fine-tuned from
62
- `nlpaueb/legal-bert-small-uncased` on `data_v6_systems`) ships **inside this Space** at
63
- `models/devseis-ai-act-classifier-v6/`. [`@huggingface/transformers`](https://github.com/huggingface/transformers.js)
64
- 3.0.0 loads it with `env.localModelPath = "./models/"` and `dtype: "q8"`,
 
 
65
  which fetches `onnx/model_quantized.onnx` (~36MB, int8), and runs it with WASM.
66
  The int8 file matches the PyTorch model on 98.6% of test rows under
67
  `onnxruntime-web`. The full model card is on the Hub, at `Devseis/devseis-ai-act-classifier-v6`.
 
59
  HTML/CSS/vanilla JS, no framework, no build step.
60
  - **Part 1 (fine-tuned classifier)**: runs **entirely in the visitor's
61
  browser**. No server call. Devseis AI Act Classifier v6 (fine-tuned from
62
+ `nlpaueb/legal-bert-small-uncased` on `data_v6_systems`) is loaded from its repo
63
+ [`Devseis/devseis-ai-act-classifier-v6`](https://huggingface.co/Devseis/devseis-ai-act-classifier-v6), pinned to
64
+ commit `7c594f6` (`MODEL_REVISION` in `index.html`), so the repo's download count shows how many browsers ran the
65
+ check (the browser caches the files after the first use). [`@huggingface/transformers`](https://github.com/huggingface/transformers.js)
66
+ 3.0.0 loads it with `dtype: "q8"`,
67
  which fetches `onnx/model_quantized.onnx` (~36MB, int8), and runs it with WASM.
68
  The int8 file matches the PyTorch model on 98.6% of test rows under
69
  `onnxruntime-web`. The full model card is on the Hub, at `Devseis/devseis-ai-act-classifier-v6`.
index.html CHANGED
@@ -693,10 +693,12 @@
693
  import { pipeline, env } from "./vendor/transformers-3.0.0/transformers.min.js"; // self-hosted, byte-identical to npm 3.0.0
694
  import { gpaiCheck } from "./gpai_rule.js";
695
 
696
- // Part 1's model ships inside this Space (models/devseis-ai-act-classifier-v6/, a copy of Devseis/devseis-ai-act-classifier-v6), so nothing is fetched from another repo.
697
- env.allowLocalModels = true;
698
- env.allowRemoteModels = false;
699
- env.localModelPath = "./models/";
 
 
700
  // The WebAssembly engine is self-hosted too (the library would otherwise fetch it from jsDelivr).
701
  env.backends.onnx.wasm.wasmPaths = new URL("./vendor/transformers-3.0.0/", location.href).href;
702
 
@@ -862,7 +864,8 @@
862
  const runBtn = $("runBtn"), runHint = $("runHint");
863
  // The trained model (~36 MB, plus the ~22 MB engine) is downloaded only when someone shows intent to use the
864
  // checker — focusing the text box, tapping an example, or pressing Check — not for visitors who only read.
865
- const MODEL_ID = "devseis-ai-act-classifier-v6";
 
866
  // Below this top probability the trained model's answer is shown as "uncertain". A stricter cut-off was tested on
867
  // validation data and rejected: this model's mistakes are mostly confident, so it would hide more right answers than wrong ones.
868
  const UNSURE_BELOW = 0.5;
@@ -872,6 +875,7 @@
872
  if (!modelPromise) {
873
  runHint.textContent = "Preparing the model in your browser…";
874
  modelPromise = pipeline("text-classification", MODEL_ID, {
 
875
  dtype: "q8",
876
  progress_callback: (pr) => {
877
  if (pr.status === "progress" && pr.file && /\.(onnx|wasm)$/.test(pr.file) && pr.total) {
 
693
  import { pipeline, env } from "./vendor/transformers-3.0.0/transformers.min.js"; // self-hosted, byte-identical to npm 3.0.0
694
  import { gpaiCheck } from "./gpai_rule.js";
695
 
696
+ // Part 1's model is loaded from its own repo, Devseis/devseis-ai-act-classifier-v6, pinned to a tested commit
697
+ // (MODEL_REVISION), and kept in the browser cache after the first use. Hugging Face counts that first download, so the
698
+ // repo's download count shows how many browsers ran the check. Outputs were checked identical to the copy this Space
699
+ // used to ship in models/ (8 test texts, transformers.js 3.0.0).
700
+ env.allowLocalModels = false;
701
+ env.allowRemoteModels = true;
702
  // The WebAssembly engine is self-hosted too (the library would otherwise fetch it from jsDelivr).
703
  env.backends.onnx.wasm.wasmPaths = new URL("./vendor/transformers-3.0.0/", location.href).href;
704
 
 
864
  const runBtn = $("runBtn"), runHint = $("runHint");
865
  // The trained model (~36 MB, plus the ~22 MB engine) is downloaded only when someone shows intent to use the
866
  // checker — focusing the text box, tapping an example, or pressing Check — not for visitors who only read.
867
+ const MODEL_ID = "Devseis/devseis-ai-act-classifier-v6";
868
+ const MODEL_REVISION = "7c594f61c40b1c1aa4a7c45a397a64f765b2f323";
869
  // Below this top probability the trained model's answer is shown as "uncertain". A stricter cut-off was tested on
870
  // validation data and rejected: this model's mistakes are mostly confident, so it would hide more right answers than wrong ones.
871
  const UNSURE_BELOW = 0.5;
 
875
  if (!modelPromise) {
876
  runHint.textContent = "Preparing the model in your browser…";
877
  modelPromise = pipeline("text-classification", MODEL_ID, {
878
+ revision: MODEL_REVISION,
879
  dtype: "q8",
880
  progress_callback: (pr) => {
881
  if (pr.status === "progress" && pr.file && /\.(onnx|wasm)$/.test(pr.file) && pr.total) {
privacy.html CHANGED
@@ -50,7 +50,7 @@
50
  <div class="wrap">
51
  <a href="index.html" class="back">← Back to Caveat</a>
52
  <h1>Privacy</h1>
53
- <p class="updated">Last updated: 30 September 2026</p>
54
 
55
  <div class="card good">
56
  <p style="margin:0"><strong>The short version.</strong> No account, no sign-up. The trained model runs <b>in your browser</b>, so your
@@ -71,7 +71,7 @@
71
  <td>Hugging Face hosts the page. Like any web host, it processes technical data such as your IP address and browser type to deliver the files and keep the service secure.</td>
72
  <td>Legitimate interest in running the site (GDPR Art. 6(1)(f))</td></tr>
73
  <tr><td><b>Trained model</b></td>
74
- <td>The model files and the code that runs them (transformers.js and ONNX Runtime) are served from this site. <b>Your text is processed only on your device</b> and is not sent anywhere.</td>
75
  <td>Legitimate interest in providing the check you ask for (Art. 6(1)(f))</td></tr>
76
  <tr><td><b>Reasoning AI</b></td>
77
  <td>When you press Check, your text is sent to a Devseis Cloudflare Worker, which passes it to Cloudflare Workers AI for one answer. Devseis's code does not log or store your text. Cloudflare processes the request as the service provider.</td>
 
50
  <div class="wrap">
51
  <a href="index.html" class="back">← Back to Caveat</a>
52
  <h1>Privacy</h1>
53
+ <p class="updated">Last updated: 23 October 2026</p>
54
 
55
  <div class="card good">
56
  <p style="margin:0"><strong>The short version.</strong> No account, no sign-up. The trained model runs <b>in your browser</b>, so your
 
71
  <td>Hugging Face hosts the page. Like any web host, it processes technical data such as your IP address and browser type to deliver the files and keep the service secure.</td>
72
  <td>Legitimate interest in running the site (GDPR Art. 6(1)(f))</td></tr>
73
  <tr><td><b>Trained model</b></td>
74
+ <td>The first time you use the check, your browser downloads the model files from Devseis's model page on Hugging Face (<a href="https://huggingface.co/Devseis/devseis-ai-act-classifier-v6">huggingface.co/Devseis/devseis-ai-act-classifier-v6</a>) and keeps them for later visits. Hugging Face counts that download in the model's public download total, which does not identify you. The code that runs the model (transformers.js and ONNX Runtime) is served from this site. <b>Your text is processed only on your device</b> and is not sent anywhere.</td>
75
  <td>Legitimate interest in providing the check you ask for (Art. 6(1)(f))</td></tr>
76
  <tr><td><b>Reasoning AI</b></td>
77
  <td>When you press Check, your text is sent to a Devseis Cloudflare Worker, which passes it to Cloudflare Workers AI for one answer. Devseis's code does not log or store your text. Cloudflare processes the request as the service provider.</td>