@qvac/translation-nmtcpp 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/lib/indictrans-model-fetcher.js +23 -6
- package/package.json +11 -11
- package/prebuilds/android-arm64/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/darwin-arm64/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/darwin-arm64/qvac__translation-nmtcpp.bare.exports +1 -1
- package/prebuilds/darwin-x64/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/darwin-x64/qvac__translation-nmtcpp.bare.exports +1 -1
- package/prebuilds/ios-arm64/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/ios-arm64/qvac__translation-nmtcpp.bare.exports +1 -1
- package/prebuilds/ios-arm64-simulator/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/ios-arm64-simulator/qvac__translation-nmtcpp.bare.exports +1 -1
- package/prebuilds/ios-x64-simulator/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/ios-x64-simulator/qvac__translation-nmtcpp.bare.exports +1 -1
- package/prebuilds/linux-arm64/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/linux-x64/qvac__translation-nmtcpp.bare +0 -0
- package/prebuilds/win32-x64/qvac__translation-nmtcpp.bare +0 -0
package/README.md
CHANGED
|
@@ -863,9 +863,16 @@ const {
|
|
|
863
863
|
getIndicTransFileName // filename for a model key
|
|
864
864
|
} = require('@qvac/translation-nmtcpp/lib/indictrans-model-fetcher')
|
|
865
865
|
|
|
866
|
-
const
|
|
866
|
+
const path = require('bare-path')
|
|
867
|
+
|
|
868
|
+
const modelKey = 'en-indic-1B-q4_0'
|
|
869
|
+
const modelPath = path.join('./models', getIndicTransFileName(modelKey))
|
|
870
|
+
await ensureIndicTransModelFile(modelPath, modelKey)
|
|
867
871
|
```
|
|
868
872
|
|
|
873
|
+
`ensureIndicTransModelFile(destPath, modelKey)` takes the full destination
|
|
874
|
+
file path and a model key. The key defaults to `en-indic-200M-q4_0`.
|
|
875
|
+
|
|
869
876
|
### Key Pattern
|
|
870
877
|
|
|
871
878
|
IndicTrans2 fetcher keys follow `{direction}-{size}-{quantization}` — e.g.
|
|
@@ -873,6 +880,12 @@ IndicTrans2 fetcher keys follow `{direction}-{size}-{quantization}` — e.g.
|
|
|
873
880
|
underlying registry paths follow
|
|
874
881
|
`qvac_models_compiled/ggml/indictrans2/{quant}/{model}/{date}/{file}`.
|
|
875
882
|
|
|
883
|
+
| Direction | Sizes | Quantizations |
|
|
884
|
+
|-----------|-------|---------------|
|
|
885
|
+
| `en-indic` | `200M`, `1B` | `q4_0`, `f16` |
|
|
886
|
+
| `indic-en` | `200M`, `1B` | `q4_0`, `f16` |
|
|
887
|
+
| `indic-indic` | `320M`, `1B` | `q4_0`, `f16` |
|
|
888
|
+
|
|
876
889
|
Applications that prefer not to manage files at all can use
|
|
877
890
|
[`@qvac/inference`](../inference), which loads registry-hosted NMT models
|
|
878
891
|
(engine `nmtcpp-translation`) and drives this addon internally.
|
|
@@ -14,13 +14,30 @@ exports.getIndicTransFileName = getIndicTransFileName;
|
|
|
14
14
|
/* eslint-disable @typescript-eslint/no-require-imports -- Bare modules expose CommonJS export shapes. */
|
|
15
15
|
const fs = require("bare-fs");
|
|
16
16
|
const path = require("bare-path");
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
17
|
+
function registryModel(direction, size, quantization, expectedMinSizeMB) {
|
|
18
|
+
const variant = size === "1B" ? size : `dist-${size}`;
|
|
19
|
+
const modelName = `ggml-indictrans2-${direction}-${variant}`;
|
|
20
|
+
const filename = `${modelName}-${quantization}.bin`;
|
|
21
|
+
return {
|
|
22
|
+
registryPath: `qvac_models_compiled/ggml/indictrans2/${quantization}/${modelName}/2026-01-01/${filename}`,
|
|
20
23
|
registrySource: "s3",
|
|
21
|
-
filename
|
|
22
|
-
expectedMinSizeMB
|
|
23
|
-
}
|
|
24
|
+
filename,
|
|
25
|
+
expectedMinSizeMB,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.INDICTRANS_MODELS = {
|
|
29
|
+
"en-indic-200M-q4_0": registryModel("en-indic", "200M", "q4_0", 100),
|
|
30
|
+
"en-indic-200M-f16": registryModel("en-indic", "200M", "f16", 330),
|
|
31
|
+
"en-indic-1B-q4_0": registryModel("en-indic", "1B", "q4_0", 480),
|
|
32
|
+
"en-indic-1B-f16": registryModel("en-indic", "1B", "f16", 1700),
|
|
33
|
+
"indic-en-200M-q4_0": registryModel("indic-en", "200M", "q4_0", 100),
|
|
34
|
+
"indic-en-200M-f16": registryModel("indic-en", "200M", "f16", 330),
|
|
35
|
+
"indic-en-1B-q4_0": registryModel("indic-en", "1B", "q4_0", 440),
|
|
36
|
+
"indic-en-1B-f16": registryModel("indic-en", "1B", "f16", 1560),
|
|
37
|
+
"indic-indic-320M-q4_0": registryModel("indic-indic", "320M", "q4_0", 150),
|
|
38
|
+
"indic-indic-320M-f16": registryModel("indic-indic", "320M", "f16", 500),
|
|
39
|
+
"indic-indic-1B-q4_0": registryModel("indic-indic", "1B", "q4_0", 530),
|
|
40
|
+
"indic-indic-1B-f16": registryModel("indic-indic", "1B", "f16", 1850),
|
|
24
41
|
};
|
|
25
42
|
// ============================================================================
|
|
26
43
|
// Helpers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/translation-nmtcpp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "translation addon for qvac",
|
|
5
5
|
"addon": true,
|
|
6
6
|
"engines": {
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"llvm-runtime": "^23.1.0",
|
|
92
92
|
"nasm-runtime": "^3.2.0",
|
|
93
93
|
"ninja-runtime": "^1.13.1",
|
|
94
|
-
"@qvac/fabric-android-arm64": "^0.
|
|
95
|
-
"@qvac/fabric-ios": "^0.
|
|
94
|
+
"@qvac/fabric-android-arm64": "^0.33.0",
|
|
95
|
+
"@qvac/fabric-ios": "^0.33.0",
|
|
96
96
|
"@qvac/registry-client": "^0.6.1",
|
|
97
97
|
"@types/node": "^24.2.1",
|
|
98
98
|
"bare-fetch": "^3.0.1",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@qvac/error": "^0.1.0",
|
|
115
|
-
"@qvac/fabric": "^0.
|
|
115
|
+
"@qvac/fabric": "^0.33.0",
|
|
116
116
|
"@qvac/infer-base": "^0.8.0",
|
|
117
117
|
"@qvac/logging": "^0.1.0",
|
|
118
118
|
"bare-fs": "^4.5.1",
|
|
@@ -122,16 +122,16 @@
|
|
|
122
122
|
"bare-url": "^2.1.6"
|
|
123
123
|
},
|
|
124
124
|
"optionalDependencies": {
|
|
125
|
-
"@qvac/fabric-linux-x64": "^0.
|
|
126
|
-
"@qvac/fabric-linux-arm64": "^0.
|
|
127
|
-
"@qvac/fabric-darwin-arm64": "^0.
|
|
128
|
-
"@qvac/fabric-darwin-x64": "^0.
|
|
129
|
-
"@qvac/fabric-win32-x64": "^0.
|
|
125
|
+
"@qvac/fabric-linux-x64": "^0.33.0",
|
|
126
|
+
"@qvac/fabric-linux-arm64": "^0.33.0",
|
|
127
|
+
"@qvac/fabric-darwin-arm64": "^0.33.0",
|
|
128
|
+
"@qvac/fabric-darwin-x64": "^0.33.0",
|
|
129
|
+
"@qvac/fabric-win32-x64": "^0.33.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependencies": {
|
|
132
132
|
"bare-fetch": "^3.0.1",
|
|
133
|
-
"@qvac/fabric-android-arm64": "^0.
|
|
134
|
-
"@qvac/fabric-ios": "^0.
|
|
133
|
+
"@qvac/fabric-android-arm64": "^0.33.0",
|
|
134
|
+
"@qvac/fabric-ios": "^0.33.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependenciesMeta": {
|
|
137
137
|
"bare-fetch": {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|