Darayut commited on
Commit
e831829
·
verified ·
1 Parent(s): 6c462c6

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +36 -0
  2. config.json +20 -0
  3. model.safetensors +3 -0
  4. spm_32k.model +3 -0
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - km
5
+ license: mit
6
+ library_name: netra-nmt
7
+ pipeline_tag: translation
8
+ tags:
9
+ - translation
10
+ - khmer
11
+ - english
12
+ - diffusion
13
+ - non-autoregressive
14
+ ---
15
+
16
+ # netra-nmt (diffusion, experimental)
17
+
18
+ A non-autoregressive **discrete-diffusion** decoder variant of netra-nmt, same
19
+ encoder-decoder size (~90M params) as the autoregressive model, trading some
20
+ translation quality for fixed-cost, parallel CPU decoding (see the main repo
21
+ README for the quality/latency comparison).
22
+
23
+ ## Usage
24
+
25
+ ```bash
26
+ pip install netra-nmt
27
+ ```
28
+
29
+ ```python
30
+ from netra_nmt import DiffusionTranslator
31
+ t = DiffusionTranslator(repo_id="Darayut/netra-nmt-small-diffusion", steps=10)
32
+ print(t.translate("Hello, how are you?", direction="en2km"))
33
+ print(t.translate("សួស្តី", direction="km2en"))
34
+ ```
35
+
36
+ Files: `model.safetensors` (fp16 weights), `config.json`, `spm_32k.model` (SentencePiece tokenizer).
config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "d_model": 512,
3
+ "enc_layers": 6,
4
+ "dec_layers": 6,
5
+ "n_heads": 8,
6
+ "ffn_dim": 2048,
7
+ "max_len": 256,
8
+ "pad_id": 0,
9
+ "bos_id": 2,
10
+ "eos_id": 3,
11
+ "vocab_size": 32000,
12
+ "mask_id": 32000,
13
+ "decode_steps": 10,
14
+ "lang_markers": {
15
+ "en": "<2en>",
16
+ "km": "<2km>"
17
+ },
18
+ "dtype": "float16",
19
+ "model_type": "diffusion"
20
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa5fec147fa7acb6fd92708734959292b30022b3f2a90b4fb9b3698ae6d1d0ac
3
+ size 179726720
spm_32k.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8daf6a441688a671e97cd579de636e86870d3bf4c3796c6f3a2e39dd8363051
3
+ size 1052926