Spaces:
Running
Running
Download lib/worker.js from lkmill/edan20-assignment3: direct link, hf CLI and curl.
- Browser
- Download file 257 Bytes
-
https://huggingface.co/spaces/lkmill/edan20-assignment3/resolve/main/lib/worker.js
- Command line
-
hf download hf://spaces/lkmill/edan20-assignment3/lib/worker.js
-
curl -L -o worker.js https://huggingface.co/spaces/lkmill/edan20-assignment3/resolve/main/lib/worker.js
257 Bytes
| import * as bpe from './bpe.js' | |
| import * as unigramLM from './unigram_lm.js' | |
| import * as util from './util.js' | |
| const fns = { | |
| ...bpe, | |
| ...unigramLM, | |
| ...util, | |
| } | |
| onmessage = ({ data }) => { | |
| const { fn, args } = data | |
| postMessage(fns[fn](...args)) | |
| } | |