Download worker.js from Bayanat-Labs/arabic-ner-offset-validator: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/Bayanat-Labs/arabic-ner-offset-validator/resolve/main/worker.js
- Command line
-
hf download hf://spaces/Bayanat-Labs/arabic-ner-offset-validator/worker.js
-
curl -L -o worker.js https://huggingface.co/spaces/Bayanat-Labs/arabic-ner-offset-validator/resolve/main/worker.js
401 Bytes
| // Runs the validator off the main thread. Receives {bytes, settings}, returns {ok, report}. | |
| import { validate } from "./validator.js"; | |
| self.onmessage = (e) => { | |
| try { | |
| const { report } = validate(new Uint8Array(e.data.bytes), e.data.settings); | |
| self.postMessage({ ok: true, report }); | |
| } catch (err) { | |
| self.postMessage({ ok: false, error: String((err && err.message) || err) }); | |
| } | |
| }; | |