andriygav commited on
Commit
d7cf8cf
·
verified ·
1 Parent(s): 2503f28

Upload folder using huggingface_hub

Browse files
Files changed (7) hide show
  1. .gitattributes +0 -33
  2. LICENSE +21 -0
  3. README.md +132 -0
  4. artm/p_wt.bin +3 -0
  5. artm/parameters.bin +3 -0
  6. config.json +109 -0
  7. tokenizers.json.gz +3 -0
.gitattributes CHANGED
@@ -1,35 +1,2 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
  *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
  *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
1
  *.bin filter=lfs diff=lfs merge=lfs -text
 
 
 
2
  *.gz filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 redup.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: redup-topicmodel
4
+ tags:
5
+ - topic-modeling
6
+ - bigartm
7
+ - multilingual
8
+ - feature-extraction
9
+ ---
10
+
11
+ # REDUP multilingual topic model
12
+
13
+ BigARTM topic-model artifacts for package `redup-topicmodel`
14
+ (`redup.python.topicmodel`), created **2026-07-24**.
15
+
16
+ This is a **custom** model dump (not Transformers / Diffusers). Load it with
17
+ `huggingface_hub` + `redup-topicmodel` (and `bigartm==0.9.2`).
18
+ `AutoModel` / `AutoTokenizer` are not supported.
19
+
20
+ ## Contents
21
+
22
+ | Path | Role |
23
+ |------|------|
24
+ | `artm/parameters.bin` | BigARTM metadata + regularizers (pickle) |
25
+ | `artm/p_wt.bin` | Topic–token matrix Φ for inference |
26
+ | `tokenizers.json.gz` | Per-language BPE packs: `{lang: {vocab, merges}}` |
27
+ | `config.json` | Hub metadata (languages, versions) |
28
+
29
+ ## Languages
30
+
31
+ 100 languages: af, am, ar, av, az, ba, be, bg, bn, bs, ca, ce, cs, cv, cy, da,
32
+ de, el, en, eo, es, et, eu, fa, fi, fr, gd, gl, gu, he, hi, hr, hu, hy, ia, id,
33
+ inh, is, it, ja, jv, ka, kaa, kbd, kk, kl, km, ko, krc, ky, la, lez, lo, lt, lv,
34
+ mg, mhr, mi, mk, ml, mn, mo, ms, my, myv, ne, nl, no, oc, os, pl, pt, rm, rn, ro,
35
+ ru, sah, sh, si, sk, sl, sm, so, sq, sr, sv, sw, ta, tg, th, tk, tr, tt, udm, uk,
36
+ ur, uz, vi, yi, zh.
37
+
38
+ Document modality `lang` selects the BPE pack; tokens are scored under BigARTM
39
+ class id `@{lang}` (125 topics: `topic_0` … `topic_124`).
40
+
41
+ ## Install
42
+
43
+ ```bash
44
+ pip install huggingface_hub redup-topicmodel bigartm==0.9.2
45
+ ```
46
+
47
+ ## Download
48
+
49
+ ```python
50
+ from huggingface_hub import snapshot_download
51
+
52
+ root = snapshot_download(repo_id="redup-ai/topicmodel-multilingual")
53
+ # root/
54
+ # artm/parameters.bin
55
+ # artm/p_wt.bin
56
+ # tokenizers.json.gz
57
+ # config.json
58
+ # README.md
59
+ ```
60
+
61
+ ## Inference (recommended)
62
+
63
+ High-level worker used by the gRPC service:
64
+
65
+ ```python
66
+ import asyncio
67
+ from types import SimpleNamespace
68
+
69
+ from redup_topicmodel.topicmodel.inference import InferenceWorker
70
+
71
+
72
+ def document(document_id: str, tokens: list[str], lang: str):
73
+ return SimpleNamespace(
74
+ document_id=document_id,
75
+ tokens=tokens,
76
+ modalities={"lang": lang},
77
+ )
78
+
79
+
80
+ async def main(root: str):
81
+ worker = InferenceWorker({
82
+ "artifact_root": root,
83
+ "work_dir": "/tmp/topicmodel",
84
+ })
85
+ pack = SimpleNamespace(documents=[
86
+ document("doc-en", ["hello", "world"], "en"),
87
+ document("doc-ru", ["привет", "мир"], "ru"),
88
+ ])
89
+ result = await worker.get_documents_embedding("example", pack)
90
+ for embedding in result["embeddings"]:
91
+ print(len(embedding["values"]), sum(embedding["values"]))
92
+
93
+
94
+ asyncio.run(main(root))
95
+ ```
96
+
97
+ Each embedding is a length-125 topic distribution (≈ sums to 1).
98
+
99
+ ## Tokenizer only
100
+
101
+ ```python
102
+ from redup_topicmodel.topicmodel.bpe import load_bpe_models
103
+
104
+ bpe = load_bpe_models(f"{root}/tokenizers.json.gz")
105
+ print(bpe["en"].encode("hello world").tokens)
106
+ ```
107
+
108
+ ## Load BigARTM weights only
109
+
110
+ ```python
111
+ from redup_topicmodel.topicmodel.artm_loader import load_artm_model_inference
112
+
113
+ model = load_artm_model_inference(f"{root}/artm")
114
+ ```
115
+
116
+ ## gRPC service config
117
+
118
+ ```yaml
119
+ TopicModel:
120
+ artifact_root: /path/from/snapshot_download
121
+ work_dir: /tmp/topicmodel
122
+ ```
123
+
124
+ ## Notes
125
+
126
+ - `parameters.bin` is a Python pickle produced by BigARTM; only load trusted artifacts.
127
+ - `tokenizers.json.gz` is intentional: one file with 100 independent BPE packs.
128
+ This is **not** a Hugging Face `tokenizer.json` / `AutoTokenizer` export.
129
+
130
+ ## License
131
+
132
+ MIT.
artm/p_wt.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:619f03c8d5ce5d400692ace45235a319d03e9667a6499d8854ec9014f9e6a645
3
+ size 168434939
artm/parameters.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36b7ca0a60ef59970cfc1bc4b760e14999476f66c2f3196edced60e70d4ecbe1
3
+ size 146709
config.json ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "redup-multilingual-topicmodel",
3
+ "library": "redup-topicmodel",
4
+ "framework": "BigARTM",
5
+ "bigartm_version": "0.9.2",
6
+ "created": "2026-07-24",
7
+ "languages": [
8
+ "af",
9
+ "am",
10
+ "ar",
11
+ "av",
12
+ "az",
13
+ "ba",
14
+ "be",
15
+ "bg",
16
+ "bn",
17
+ "bs",
18
+ "ca",
19
+ "ce",
20
+ "cs",
21
+ "cv",
22
+ "cy",
23
+ "da",
24
+ "de",
25
+ "el",
26
+ "en",
27
+ "eo",
28
+ "es",
29
+ "et",
30
+ "eu",
31
+ "fa",
32
+ "fi",
33
+ "fr",
34
+ "gd",
35
+ "gl",
36
+ "gu",
37
+ "he",
38
+ "hi",
39
+ "hr",
40
+ "hu",
41
+ "hy",
42
+ "ia",
43
+ "id",
44
+ "inh",
45
+ "is",
46
+ "it",
47
+ "ja",
48
+ "jv",
49
+ "ka",
50
+ "kaa",
51
+ "kbd",
52
+ "kk",
53
+ "kl",
54
+ "km",
55
+ "ko",
56
+ "krc",
57
+ "ky",
58
+ "la",
59
+ "lez",
60
+ "lo",
61
+ "lt",
62
+ "lv",
63
+ "mg",
64
+ "mhr",
65
+ "mi",
66
+ "mk",
67
+ "ml",
68
+ "mn",
69
+ "mo",
70
+ "ms",
71
+ "my",
72
+ "myv",
73
+ "ne",
74
+ "nl",
75
+ "no",
76
+ "oc",
77
+ "os",
78
+ "pl",
79
+ "pt",
80
+ "rm",
81
+ "rn",
82
+ "ro",
83
+ "ru",
84
+ "sah",
85
+ "sh",
86
+ "si",
87
+ "sk",
88
+ "sl",
89
+ "sm",
90
+ "so",
91
+ "sq",
92
+ "sr",
93
+ "sv",
94
+ "sw",
95
+ "ta",
96
+ "tg",
97
+ "th",
98
+ "tk",
99
+ "tr",
100
+ "tt",
101
+ "udm",
102
+ "uk",
103
+ "ur",
104
+ "uz",
105
+ "vi",
106
+ "yi",
107
+ "zh"
108
+ ]
109
+ }
tokenizers.json.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f831dd774fd65009e55716894b9a8c1f5c4aaf7e0f07d1e829dd34cfd6ff4d3
3
+ size 94253290