react-native-executorch 0.11.0 → 1.0.0-nightly-cd0e205-20261029

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.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/legacy/src/constants/modelUrls.ts +172 -167
  3. package/legacy/src/constants/ocr/models.ts +2 -2
  4. package/legacy/src/constants/tts/models.ts +1 -1
  5. package/legacy/src/constants/tts/voices.ts +2 -2
  6. package/legacy/src/constants/versions.ts +1 -1
  7. package/lib/module/extensions/nlp/utils/privacyFilterUtils.js +1 -1
  8. package/lib/module/fetcher/fetcher.js +4 -1
  9. package/lib/module/fetcher/fetcher.js.map +1 -1
  10. package/lib/module/fetcher/renamedRepos.js +104 -0
  11. package/lib/module/fetcher/renamedRepos.js.map +1 -0
  12. package/lib/module/fetcher/telemetry.js +1 -1
  13. package/lib/module/fetcher/telemetry.js.map +1 -1
  14. package/lib/module/legacy/src/constants/modelUrls.js +172 -167
  15. package/lib/module/legacy/src/constants/ocr/models.js +2 -2
  16. package/lib/module/legacy/src/constants/tts/models.js +1 -1
  17. package/lib/module/legacy/src/constants/tts/voices.js +2 -2
  18. package/lib/module/legacy/src/constants/versions.js +1 -1
  19. package/lib/module/models.js +443 -443
  20. package/lib/module/models.js.map +1 -1
  21. package/lib/typescript/legacy/src/constants/modelRegistry.d.ts +173 -173
  22. package/lib/typescript/legacy/src/constants/modelUrls.d.ts +253 -253
  23. package/lib/typescript/legacy/src/constants/versions.d.ts +1 -1
  24. package/lib/typescript/src/extensions/nlp/utils/privacyFilterUtils.d.ts +1 -1
  25. package/lib/typescript/src/fetcher/fetcher.d.ts.map +1 -1
  26. package/lib/typescript/src/fetcher/renamedRepos.d.ts +12 -0
  27. package/lib/typescript/src/fetcher/renamedRepos.d.ts.map +1 -0
  28. package/package.json +1 -1
  29. package/src/extensions/nlp/utils/privacyFilterUtils.ts +1 -1
  30. package/src/fetcher/fetcher.ts +4 -1
  31. package/src/fetcher/renamedRepos.ts +108 -0
  32. package/src/fetcher/telemetry.ts +1 -1
  33. package/src/models.ts +443 -443
@@ -1,4 +1,4 @@
1
1
  export declare const LIB_VERSION = "0.10.0";
2
- export declare const URL_PREFIX = "https://huggingface.co/software-mansion/react-native-executorch";
2
+ export declare const URL_PREFIX = "https://huggingface.co/software-mansion";
3
3
  export declare const PREVIOUS_VERSION_TAG = "resolve/v0.9.0";
4
4
  export declare const VERSION_TAG = "resolve/v0.10.0";
@@ -5,7 +5,7 @@ import type { Tokenizer } from '../tokenizer';
5
5
  /**
6
6
  * Six Viterbi transition biases matching the openai/privacy-filter
7
7
  * `viterbi_calibration.json` schema (hosted at
8
- * https://huggingface.co/software-mansion/react-native-executorch-privacy-filter-openai/blob/main/viterbi_calibration.json).
8
+ * https://huggingface.co/software-mansion/openai-privacy-filter-ExecuTorch/blob/main/viterbi_calibration.json).
9
9
  * Each value is added to the decoder score whenever the corresponding BIOES
10
10
  * transition is taken. Positive values encourage the transition; negative
11
11
  * values discourage it. Every field defaults to `0` (a neutral, validity-only
@@ -1 +1 @@
1
- {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../../src/fetcher/fetcher.ts"],"names":[],"mappings":"AA2BA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA4rBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CA6GtF"}
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../../src/fetcher/fetcher.ts"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA8rBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CA6GtF"}
@@ -0,0 +1,12 @@
1
+ export declare const RENAMED_HF_REPOS: Readonly<Record<string, string>>;
2
+ /**
3
+ * Rewrites a renamed repo's URL to the URL it had before the rename.
4
+ *
5
+ * Cache keys are derived from this form, so a model an older release downloaded
6
+ * from the previous URL is found again after the app upgrades, instead of being
7
+ * downloaded a second time.
8
+ * @param url - Any URL.
9
+ * @returns `url` with a renamed repo swapped for its previous name; any other URL unchanged.
10
+ */
11
+ export declare function previousRepoUrl(url: string): string;
12
+ //# sourceMappingURL=renamedRepos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renamedRepos.d.ts","sourceRoot":"","sources":["../../../../src/fetcher/renamedRepos.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8E7D,CAAC;AAOF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-executorch",
3
- "version": "0.11.0",
3
+ "version": "1.0.0-nightly-cd0e205-20261029",
4
4
  "nativeLibsVersion": "0.11.0",
5
5
  "description": "An easy way to run AI models in React Native with ExecuTorch",
6
6
  "main": "./lib/module/index.js",
@@ -16,7 +16,7 @@ const NEG_INF = Number.NEGATIVE_INFINITY;
16
16
  /**
17
17
  * Six Viterbi transition biases matching the openai/privacy-filter
18
18
  * `viterbi_calibration.json` schema (hosted at
19
- * https://huggingface.co/software-mansion/react-native-executorch-privacy-filter-openai/blob/main/viterbi_calibration.json).
19
+ * https://huggingface.co/software-mansion/openai-privacy-filter-ExecuTorch/blob/main/viterbi_calibration.json).
20
20
  * Each value is added to the decoder score whenever the corresponding BIOES
21
21
  * transition is taken. Positive values encourage the transition; negative
22
22
  * values discourage it. Every field defaults to `0` (a neutral, validity-only
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable no-bitwise */
2
2
  import { Platform } from 'react-native';
3
3
  import RNBlobUtil from 'react-native-blob-util';
4
+ import { previousRepoUrl } from './renamedRepos';
4
5
  import * as telemetry from './telemetry';
5
6
  import {
6
7
  loadBackgroundDownloader,
@@ -60,7 +61,9 @@ function cachePathFor(url: string): string {
60
61
  const urlWithoutQuery = url.split('?')[0]!;
61
62
  const basename = urlWithoutQuery.split('/').pop() || 'model';
62
63
  // Hash guards against basename collisions across different repos/versions.
63
- return `${RNE_DIRECTORY}/${djb2(urlWithoutQuery)}_${basename}`;
64
+ // Renamed repos hash under their previous URL so files cached before the
65
+ // rename stay valid.
66
+ return `${RNE_DIRECTORY}/${djb2(previousRepoUrl(urlWithoutQuery))}_${basename}`;
64
67
  }
65
68
 
66
69
  async function fileSize(path: string): Promise<number> {
@@ -0,0 +1,108 @@
1
+ // Hugging Face repos renamed in October 2026, new name -> previous name.
2
+ //
3
+ // Hugging Face redirects every previous name to the new one, so releases that
4
+ // still use the old URLs keep downloading. Nobody may ever create a repo under a
5
+ // previous name: it would take over that redirect and serve its own files to
6
+ // every app still on the old URL.
7
+ export const RENAMED_HF_REPOS: Readonly<Record<string, string>> = {
8
+ 'all-MiniLM-L6-v2-ExecuTorch': 'react-native-executorch-all-MiniLM-L6-v2',
9
+ 'all-mpnet-base-v2-ExecuTorch': 'react-native-executorch-all-mpnet-base-v2',
10
+ 'Bielik-1.5B-v3.0-Instruct-ExecuTorch': 'react-native-executorch-bielik-v3.0',
11
+ 'bk-sdm-tiny-ExecuTorch': 'react-native-executorch-bk-sdm-tiny',
12
+ 'BlazeFace-ExecuTorch': 'react-native-executorch-blazeface',
13
+ 'clip-vit-base-patch32-ExecuTorch': 'react-native-executorch-clip-vit-base-patch32',
14
+ 'CRAFT-ExecuTorch': 'react-native-executorch-detector-craft',
15
+ 'DeepLabV3-ExecuTorch': 'react-native-executorch-deeplab-v3',
16
+ 'Depth-Anything-3-Small-ExecuTorch': 'react-native-executorch-depth-anything-v3',
17
+ 'Depth-Anything-V2-ExecuTorch': 'react-native-executorch-depth-anything-v2',
18
+ 'distiluse-base-multilingual-cased-v2-ExecuTorch':
19
+ 'react-native-executorch-distiluse-base-multilingual-cased-v2',
20
+ 'EasyOCR-CRNN-ExecuTorch': 'react-native-executorch-recognizer-crnn.en',
21
+ 'EasyOCR-ExecuTorch': 'react-native-executorch-easy-ocr',
22
+ 'EfficientNetV2-S-ExecuTorch': 'react-native-executorch-efficientnet-v2-s',
23
+ 'EuroLLM-1.7B-Instruct-ExecuTorch': 'react-native-executorch-eurollm',
24
+ 'FaceMesh-ExecuTorch': 'react-native-executorch-facemesh',
25
+ 'Fast-Neural-Style-Transfer-Candy-ExecuTorch': 'react-native-executorch-style-transfer-candy',
26
+ 'Fast-Neural-Style-Transfer-Mosaic-ExecuTorch': 'react-native-executorch-style-transfer-mosaic',
27
+ 'Fast-Neural-Style-Transfer-Rain-Princess-ExecuTorch':
28
+ 'react-native-executorch-style-transfer-rain-princess',
29
+ 'Fast-Neural-Style-Transfer-Udnie-ExecuTorch': 'react-native-executorch-style-transfer-udnie',
30
+ 'FastSAM-ExecuTorch': 'react-native-executorch-fast-sam',
31
+ 'FCN-ExecuTorch': 'react-native-executorch-fcn',
32
+ 'fsmn-vad-ExecuTorch': 'react-native-executorch-fsmn-vad',
33
+ 'gemma-4-E2B-it-ExecuTorch': 'react-native-executorch-gemma-4-multimodal',
34
+ 'gemma-4-E2B-it-text-ExecuTorch': 'react-native-executorch-gemma-4',
35
+ 'Hammer2.1-ExecuTorch': 'react-native-executorch-hammer-2.1',
36
+ 'Kokoro-82M-ExecuTorch': 'react-native-executorch-kokoro',
37
+ 'LFM2.5-1.2B-Instruct-ExecuTorch': 'react-native-executorch-lfm2.5-1.2B-instruct',
38
+ 'LFM2.5-350M-ExecuTorch': 'react-native-executorch-lfm2.5-350M',
39
+ 'LFM2.5-ColBERT-350M-ExecuTorch': 'react-native-executorch-lfm2.5-colbert-350m',
40
+ 'LFM2.5-Embedding-350M-ExecuTorch': 'react-native-executorch-lfm2.5-embedding-350m',
41
+ 'LFM2.5-ExecuTorch': 'react-native-executorch-lfm-2.5',
42
+ 'LFM3-ExecuTorch': 'react-native-executorch-lfm-3',
43
+ 'Llama-3.2-ExecuTorch': 'react-native-executorch-llama-3.2',
44
+ 'LRASPP-MobileNetV3-Large-ExecuTorch': 'react-native-executorch-lraspp',
45
+ 'MediaPipe-Selfie-Segmentation-ExecuTorch': 'react-native-executorch-selfie-segmentation',
46
+ 'MI-GAN-ExecuTorch': 'react-native-executorch-migan',
47
+ 'MiniCPM5-2B-ExecuTorch': 'react-native-executorch-minicpm-5',
48
+ 'moonshine-tiny-ExecuTorch': 'react-native-executorch-moonshine-tiny',
49
+ 'multi-qa-MiniLM-L6-cos-v1-ExecuTorch': 'react-native-executorch-multi-qa-MiniLM-L6-cos-v1',
50
+ 'multi-qa-mpnet-base-dot-v1-ExecuTorch': 'react-native-executorch-multi-qa-mpnet-base-dot-v1',
51
+ 'openai-privacy-filter-ExecuTorch': 'react-native-executorch-privacy-filter-openai',
52
+ 'opus-mt-ExecuTorch': 'react-native-executorch-opus-mt',
53
+ 'PaddleOCR-Helpers-ExecuTorch': 'react-native-executorch-paddle-helpers',
54
+ 'paraphrase-multilingual-MiniLM-L12-v2-ExecuTorch':
55
+ 'react-native-executorch-paraphrase-multilingual-MiniLM-L12-v2',
56
+ 'Phi-4-mini-instruct-ExecuTorch': 'react-native-executorch-phi-4-mini',
57
+ 'PP-DocLayoutV3-ExecuTorch': 'react-native-executorch-pp-doclayout-v3',
58
+ 'PP-OCRv6-ExecuTorch': 'react-native-executorch-pp-ocrv6',
59
+ 'privacy-filter-nemotron-ExecuTorch': 'react-native-executorch-privacy-filter-nemotron',
60
+ 'Qwen2.5-ExecuTorch': 'react-native-executorch-qwen-2.5',
61
+ 'Qwen3-ASR-ExecuTorch': 'react-native-executorch-qwen-3-asr',
62
+ 'Qwen3-ExecuTorch': 'react-native-executorch-qwen-3',
63
+ 'Qwen3.5-ExecuTorch': 'react-native-executorch-qwen-3.5',
64
+ 'rf-detr-keypoint-ExecuTorch': 'react-native-executorch-rfdetr-keypoint',
65
+ 'rf-detr-nano-ExecuTorch': 'react-native-executorch-rfdetr-nano-detector',
66
+ 'rf-detr-seg-nano-ExecuTorch': 'react-native-executorch-rfdetr-nano-segmentation',
67
+ 'sdxs-512-dreamshaper-ExecuTorch': 'react-native-executorch-sdxs-512-dreamshaper',
68
+ 'SmolLM2-ExecuTorch': 'react-native-executorch-smolLm-2',
69
+ 'SSDlite320-MobileNetV3-Large-ExecuTorch':
70
+ 'react-native-executorch-ssdlite320-mobilenet-v3-large',
71
+ 'supertonic-ExecuTorch': 'react-native-executorch-supertonic',
72
+ 'whisper-base-ExecuTorch': 'react-native-executorch-whisper-base',
73
+ 'whisper-base.en-ExecuTorch': 'react-native-executorch-whisper-base.en',
74
+ 'whisper-base.en-quantized-ExecuTorch': 'react-native-executorch-whisper-base-quantized.en',
75
+ 'whisper-small-ExecuTorch': 'react-native-executorch-whisper-small',
76
+ 'whisper-small.en-ExecuTorch': 'react-native-executorch-whisper-small.en',
77
+ 'whisper-small.en-quantized-ExecuTorch': 'react-native-executorch-whisper-small-quantized.en',
78
+ 'whisper-tiny-ExecuTorch': 'react-native-executorch-whisper-tiny',
79
+ 'whisper-tiny.en-ExecuTorch': 'react-native-executorch-whisper-tiny.en',
80
+ 'whisper-tiny.en-quantized-ExecuTorch': 'react-native-executorch-whisper-tiny-quantized.en',
81
+ 'YOLO26-ExecuTorch': 'react-native-executorch-yolo26',
82
+ 'YOLO26-pose-ExecuTorch': 'react-native-executorch-yolo26-pose',
83
+ 'YOLO26-seg-ExecuTorch': 'react-native-executorch-yolo26-seg',
84
+ 'ZipDepth-ExecuTorch': 'react-native-executorch-zipdepth',
85
+ };
86
+
87
+ const ORG_PREFIX = 'https://huggingface.co/software-mansion/';
88
+ const PREVIOUS_NAME = new Map(
89
+ Object.entries(RENAMED_HF_REPOS).map(([next, previous]) => [next.toLowerCase(), previous])
90
+ );
91
+
92
+ /**
93
+ * Rewrites a renamed repo's URL to the URL it had before the rename.
94
+ *
95
+ * Cache keys are derived from this form, so a model an older release downloaded
96
+ * from the previous URL is found again after the app upgrades, instead of being
97
+ * downloaded a second time.
98
+ * @param url - Any URL.
99
+ * @returns `url` with a renamed repo swapped for its previous name; any other URL unchanged.
100
+ */
101
+ export function previousRepoUrl(url: string): string {
102
+ if (!url.startsWith(ORG_PREFIX)) return url;
103
+ const rest = url.slice(ORG_PREFIX.length);
104
+ const slash = rest.indexOf('/');
105
+ const repo = slash === -1 ? rest : rest.slice(0, slash);
106
+ const previous = PREVIOUS_NAME.get(repo.toLowerCase());
107
+ return previous ? ORG_PREFIX + previous + rest.slice(repo.length) : url;
108
+ }
@@ -10,7 +10,7 @@ const DOWNLOAD_EVENT_ENDPOINT = 'https://ai.swmansion.com/telemetry/downloads/ap
10
10
  // self-referencing import would need package `exports` support in the consuming
11
11
  // bundler to load at all. A wrong value here is analytics noise; a failed
12
12
  // import would break the bundle.
13
- const LIB_VERSION = '0.11.0';
13
+ const LIB_VERSION = '1.0.0';
14
14
 
15
15
  // Anonymous analytics are on by default; apps opt out via setTelemetryEnabled.
16
16
  let telemetryEnabled = true;