@ohos-ports/sillytavern-transformers 2.17.2-beta.1

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 (59) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +361 -0
  3. package/dist/ort-wasm-simd-threaded.wasm +0 -0
  4. package/dist/ort-wasm-simd.wasm +0 -0
  5. package/dist/ort-wasm-threaded.wasm +0 -0
  6. package/dist/ort-wasm.wasm +0 -0
  7. package/dist/transformers.js +26758 -0
  8. package/dist/transformers.js.map +1 -0
  9. package/dist/transformers.min.js +107 -0
  10. package/dist/transformers.min.js.map +1 -0
  11. package/package.json +85 -0
  12. package/src/backends/onnx.js +50 -0
  13. package/src/configs.js +107 -0
  14. package/src/env.js +128 -0
  15. package/src/models.js +6267 -0
  16. package/src/pipelines.js +3287 -0
  17. package/src/processors.js +2248 -0
  18. package/src/tokenizers.js +4479 -0
  19. package/src/transformers.js +24 -0
  20. package/src/utils/audio.js +672 -0
  21. package/src/utils/core.js +175 -0
  22. package/src/utils/data-structures.js +415 -0
  23. package/src/utils/generation.js +873 -0
  24. package/src/utils/hub.js +658 -0
  25. package/src/utils/image.js +731 -0
  26. package/src/utils/maths.js +985 -0
  27. package/src/utils/tensor.js +1250 -0
  28. package/types/backends/onnx.d.ts +5 -0
  29. package/types/backends/onnx.d.ts.map +1 -0
  30. package/types/configs.d.ts +43 -0
  31. package/types/configs.d.ts.map +1 -0
  32. package/types/env.d.ts +28 -0
  33. package/types/env.d.ts.map +1 -0
  34. package/types/models.d.ts +3661 -0
  35. package/types/models.d.ts.map +1 -0
  36. package/types/pipelines.d.ts +2427 -0
  37. package/types/pipelines.d.ts.map +1 -0
  38. package/types/processors.d.ts +769 -0
  39. package/types/processors.d.ts.map +1 -0
  40. package/types/tokenizers.d.ts +932 -0
  41. package/types/tokenizers.d.ts.map +1 -0
  42. package/types/transformers.d.ts +11 -0
  43. package/types/transformers.d.ts.map +1 -0
  44. package/types/utils/audio.d.ts +121 -0
  45. package/types/utils/audio.d.ts.map +1 -0
  46. package/types/utils/core.d.ts +99 -0
  47. package/types/utils/core.d.ts.map +1 -0
  48. package/types/utils/data-structures.d.ts +224 -0
  49. package/types/utils/data-structures.d.ts.map +1 -0
  50. package/types/utils/generation.d.ts +593 -0
  51. package/types/utils/generation.d.ts.map +1 -0
  52. package/types/utils/hub.d.ts +154 -0
  53. package/types/utils/hub.d.ts.map +1 -0
  54. package/types/utils/image.d.ts +113 -0
  55. package/types/utils/image.d.ts.map +1 -0
  56. package/types/utils/maths.d.ts +280 -0
  57. package/types/utils/maths.d.ts.map +1 -0
  58. package/types/utils/tensor.d.ts +318 -0
  59. package/types/utils/tensor.d.ts.map +1 -0
@@ -0,0 +1,5 @@
1
+ /** @type {import('onnxruntime-web')} The ONNX runtime module. */
2
+ export let ONNX: typeof ONNX_WEB;
3
+ export const executionProviders: string[];
4
+ import * as ONNX_WEB from 'onnxruntime-web';
5
+ //# sourceMappingURL=onnx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onnx.d.ts","sourceRoot":"","sources":["../../src/backends/onnx.js"],"names":[],"mappings":"AAuBA,iEAAiE;AACjE,iCAAgB;AAEhB,0CAGE;0BARwB,iBAAiB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Base class for all configuration classes. For more information, see the corresponding
3
+ * [Python documentation](https://huggingface.co/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig).
4
+ */
5
+ export class PretrainedConfig {
6
+ /**
7
+ * Loads a pre-trained config from the given `pretrained_model_name_or_path`.
8
+ *
9
+ * @param {string} pretrained_model_name_or_path The path to the pre-trained config.
10
+ * @param {PretrainedOptions} options Additional options for loading the config.
11
+ * @throws {Error} Throws an error if the config.json is not found in the `pretrained_model_name_or_path`.
12
+ *
13
+ * @returns {Promise<PretrainedConfig>} A new instance of the `PretrainedConfig` class.
14
+ */
15
+ static from_pretrained(pretrained_model_name_or_path: string, { progress_callback, config, cache_dir, local_files_only, revision, }?: PretrainedOptions): Promise<PretrainedConfig>;
16
+ /**
17
+ * Create a new PreTrainedTokenizer instance.
18
+ * @param {Object} configJSON The JSON of the config.
19
+ */
20
+ constructor(configJSON: any);
21
+ model_type: any;
22
+ is_encoder_decoder: boolean;
23
+ }
24
+ /**
25
+ * Helper class which is used to instantiate pretrained configs with the `from_pretrained` function.
26
+ *
27
+ * @example
28
+ * let config = await AutoConfig.from_pretrained('bert-base-uncased');
29
+ */
30
+ export class AutoConfig {
31
+ /**
32
+ * Loads a pre-trained config from the given `pretrained_model_name_or_path`.
33
+ *
34
+ * @param {string} pretrained_model_name_or_path The path to the pre-trained config.
35
+ * @param {PretrainedOptions} options Additional options for loading the config.
36
+ * @throws {Error} Throws an error if the config.json is not found in the `pretrained_model_name_or_path`.
37
+ *
38
+ * @returns {Promise<PretrainedConfig>} A new instance of the `PretrainedConfig` class.
39
+ */
40
+ static from_pretrained(pretrained_model_name_or_path: string, { progress_callback, config, cache_dir, local_files_only, revision, }?: import("./utils/hub.js").PretrainedOptions): Promise<PretrainedConfig>;
41
+ }
42
+ export type PretrainedOptions = import('./utils/hub.js').PretrainedOptions;
43
+ //# sourceMappingURL=configs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../src/configs.js"],"names":[],"mappings":"AAiDA;;;GAGG;AACH;IAcI;;;;;;;;OAQG;IACH,sDANW,MAAM,0EACN,iBAAiB,GAGf,QAAQ,gBAAgB,CAAC,CAkBrC;IApCD;;;OAGG;IACH,6BAKC;IAJG,gBAAsB;IACtB,4BAA+B;CA+BtC;AAED;;;;;GAKG;AACH;IAlCI;;;;;;;;OAQG;IACH,6MAgBC;CAcJ;gCAxEY,OAAO,gBAAgB,EAAE,iBAAiB"}
package/types/env.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ export namespace env {
2
+ export namespace backends {
3
+ export { onnx_env as onnx };
4
+ export let tfjs: {};
5
+ }
6
+ export { __dirname };
7
+ export { VERSION as version };
8
+ export let allowRemoteModels: boolean;
9
+ export let remoteHost: string;
10
+ export let remotePathTemplate: string;
11
+ export let allowLocalModels: boolean;
12
+ export { localModelPath };
13
+ export { FS_AVAILABLE as useFS };
14
+ export { WEB_CACHE_AVAILABLE as useBrowserCache };
15
+ export { FS_AVAILABLE as useFSCache };
16
+ export { DEFAULT_CACHE_DIR as cacheDir };
17
+ export let useCustomCache: boolean;
18
+ export let customCache: any;
19
+ }
20
+ declare const onnx_env: import("onnxruntime-common").Env;
21
+ declare const __dirname: any;
22
+ declare const VERSION: "2.17.2";
23
+ declare const localModelPath: any;
24
+ declare const FS_AVAILABLE: boolean;
25
+ declare const WEB_CACHE_AVAILABLE: boolean;
26
+ declare const DEFAULT_CACHE_DIR: any;
27
+ export {};
28
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAwCA,6BAEW;AAXX,gCAAyB;AAoBzB,kCAE+B;AAlB/B,oCAAkC;AADlC,2CAA4E;AAW5E,qCAEW"}