@huggingface/transformers 4.0.0-next.0 → 4.0.0-next.10

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 (364) hide show
  1. package/README.md +32 -6
  2. package/dist/ort-wasm-simd-threaded.jsep.mjs +31 -31
  3. package/dist/transformers.js +9261 -1709
  4. package/dist/transformers.min.js +25 -18
  5. package/dist/transformers.node.cjs +6119 -3174
  6. package/dist/transformers.node.min.cjs +25 -23
  7. package/dist/transformers.node.min.mjs +25 -23
  8. package/dist/transformers.node.mjs +6034 -3168
  9. package/dist/transformers.web.js +4255 -1381
  10. package/dist/transformers.web.min.js +23 -19
  11. package/package.json +6 -6
  12. package/src/backends/onnx.js +128 -53
  13. package/src/backends/utils/cacheWasm.js +28 -46
  14. package/src/cache_utils.js +62 -0
  15. package/src/configs.js +123 -23
  16. package/src/env.js +100 -11
  17. package/src/generation/logits_sampler.js +3 -15
  18. package/src/generation/parameters.js +1 -1
  19. package/src/generation/streamers.js +21 -0
  20. package/src/image_processors_utils.js +29 -23
  21. package/src/models/afmoe/modeling_afmoe.js +5 -0
  22. package/src/models/auto/image_processing_auto.js +2 -1
  23. package/src/models/auto/modeling_auto.js +16 -2
  24. package/src/models/auto/tokenization_auto.js +2 -1
  25. package/src/models/chatterbox/modeling_chatterbox.js +1 -1
  26. package/src/models/chmv2/image_processing_chmv2.js +3 -0
  27. package/src/models/chmv2/modeling_chmv2.js +4 -0
  28. package/src/models/clap/feature_extraction_clap.js +2 -1
  29. package/src/models/cohere2/modeling_cohere2.js +5 -0
  30. package/src/models/cohere_asr/feature_extraction_cohere_asr.js +117 -0
  31. package/src/models/cohere_asr/modeling_cohere_asr.js +11 -0
  32. package/src/models/cohere_asr/processing_cohere_asr.js +55 -0
  33. package/src/models/cohere_asr/tokenization_cohere_asr.js +3 -0
  34. package/src/models/deepseek_v3/modeling_deepseek_v3.js +5 -0
  35. package/src/models/detr/image_processing_detr.js +1 -1
  36. package/src/models/eurobert/modeling_eurobert.js +41 -0
  37. package/src/models/feature_extractors.js +3 -0
  38. package/src/models/gemma3/image_processing_gemma3.js +3 -0
  39. package/src/models/gemma3/modeling_gemma3.js +4 -1
  40. package/src/models/gemma3/processing_gemma3.js +45 -0
  41. package/src/models/gemma3n/modeling_gemma3n.js +2 -0
  42. package/src/models/glm46v/image_processing_glm46v.js +12 -0
  43. package/src/models/glm46v/processing_glm46v.js +5 -0
  44. package/src/models/glm_moe_dsa/modeling_glm_moe_dsa.js +5 -0
  45. package/src/models/glm_ocr/modeling_glm_ocr.js +78 -0
  46. package/src/models/granite_speech/feature_extraction_granite_speech.js +58 -0
  47. package/src/models/granite_speech/modeling_granite_speech.js +5 -0
  48. package/src/models/granite_speech/processing_granite_speech.js +62 -0
  49. package/src/models/grounding_dino/image_processing_grounding_dino.js +1 -1
  50. package/src/models/idefics3/modeling_idefics3.js +5 -32
  51. package/src/models/image_processors.js +4 -0
  52. package/src/models/lfm2_vl/image_processing_lfm2_vl.js +305 -0
  53. package/src/models/lfm2_vl/modeling_lfm2_vl.js +13 -0
  54. package/src/models/lfm2_vl/processing_lfm2_vl.js +77 -0
  55. package/src/models/lighton_ocr/modeling_lighton_ocr.js +3 -0
  56. package/src/models/llava/modeling_llava.js +1 -1
  57. package/src/models/marian/tokenization_marian.js +3 -2
  58. package/src/models/mistral3/modeling_mistral3.js +2 -2
  59. package/src/models/mistral4/modeling_mistral4.js +5 -0
  60. package/src/models/modeling_utils.js +283 -300
  61. package/src/models/models.js +26 -1
  62. package/src/models/nemotron_h/modeling_nemotron_h.js +5 -0
  63. package/src/models/olmo_hybrid/modeling_olmo_hybrid.js +5 -0
  64. package/src/models/paligemma/modeling_paligemma.js +2 -25
  65. package/src/models/paligemma/processing_paligemma.js +3 -2
  66. package/src/models/processors.js +8 -0
  67. package/src/models/qwen2_5_vl/modeling_qwen2_5_vl.js +9 -0
  68. package/src/models/qwen2_5_vl/processing_qwen2_5_vl.js +3 -0
  69. package/src/models/qwen2_moe/modeling_qwen2_moe.js +5 -0
  70. package/src/models/qwen2_vl/image_processing_qwen2_vl.js +15 -1
  71. package/src/models/qwen2_vl/modeling_qwen2_vl.js +240 -143
  72. package/src/models/qwen2_vl/processing_qwen2_vl.js +5 -4
  73. package/src/models/qwen3_5/modeling_qwen3_5.js +4 -0
  74. package/src/models/qwen3_5_moe/modeling_qwen3_5_moe.js +4 -0
  75. package/src/models/qwen3_moe/modeling_qwen3_moe.js +5 -0
  76. package/src/models/qwen3_next/modeling_qwen3_next.js +5 -0
  77. package/src/models/qwen3_vl/modeling_qwen3_vl.js +4 -0
  78. package/src/models/qwen3_vl/processing_qwen3_vl.js +3 -0
  79. package/src/models/qwen3_vl_moe/modeling_qwen3_vl_moe.js +4 -0
  80. package/src/models/registry.js +61 -5
  81. package/src/models/sam/image_processing_sam.js +1 -1
  82. package/src/models/session.js +33 -56
  83. package/src/models/smolvlm/modeling_smolvlm.js +7 -0
  84. package/src/models/solar_open/modeling_solar_open.js +5 -0
  85. package/src/models/tokenizers.js +1 -0
  86. package/src/models/ultravox/modeling_ultravox.js +1 -3
  87. package/src/models/voxtral/modeling_voxtral.js +3 -0
  88. package/src/models/voxtral_realtime/feature_extraction_voxtral_realtime.js +71 -0
  89. package/src/models/voxtral_realtime/modeling_voxtral_realtime.js +239 -0
  90. package/src/models/voxtral_realtime/processing_voxtral_realtime.js +113 -0
  91. package/src/models/whisper/feature_extraction_whisper.js +4 -13
  92. package/src/models/whisper/modeling_whisper.js +6 -5
  93. package/src/models/xlm/tokenization_xlm.js +2 -1
  94. package/src/pipelines/automatic-speech-recognition.js +47 -3
  95. package/src/pipelines/document-question-answering.js +1 -1
  96. package/src/pipelines/image-to-text.js +2 -2
  97. package/src/pipelines/index.js +313 -0
  98. package/src/pipelines/summarization.js +1 -1
  99. package/src/pipelines/text-generation.js +5 -1
  100. package/src/pipelines/text-to-audio.js +4 -2
  101. package/src/pipelines/text2text-generation.js +1 -1
  102. package/src/pipelines/translation.js +1 -1
  103. package/src/pipelines/zero-shot-classification.js +3 -2
  104. package/src/pipelines.js +140 -428
  105. package/src/tokenization_utils.js +42 -21
  106. package/src/transformers.js +10 -1
  107. package/src/utils/audio.js +20 -3
  108. package/src/utils/cache/CrossOriginStorageCache.js +251 -0
  109. package/src/utils/cache/FileCache.js +128 -0
  110. package/src/utils/cache/cross-origin-storage.d.ts +38 -0
  111. package/src/utils/cache.js +12 -4
  112. package/src/utils/core.js +23 -1
  113. package/src/utils/devices.js +22 -0
  114. package/src/utils/dtypes.js +55 -0
  115. package/src/utils/hub/{files.js → FileResponse.js} +0 -90
  116. package/src/utils/hub/utils.js +45 -5
  117. package/src/utils/hub.js +67 -23
  118. package/src/utils/image.js +14 -14
  119. package/src/utils/logger.js +67 -0
  120. package/src/utils/lru_cache.js +67 -0
  121. package/src/utils/memoize_promise.js +45 -0
  122. package/src/utils/model-loader.js +35 -17
  123. package/src/utils/model_registry/ModelRegistry.js +382 -0
  124. package/src/utils/model_registry/clear_cache.js +128 -0
  125. package/src/utils/model_registry/get_available_dtypes.js +68 -0
  126. package/src/utils/model_registry/get_file_metadata.js +162 -0
  127. package/src/utils/model_registry/get_files.js +42 -0
  128. package/src/utils/model_registry/get_model_files.js +114 -0
  129. package/src/utils/model_registry/get_pipeline_files.js +44 -0
  130. package/src/utils/model_registry/get_processor_files.js +20 -0
  131. package/src/utils/model_registry/get_tokenizer_files.js +21 -0
  132. package/src/utils/model_registry/is_cached.js +169 -0
  133. package/src/utils/model_registry/resolve_model_type.js +66 -0
  134. package/src/utils/random.js +225 -0
  135. package/src/utils/tensor.js +26 -23
  136. package/src/utils/video.js +2 -2
  137. package/types/backends/onnx.d.ts.map +1 -1
  138. package/types/backends/utils/cacheWasm.d.ts +3 -17
  139. package/types/backends/utils/cacheWasm.d.ts.map +1 -1
  140. package/types/cache_utils.d.ts +29 -0
  141. package/types/cache_utils.d.ts.map +1 -0
  142. package/types/configs.d.ts.map +1 -1
  143. package/types/env.d.ts +60 -27
  144. package/types/env.d.ts.map +1 -1
  145. package/types/generation/logits_sampler.d.ts +2 -2
  146. package/types/generation/logits_sampler.d.ts.map +1 -1
  147. package/types/generation/parameters.d.ts +1 -1
  148. package/types/generation/parameters.d.ts.map +1 -1
  149. package/types/generation/streamers.d.ts +1 -0
  150. package/types/generation/streamers.d.ts.map +1 -1
  151. package/types/image_processors_utils.d.ts +18 -1
  152. package/types/image_processors_utils.d.ts.map +1 -1
  153. package/types/models/afmoe/modeling_afmoe.d.ts +8 -0
  154. package/types/models/afmoe/modeling_afmoe.d.ts.map +1 -0
  155. package/types/models/{ast/modeling_ast.d.ts → audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.d.ts} +1 -1
  156. package/types/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.d.ts.map +1 -0
  157. package/types/models/auto/image_processing_auto.d.ts.map +1 -1
  158. package/types/models/auto/modeling_auto.d.ts +6 -0
  159. package/types/models/auto/modeling_auto.d.ts.map +1 -1
  160. package/types/models/auto/tokenization_auto.d.ts.map +1 -1
  161. package/types/models/chmv2/image_processing_chmv2.d.ts +4 -0
  162. package/types/models/chmv2/image_processing_chmv2.d.ts.map +1 -0
  163. package/types/models/chmv2/modeling_chmv2.d.ts +6 -0
  164. package/types/models/chmv2/modeling_chmv2.d.ts.map +1 -0
  165. package/types/models/clap/feature_extraction_clap.d.ts.map +1 -1
  166. package/types/models/cohere2/modeling_cohere2.d.ts +8 -0
  167. package/types/models/cohere2/modeling_cohere2.d.ts.map +1 -0
  168. package/types/models/cohere_asr/feature_extraction_cohere_asr.d.ts +25 -0
  169. package/types/models/cohere_asr/feature_extraction_cohere_asr.d.ts.map +1 -0
  170. package/types/models/cohere_asr/modeling_cohere_asr.d.ts +9 -0
  171. package/types/models/cohere_asr/modeling_cohere_asr.d.ts.map +1 -0
  172. package/types/models/cohere_asr/processing_cohere_asr.d.ts +27 -0
  173. package/types/models/cohere_asr/processing_cohere_asr.d.ts.map +1 -0
  174. package/types/models/cohere_asr/tokenization_cohere_asr.d.ts +4 -0
  175. package/types/models/cohere_asr/tokenization_cohere_asr.d.ts.map +1 -0
  176. package/types/models/deepseek_v3/modeling_deepseek_v3.d.ts +8 -0
  177. package/types/models/deepseek_v3/modeling_deepseek_v3.d.ts.map +1 -0
  178. package/types/models/detr/image_processing_detr.d.ts +1 -1
  179. package/types/models/eurobert/modeling_eurobert.d.ts +36 -0
  180. package/types/models/eurobert/modeling_eurobert.d.ts.map +1 -0
  181. package/types/models/feature_extractors.d.ts +3 -0
  182. package/types/models/gemma3/image_processing_gemma3.d.ts +4 -0
  183. package/types/models/gemma3/image_processing_gemma3.d.ts.map +1 -0
  184. package/types/models/gemma3/modeling_gemma3.d.ts +4 -1
  185. package/types/models/gemma3/modeling_gemma3.d.ts.map +1 -1
  186. package/types/models/gemma3/processing_gemma3.d.ts +20 -0
  187. package/types/models/gemma3/processing_gemma3.d.ts.map +1 -0
  188. package/types/models/gemma3n/modeling_gemma3n.d.ts +2 -0
  189. package/types/models/gemma3n/modeling_gemma3n.d.ts.map +1 -1
  190. package/types/models/glm46v/image_processing_glm46v.d.ts +4 -0
  191. package/types/models/glm46v/image_processing_glm46v.d.ts.map +1 -0
  192. package/types/models/glm46v/processing_glm46v.d.ts +4 -0
  193. package/types/models/glm46v/processing_glm46v.d.ts.map +1 -0
  194. package/types/models/glm_moe_dsa/modeling_glm_moe_dsa.d.ts +8 -0
  195. package/types/models/glm_moe_dsa/modeling_glm_moe_dsa.d.ts.map +1 -0
  196. package/types/models/glm_ocr/modeling_glm_ocr.d.ts +26 -0
  197. package/types/models/glm_ocr/modeling_glm_ocr.d.ts.map +1 -0
  198. package/types/models/granite_speech/feature_extraction_granite_speech.d.ts +16 -0
  199. package/types/models/granite_speech/feature_extraction_granite_speech.d.ts.map +1 -0
  200. package/types/models/granite_speech/modeling_granite_speech.d.ts +4 -0
  201. package/types/models/granite_speech/modeling_granite_speech.d.ts.map +1 -0
  202. package/types/models/granite_speech/processing_granite_speech.d.ts +19 -0
  203. package/types/models/granite_speech/processing_granite_speech.d.ts.map +1 -0
  204. package/types/models/grounding_dino/image_processing_grounding_dino.d.ts +1 -1
  205. package/types/models/idefics3/modeling_idefics3.d.ts +2 -18
  206. package/types/models/idefics3/modeling_idefics3.d.ts.map +1 -1
  207. package/types/models/image_processors.d.ts +4 -0
  208. package/types/models/lfm2_vl/image_processing_lfm2_vl.d.ts +41 -0
  209. package/types/models/lfm2_vl/image_processing_lfm2_vl.d.ts.map +1 -0
  210. package/types/models/lfm2_vl/modeling_lfm2_vl.d.ts +4 -0
  211. package/types/models/lfm2_vl/modeling_lfm2_vl.d.ts.map +1 -0
  212. package/types/models/lfm2_vl/processing_lfm2_vl.d.ts +18 -0
  213. package/types/models/lfm2_vl/processing_lfm2_vl.d.ts.map +1 -0
  214. package/types/models/lighton_ocr/modeling_lighton_ocr.d.ts +4 -0
  215. package/types/models/lighton_ocr/modeling_lighton_ocr.d.ts.map +1 -0
  216. package/types/models/marian/tokenization_marian.d.ts.map +1 -1
  217. package/types/models/mistral3/modeling_mistral3.d.ts +2 -2
  218. package/types/models/mistral3/modeling_mistral3.d.ts.map +1 -1
  219. package/types/models/mistral4/modeling_mistral4.d.ts +8 -0
  220. package/types/models/mistral4/modeling_mistral4.d.ts.map +1 -0
  221. package/types/models/modeling_utils.d.ts +46 -27
  222. package/types/models/modeling_utils.d.ts.map +1 -1
  223. package/types/models/models.d.ts +26 -1
  224. package/types/models/nemotron_h/modeling_nemotron_h.d.ts +8 -0
  225. package/types/models/nemotron_h/modeling_nemotron_h.d.ts.map +1 -0
  226. package/types/models/olmo_hybrid/modeling_olmo_hybrid.d.ts +8 -0
  227. package/types/models/olmo_hybrid/modeling_olmo_hybrid.d.ts.map +1 -0
  228. package/types/models/paligemma/modeling_paligemma.d.ts +2 -8
  229. package/types/models/paligemma/modeling_paligemma.d.ts.map +1 -1
  230. package/types/models/paligemma/processing_paligemma.d.ts.map +1 -1
  231. package/types/models/processors.d.ts +8 -0
  232. package/types/models/qwen2_5_vl/modeling_qwen2_5_vl.d.ts +7 -0
  233. package/types/models/qwen2_5_vl/modeling_qwen2_5_vl.d.ts.map +1 -0
  234. package/types/models/qwen2_5_vl/processing_qwen2_5_vl.d.ts +4 -0
  235. package/types/models/qwen2_5_vl/processing_qwen2_5_vl.d.ts.map +1 -0
  236. package/types/models/qwen2_moe/modeling_qwen2_moe.d.ts +8 -0
  237. package/types/models/qwen2_moe/modeling_qwen2_moe.d.ts.map +1 -0
  238. package/types/models/qwen2_vl/image_processing_qwen2_vl.d.ts +3 -0
  239. package/types/models/qwen2_vl/image_processing_qwen2_vl.d.ts.map +1 -1
  240. package/types/models/qwen2_vl/modeling_qwen2_vl.d.ts +44 -6
  241. package/types/models/qwen2_vl/modeling_qwen2_vl.d.ts.map +1 -1
  242. package/types/models/qwen2_vl/processing_qwen2_vl.d.ts +1 -0
  243. package/types/models/qwen2_vl/processing_qwen2_vl.d.ts.map +1 -1
  244. package/types/models/qwen3_5/modeling_qwen3_5.d.ts +6 -0
  245. package/types/models/qwen3_5/modeling_qwen3_5.d.ts.map +1 -0
  246. package/types/models/qwen3_5_moe/modeling_qwen3_5_moe.d.ts +7 -0
  247. package/types/models/qwen3_5_moe/modeling_qwen3_5_moe.d.ts.map +1 -0
  248. package/types/models/qwen3_moe/modeling_qwen3_moe.d.ts +8 -0
  249. package/types/models/qwen3_moe/modeling_qwen3_moe.d.ts.map +1 -0
  250. package/types/models/qwen3_next/modeling_qwen3_next.d.ts +8 -0
  251. package/types/models/qwen3_next/modeling_qwen3_next.d.ts.map +1 -0
  252. package/types/models/qwen3_vl/modeling_qwen3_vl.d.ts +7 -0
  253. package/types/models/qwen3_vl/modeling_qwen3_vl.d.ts.map +1 -0
  254. package/types/models/qwen3_vl/processing_qwen3_vl.d.ts +4 -0
  255. package/types/models/qwen3_vl/processing_qwen3_vl.d.ts.map +1 -0
  256. package/types/models/qwen3_vl_moe/modeling_qwen3_vl_moe.d.ts +7 -0
  257. package/types/models/qwen3_vl_moe/modeling_qwen3_vl_moe.d.ts.map +1 -0
  258. package/types/models/registry.d.ts +2 -1
  259. package/types/models/registry.d.ts.map +1 -1
  260. package/types/models/sam/image_processing_sam.d.ts +1 -1
  261. package/types/models/session.d.ts +3 -2
  262. package/types/models/session.d.ts.map +1 -1
  263. package/types/models/smolvlm/modeling_smolvlm.d.ts +8 -0
  264. package/types/models/smolvlm/modeling_smolvlm.d.ts.map +1 -0
  265. package/types/models/solar_open/modeling_solar_open.d.ts +8 -0
  266. package/types/models/solar_open/modeling_solar_open.d.ts.map +1 -0
  267. package/types/models/tokenizers.d.ts +1 -0
  268. package/types/models/ultravox/modeling_ultravox.d.ts +0 -2
  269. package/types/models/ultravox/modeling_ultravox.d.ts.map +1 -1
  270. package/types/models/voxtral/modeling_voxtral.d.ts +4 -0
  271. package/types/models/voxtral/modeling_voxtral.d.ts.map +1 -0
  272. package/types/models/voxtral_realtime/feature_extraction_voxtral_realtime.d.ts +28 -0
  273. package/types/models/voxtral_realtime/feature_extraction_voxtral_realtime.d.ts.map +1 -0
  274. package/types/models/voxtral_realtime/modeling_voxtral_realtime.d.ts +17 -0
  275. package/types/models/voxtral_realtime/modeling_voxtral_realtime.d.ts.map +1 -0
  276. package/types/models/voxtral_realtime/processing_voxtral_realtime.d.ts +44 -0
  277. package/types/models/voxtral_realtime/processing_voxtral_realtime.d.ts.map +1 -0
  278. package/types/models/whisper/feature_extraction_whisper.d.ts.map +1 -1
  279. package/types/models/whisper/modeling_whisper.d.ts.map +1 -1
  280. package/types/models/xlm/tokenization_xlm.d.ts.map +1 -1
  281. package/types/pipelines/automatic-speech-recognition.d.ts +7 -2
  282. package/types/pipelines/automatic-speech-recognition.d.ts.map +1 -1
  283. package/types/pipelines/document-question-answering.d.ts +2 -2
  284. package/types/pipelines/document-question-answering.d.ts.map +1 -1
  285. package/types/pipelines/image-to-text.d.ts +4 -4
  286. package/types/pipelines/image-to-text.d.ts.map +1 -1
  287. package/types/pipelines/index.d.ts +265 -0
  288. package/types/pipelines/index.d.ts.map +1 -0
  289. package/types/pipelines/summarization.d.ts +2 -2
  290. package/types/pipelines/summarization.d.ts.map +1 -1
  291. package/types/pipelines/text-generation.d.ts +7 -3
  292. package/types/pipelines/text-generation.d.ts.map +1 -1
  293. package/types/pipelines/text-to-audio.d.ts.map +1 -1
  294. package/types/pipelines/text2text-generation.d.ts +3 -3
  295. package/types/pipelines/text2text-generation.d.ts.map +1 -1
  296. package/types/pipelines/translation.d.ts +2 -2
  297. package/types/pipelines/translation.d.ts.map +1 -1
  298. package/types/pipelines/zero-shot-classification.d.ts.map +1 -1
  299. package/types/pipelines.d.ts +51 -291
  300. package/types/pipelines.d.ts.map +1 -1
  301. package/types/tokenization_utils.d.ts +44 -26
  302. package/types/tokenization_utils.d.ts.map +1 -1
  303. package/types/transformers.d.ts +7 -1
  304. package/types/transformers.d.ts.map +1 -1
  305. package/types/utils/audio.d.ts +5 -2
  306. package/types/utils/audio.d.ts.map +1 -1
  307. package/types/utils/cache/CrossOriginStorageCache.d.ts +120 -0
  308. package/types/utils/cache/CrossOriginStorageCache.d.ts.map +1 -0
  309. package/types/utils/cache/FileCache.d.ts +39 -0
  310. package/types/utils/cache/FileCache.d.ts.map +1 -0
  311. package/types/utils/cache.d.ts +10 -4
  312. package/types/utils/cache.d.ts.map +1 -1
  313. package/types/utils/core.d.ts +59 -2
  314. package/types/utils/core.d.ts.map +1 -1
  315. package/types/utils/devices.d.ts +15 -0
  316. package/types/utils/devices.d.ts.map +1 -1
  317. package/types/utils/dtypes.d.ts +17 -1
  318. package/types/utils/dtypes.d.ts.map +1 -1
  319. package/types/utils/hub/{files.d.ts → FileResponse.d.ts} +1 -32
  320. package/types/utils/hub/FileResponse.d.ts.map +1 -0
  321. package/types/utils/hub/utils.d.ts +19 -3
  322. package/types/utils/hub/utils.d.ts.map +1 -1
  323. package/types/utils/hub.d.ts +36 -7
  324. package/types/utils/hub.d.ts.map +1 -1
  325. package/types/utils/image.d.ts +1 -1
  326. package/types/utils/logger.d.ts +28 -0
  327. package/types/utils/logger.d.ts.map +1 -0
  328. package/types/utils/lru_cache.d.ts +38 -0
  329. package/types/utils/lru_cache.d.ts.map +1 -0
  330. package/types/utils/memoize_promise.d.ts +14 -0
  331. package/types/utils/memoize_promise.d.ts.map +1 -0
  332. package/types/utils/model-loader.d.ts +15 -0
  333. package/types/utils/model-loader.d.ts.map +1 -1
  334. package/types/utils/model_registry/ModelRegistry.d.ts +298 -0
  335. package/types/utils/model_registry/ModelRegistry.d.ts.map +1 -0
  336. package/types/utils/model_registry/clear_cache.d.ts +74 -0
  337. package/types/utils/model_registry/clear_cache.d.ts.map +1 -0
  338. package/types/utils/model_registry/get_available_dtypes.d.ts +26 -0
  339. package/types/utils/model_registry/get_available_dtypes.d.ts.map +1 -0
  340. package/types/utils/model_registry/get_file_metadata.d.ts +20 -0
  341. package/types/utils/model_registry/get_file_metadata.d.ts.map +1 -0
  342. package/types/utils/model_registry/get_files.d.ts +23 -0
  343. package/types/utils/model_registry/get_files.d.ts.map +1 -0
  344. package/types/utils/model_registry/get_model_files.d.ts +48 -0
  345. package/types/utils/model_registry/get_model_files.d.ts.map +1 -0
  346. package/types/utils/model_registry/get_pipeline_files.d.ts +22 -0
  347. package/types/utils/model_registry/get_pipeline_files.d.ts.map +1 -0
  348. package/types/utils/model_registry/get_processor_files.d.ts +9 -0
  349. package/types/utils/model_registry/get_processor_files.d.ts.map +1 -0
  350. package/types/utils/model_registry/get_tokenizer_files.d.ts +9 -0
  351. package/types/utils/model_registry/get_tokenizer_files.d.ts.map +1 -0
  352. package/types/utils/model_registry/is_cached.d.ts +105 -0
  353. package/types/utils/model_registry/is_cached.d.ts.map +1 -0
  354. package/types/utils/model_registry/resolve_model_type.d.ts +24 -0
  355. package/types/utils/model_registry/resolve_model_type.d.ts.map +1 -0
  356. package/types/utils/random.d.ts +86 -0
  357. package/types/utils/random.d.ts.map +1 -0
  358. package/types/utils/tensor.d.ts.map +1 -1
  359. package/src/utils/data-structures.js +0 -572
  360. package/types/models/ast/modeling_ast.d.ts.map +0 -1
  361. package/types/utils/data-structures.d.ts +0 -294
  362. package/types/utils/data-structures.d.ts.map +0 -1
  363. package/types/utils/hub/files.d.ts.map +0 -1
  364. /package/src/models/{ast/modeling_ast.js → audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.js} +0 -0
@@ -11,12 +11,12 @@ declare const ImageToTextPipeline_base: new (options: TextImagePipelineConstruct
11
11
  *
12
12
  * @callback ImageToTextPipelineCallbackSingle Assign labels to the image passed as input.
13
13
  * @param {ImageInput} texts The image to be captioned.
14
- * @param {Partial<import('../generation/configuration_utils.js').GenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.
14
+ * @param {Partial<import('../generation/parameters.js').GenerationFunctionParameters>} [options] Additional keyword arguments to pass along to the generate method of the model.
15
15
  * @returns {Promise<ImageToTextOutput>} An object containing the generated text(s).
16
16
  *
17
17
  * @callback ImageToTextPipelineCallbackBatch Assign labels to the images passed as inputs.
18
18
  * @param {ImageInput[]} texts The images to be captioned.
19
- * @param {Partial<import('../generation/configuration_utils.js').GenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.
19
+ * @param {Partial<import('../generation/parameters.js').GenerationFunctionParameters>} [options] Additional keyword arguments to pass along to the generate method of the model.
20
20
  * @returns {Promise<ImageToTextOutput[]>} An array containing the generated text(s) for each image.
21
21
  *
22
22
  * @typedef {ImageToTextPipelineCallbackSingle & ImageToTextPipelineCallbackBatch} ImageToTextPipelineCallback
@@ -66,11 +66,11 @@ export type ImageToTextOutput = ImageToTextSingle[];
66
66
  /**
67
67
  * Assign labels to the image passed as input.
68
68
  */
69
- export type ImageToTextPipelineCallbackSingle = (texts: ImageInput, options?: Partial<import("../generation/configuration_utils.js").GenerationConfig>) => Promise<ImageToTextOutput>;
69
+ export type ImageToTextPipelineCallbackSingle = (texts: ImageInput, options?: Partial<import("../generation/parameters.js").GenerationFunctionParameters>) => Promise<ImageToTextOutput>;
70
70
  /**
71
71
  * Assign labels to the images passed as inputs.
72
72
  */
73
- export type ImageToTextPipelineCallbackBatch = (texts: ImageInput[], options?: Partial<import("../generation/configuration_utils.js").GenerationConfig>) => Promise<ImageToTextOutput[]>;
73
+ export type ImageToTextPipelineCallbackBatch = (texts: ImageInput[], options?: Partial<import("../generation/parameters.js").GenerationFunctionParameters>) => Promise<ImageToTextOutput[]>;
74
74
  export type ImageToTextPipelineCallback = ImageToTextPipelineCallbackSingle & ImageToTextPipelineCallbackBatch;
75
75
  export type ImageToTextPipelineType = TextImagePipelineConstructorArgs & ImageToTextPipelineCallback & Disposable;
76
76
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"image-to-text.d.ts","sourceRoot":"","sources":["../../src/pipelines/image-to-text.js"],"names":[],"mappings":"sDAsDqC,gCAAgC,KAAK,uBAAuB;AAlDjG;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAGI;;;;WAmBC;CACJ;+CAvEY,OAAO,YAAY,EAAE,gCAAgC;yBACrD,OAAO,YAAY,EAAE,UAAU;yBAC/B,OAAO,YAAY,EAAE,UAAU;;;;;oBAK9B,MAAM;;gCACP,iBAAiB,EAAE;;;;wDAGrB,UAAU,YACV,OAAO,CAAC,OAAO,sCAAsC,EAAE,gBAAgB,CAAC,KACtE,OAAO,CAAC,iBAAiB,CAAC;;;;uDAG5B,UAAU,EAAE,YACZ,OAAO,CAAC,OAAO,sCAAsC,EAAE,gBAAgB,CAAC,KACtE,OAAO,CAAC,iBAAiB,EAAE,CAAC;0CAE5B,iCAAiC,GAAG,gCAAgC;sCAEpE,gCAAgC,GAAG,2BAA2B,GAAG,UAAU"}
1
+ {"version":3,"file":"image-to-text.d.ts","sourceRoot":"","sources":["../../src/pipelines/image-to-text.js"],"names":[],"mappings":"sDAsDqC,gCAAgC,KAAK,uBAAuB;AAlDjG;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAGI;;;;WAmBC;CACJ;+CAvEY,OAAO,YAAY,EAAE,gCAAgC;yBACrD,OAAO,YAAY,EAAE,UAAU;yBAC/B,OAAO,YAAY,EAAE,UAAU;;;;;oBAK9B,MAAM;;gCACP,iBAAiB,EAAE;;;;wDAGrB,UAAU,YACV,OAAO,CAAC,OAAO,6BAA6B,EAAE,4BAA4B,CAAC,KACzE,OAAO,CAAC,iBAAiB,CAAC;;;;uDAG5B,UAAU,EAAE,YACZ,OAAO,CAAC,OAAO,6BAA6B,EAAE,4BAA4B,CAAC,KACzE,OAAO,CAAC,iBAAiB,EAAE,CAAC;0CAE5B,iCAAiC,GAAG,gCAAgC;sCAEpE,gCAAgC,GAAG,2BAA2B,GAAG,UAAU"}
@@ -0,0 +1,265 @@
1
+ export const SUPPORTED_TASKS: Readonly<{
2
+ 'text-classification': {
3
+ pipeline: typeof TextClassificationPipeline;
4
+ model: typeof AutoModelForSequenceClassification;
5
+ default: {
6
+ model: string;
7
+ };
8
+ type: string;
9
+ };
10
+ 'token-classification': {
11
+ pipeline: typeof TokenClassificationPipeline;
12
+ model: typeof AutoModelForTokenClassification;
13
+ default: {
14
+ model: string;
15
+ };
16
+ type: string;
17
+ };
18
+ 'question-answering': {
19
+ pipeline: typeof QuestionAnsweringPipeline;
20
+ model: typeof AutoModelForQuestionAnswering;
21
+ default: {
22
+ model: string;
23
+ };
24
+ type: string;
25
+ };
26
+ 'fill-mask': {
27
+ pipeline: typeof FillMaskPipeline;
28
+ model: typeof AutoModelForMaskedLM;
29
+ default: {
30
+ model: string;
31
+ dtype: string;
32
+ };
33
+ type: string;
34
+ };
35
+ summarization: {
36
+ pipeline: typeof SummarizationPipeline;
37
+ model: typeof AutoModelForSeq2SeqLM;
38
+ default: {
39
+ model: string;
40
+ };
41
+ type: string;
42
+ };
43
+ translation: {
44
+ pipeline: typeof TranslationPipeline;
45
+ model: typeof AutoModelForSeq2SeqLM;
46
+ default: {
47
+ model: string;
48
+ };
49
+ type: string;
50
+ };
51
+ 'text2text-generation': {
52
+ pipeline: typeof Text2TextGenerationPipeline;
53
+ model: typeof AutoModelForSeq2SeqLM;
54
+ default: {
55
+ model: string;
56
+ };
57
+ type: string;
58
+ };
59
+ 'text-generation': {
60
+ pipeline: typeof TextGenerationPipeline;
61
+ model: typeof AutoModelForCausalLM;
62
+ default: {
63
+ model: string;
64
+ dtype: string;
65
+ };
66
+ type: string;
67
+ };
68
+ 'zero-shot-classification': {
69
+ pipeline: typeof ZeroShotClassificationPipeline;
70
+ model: typeof AutoModelForSequenceClassification;
71
+ default: {
72
+ model: string;
73
+ };
74
+ type: string;
75
+ };
76
+ 'audio-classification': {
77
+ pipeline: typeof AudioClassificationPipeline;
78
+ model: typeof AutoModelForAudioClassification;
79
+ default: {
80
+ model: string;
81
+ };
82
+ type: string;
83
+ };
84
+ 'zero-shot-audio-classification': {
85
+ pipeline: typeof ZeroShotAudioClassificationPipeline;
86
+ model: typeof AutoModel;
87
+ default: {
88
+ model: string;
89
+ };
90
+ type: string;
91
+ };
92
+ 'automatic-speech-recognition': {
93
+ pipeline: typeof AutomaticSpeechRecognitionPipeline;
94
+ model: (typeof AutoModelForSpeechSeq2Seq)[];
95
+ default: {
96
+ model: string;
97
+ };
98
+ type: string;
99
+ };
100
+ 'text-to-audio': {
101
+ pipeline: typeof TextToAudioPipeline;
102
+ model: (typeof AutoModelForTextToSpectrogram)[];
103
+ default: {
104
+ model: string;
105
+ dtype: string;
106
+ };
107
+ type: string;
108
+ };
109
+ 'image-to-text': {
110
+ pipeline: typeof ImageToTextPipeline;
111
+ model: typeof AutoModelForVision2Seq;
112
+ default: {
113
+ model: string;
114
+ };
115
+ type: string;
116
+ };
117
+ 'image-classification': {
118
+ pipeline: typeof ImageClassificationPipeline;
119
+ model: typeof AutoModelForImageClassification;
120
+ default: {
121
+ model: string;
122
+ };
123
+ type: string;
124
+ };
125
+ 'image-segmentation': {
126
+ pipeline: typeof ImageSegmentationPipeline;
127
+ model: (typeof AutoModelForImageSegmentation)[];
128
+ default: {
129
+ model: string;
130
+ };
131
+ type: string;
132
+ };
133
+ 'background-removal': {
134
+ pipeline: typeof BackgroundRemovalPipeline;
135
+ model: (typeof AutoModelForImageSegmentation)[];
136
+ default: {
137
+ model: string;
138
+ };
139
+ type: string;
140
+ };
141
+ 'zero-shot-image-classification': {
142
+ pipeline: typeof ZeroShotImageClassificationPipeline;
143
+ model: typeof AutoModel;
144
+ default: {
145
+ model: string;
146
+ };
147
+ type: string;
148
+ };
149
+ 'object-detection': {
150
+ pipeline: typeof ObjectDetectionPipeline;
151
+ model: typeof AutoModelForObjectDetection;
152
+ default: {
153
+ model: string;
154
+ };
155
+ type: string;
156
+ };
157
+ 'zero-shot-object-detection': {
158
+ pipeline: typeof ZeroShotObjectDetectionPipeline;
159
+ model: typeof AutoModelForZeroShotObjectDetection;
160
+ default: {
161
+ model: string;
162
+ };
163
+ type: string;
164
+ };
165
+ 'document-question-answering': {
166
+ pipeline: typeof DocumentQuestionAnsweringPipeline;
167
+ model: typeof AutoModelForDocumentQuestionAnswering;
168
+ default: {
169
+ model: string;
170
+ };
171
+ type: string;
172
+ };
173
+ 'image-to-image': {
174
+ pipeline: typeof ImageToImagePipeline;
175
+ model: typeof AutoModelForImageToImage;
176
+ default: {
177
+ model: string;
178
+ };
179
+ type: string;
180
+ };
181
+ 'depth-estimation': {
182
+ pipeline: typeof DepthEstimationPipeline;
183
+ model: typeof AutoModelForDepthEstimation;
184
+ default: {
185
+ model: string;
186
+ };
187
+ type: string;
188
+ };
189
+ 'feature-extraction': {
190
+ pipeline: typeof FeatureExtractionPipeline;
191
+ model: typeof AutoModel;
192
+ default: {
193
+ model: string;
194
+ dtype: string;
195
+ };
196
+ type: string;
197
+ };
198
+ 'image-feature-extraction': {
199
+ pipeline: typeof ImageFeatureExtractionPipeline;
200
+ model: (typeof AutoModel)[];
201
+ default: {
202
+ model: string;
203
+ dtype: string;
204
+ };
205
+ type: string;
206
+ };
207
+ }>;
208
+ export const TASK_ALIASES: Readonly<{
209
+ 'sentiment-analysis': "text-classification";
210
+ ner: "token-classification";
211
+ asr: "automatic-speech-recognition";
212
+ 'text-to-speech': "text-to-audio";
213
+ embeddings: "feature-extraction";
214
+ }>;
215
+ export type TaskType = keyof typeof SUPPORTED_TASKS;
216
+ export type AliasType = keyof typeof TASK_ALIASES;
217
+ /**
218
+ * All possible pipeline types.
219
+ */
220
+ export type PipelineType = TaskType | AliasType;
221
+ import { TextClassificationPipeline } from './text-classification.js';
222
+ import { AutoModelForSequenceClassification } from '../models/auto/modeling_auto.js';
223
+ import { TokenClassificationPipeline } from './token-classification.js';
224
+ import { AutoModelForTokenClassification } from '../models/auto/modeling_auto.js';
225
+ import { QuestionAnsweringPipeline } from './question-answering.js';
226
+ import { AutoModelForQuestionAnswering } from '../models/auto/modeling_auto.js';
227
+ import { FillMaskPipeline } from './fill-mask.js';
228
+ import { AutoModelForMaskedLM } from '../models/auto/modeling_auto.js';
229
+ import { SummarizationPipeline } from './summarization.js';
230
+ import { AutoModelForSeq2SeqLM } from '../models/auto/modeling_auto.js';
231
+ import { TranslationPipeline } from './translation.js';
232
+ import { Text2TextGenerationPipeline } from './text2text-generation.js';
233
+ import { TextGenerationPipeline } from './text-generation.js';
234
+ import { AutoModelForCausalLM } from '../models/auto/modeling_auto.js';
235
+ import { ZeroShotClassificationPipeline } from './zero-shot-classification.js';
236
+ import { AudioClassificationPipeline } from './audio-classification.js';
237
+ import { AutoModelForAudioClassification } from '../models/auto/modeling_auto.js';
238
+ import { ZeroShotAudioClassificationPipeline } from './zero-shot-audio-classification.js';
239
+ import { AutoModel } from '../models/auto/modeling_auto.js';
240
+ import { AutomaticSpeechRecognitionPipeline } from './automatic-speech-recognition.js';
241
+ import { AutoModelForSpeechSeq2Seq } from '../models/auto/modeling_auto.js';
242
+ import { TextToAudioPipeline } from './text-to-audio.js';
243
+ import { AutoModelForTextToSpectrogram } from '../models/auto/modeling_auto.js';
244
+ import { ImageToTextPipeline } from './image-to-text.js';
245
+ import { AutoModelForVision2Seq } from '../models/auto/modeling_auto.js';
246
+ import { ImageClassificationPipeline } from './image-classification.js';
247
+ import { AutoModelForImageClassification } from '../models/auto/modeling_auto.js';
248
+ import { ImageSegmentationPipeline } from './image-segmentation.js';
249
+ import { AutoModelForImageSegmentation } from '../models/auto/modeling_auto.js';
250
+ import { BackgroundRemovalPipeline } from './background-removal.js';
251
+ import { ZeroShotImageClassificationPipeline } from './zero-shot-image-classification.js';
252
+ import { ObjectDetectionPipeline } from './object-detection.js';
253
+ import { AutoModelForObjectDetection } from '../models/auto/modeling_auto.js';
254
+ import { ZeroShotObjectDetectionPipeline } from './zero-shot-object-detection.js';
255
+ import { AutoModelForZeroShotObjectDetection } from '../models/auto/modeling_auto.js';
256
+ import { DocumentQuestionAnsweringPipeline } from './document-question-answering.js';
257
+ import { AutoModelForDocumentQuestionAnswering } from '../models/auto/modeling_auto.js';
258
+ import { ImageToImagePipeline } from './image-to-image.js';
259
+ import { AutoModelForImageToImage } from '../models/auto/modeling_auto.js';
260
+ import { DepthEstimationPipeline } from './depth-estimation.js';
261
+ import { AutoModelForDepthEstimation } from '../models/auto/modeling_auto.js';
262
+ import { FeatureExtractionPipeline } from './feature-extraction.js';
263
+ import { ImageFeatureExtractionPipeline } from './image-feature-extraction.js';
264
+ export { TextClassificationPipeline, TokenClassificationPipeline, QuestionAnsweringPipeline, FillMaskPipeline, SummarizationPipeline, TranslationPipeline, Text2TextGenerationPipeline, TextGenerationPipeline, ZeroShotClassificationPipeline, AudioClassificationPipeline, ZeroShotAudioClassificationPipeline, AutomaticSpeechRecognitionPipeline, TextToAudioPipeline, ImageToTextPipeline, ImageClassificationPipeline, ImageSegmentationPipeline, BackgroundRemovalPipeline, ZeroShotImageClassificationPipeline, ObjectDetectionPipeline, ZeroShotObjectDetectionPipeline, DocumentQuestionAnsweringPipeline, ImageToImagePipeline, DepthEstimationPipeline, FeatureExtractionPipeline, ImageFeatureExtractionPipeline };
265
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipelines/index.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8MG;AAIH;;;;;;GASG;uBA+BU,MAAM,OAAO,eAAe;wBAC5B,MAAM,OAAO,YAAY;;;;2BACzB,QAAQ,GAAG,SAAS;2CAtRU,0BAA0B;mDAF9D,iCAAiC;4CAGI,2BAA2B;gDAHhE,iCAAiC;0CAIE,yBAAyB;8CAJ5D,iCAAiC;iCAKP,gBAAgB;qCAL1C,iCAAiC;sCAMF,oBAAoB;sCANnD,iCAAiC;oCAOJ,kBAAkB;4CACV,2BAA2B;uCAChC,sBAAsB;qCATtD,iCAAiC;+CAUO,+BAA+B;4CAClC,2BAA2B;gDAXhE,iCAAiC;oDAYY,qCAAqC;0BAZlF,iCAAiC;mDAaW,mCAAmC;0CAb/E,iCAAiC;oCAcJ,oBAAoB;8CAdjD,iCAAiC;oCAeJ,oBAAoB;uCAfjD,iCAAiC;4CAgBI,2BAA2B;gDAhBhE,iCAAiC;0CAiBE,yBAAyB;8CAjB5D,iCAAiC;0CAkBE,yBAAyB;oDACf,qCAAqC;wCACjD,uBAAuB;4CApBxD,iCAAiC;gDAqBQ,iCAAiC;oDArB1E,iCAAiC;kDAsBU,kCAAkC;sDAtB7E,iCAAiC;qCAuBH,qBAAqB;yCAvBnD,iCAAiC;wCAwBA,uBAAuB;4CAxBxD,iCAAiC;0CAyBE,yBAAyB;+CACpB,+BAA+B"}
@@ -10,7 +10,7 @@ declare const SummarizationPipeline_base: new (options: TextPipelineConstructorA
10
10
  *
11
11
  * @callback SummarizationPipelineCallback Summarize the text(s) given as inputs.
12
12
  * @param {string|string[]} texts One or several articles (or one list of articles) to summarize.
13
- * @param {import('../generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.
13
+ * @param {import('../generation/parameters.js').GenerationFunctionParameters} [options] Additional keyword arguments to pass along to the generate method of the model.
14
14
  * @returns {Promise<SummarizationOutput>}
15
15
  *
16
16
  * @typedef {TextPipelineConstructorArgs & SummarizationPipelineCallback & Disposable} SummarizationPipelineType
@@ -53,7 +53,7 @@ export type SummarizationOutput = SummarizationSingle[];
53
53
  /**
54
54
  * Summarize the text(s) given as inputs.
55
55
  */
56
- export type SummarizationPipelineCallback = (texts: string | string[], options?: import("../generation/configuration_utils.js").GenerationConfig) => Promise<SummarizationOutput>;
56
+ export type SummarizationPipelineCallback = (texts: string | string[], options?: import("../generation/parameters.js").GenerationFunctionParameters) => Promise<SummarizationOutput>;
57
57
  export type SummarizationPipelineType = TextPipelineConstructorArgs & SummarizationPipelineCallback & Disposable;
58
58
  export {};
59
59
  //# sourceMappingURL=summarization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarization.d.ts","sourceRoot":"","sources":["../../src/pipelines/summarization.js"],"names":[],"mappings":"wDA2CqC,2BAA2B,KAAK,yBAAyB;AAzC9F;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAKI,6BAA6B;IAC7B,MADW,cAAc,CACH;CACzB;0CA9CY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;kBAK9B,MAAM;;kCACP,mBAAmB,EAAE;;;;oDAGvB,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,sCAAsC,EAAE,gBAAgB,KAC7D,OAAO,CAAC,mBAAmB,CAAC;wCAE5B,2BAA2B,GAAG,6BAA6B,GAAG,UAAU"}
1
+ {"version":3,"file":"summarization.d.ts","sourceRoot":"","sources":["../../src/pipelines/summarization.js"],"names":[],"mappings":"wDA2CqC,2BAA2B,KAAK,yBAAyB;AAzC9F;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAKI,6BAA6B;IAC7B,MADW,cAAc,CACH;CACzB;0CA9CY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;kBAK9B,MAAM;;kCACP,mBAAmB,EAAE;;;;oDAGvB,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,6BAA6B,EAAE,4BAA4B,KAChE,OAAO,CAAC,mBAAmB,CAAC;wCAE5B,2BAA2B,GAAG,6BAA6B,GAAG,UAAU"}
@@ -16,7 +16,7 @@ declare const TextGenerationPipeline_base: new (options: TextPipelineConstructor
16
16
  * @property {boolean} [return_full_text=true] If set to `false` only added text is returned, otherwise the full text is returned.
17
17
  * @property {Object} [tokenizer_encode_kwargs] Additional keyword arguments to pass along to the encoding step of the tokenizer.
18
18
  * If the text input is a chat, it is passed to `apply_chat_template`. Otherwise, it is passed to the tokenizer's call function.
19
- * @typedef {import('../generation/configuration_utils.js').GenerationConfig & TextGenerationSpecificParams} TextGenerationConfig
19
+ * @typedef {import('../generation/parameters.js').GenerationFunctionParameters & TextGenerationSpecificParams} TextGenerationConfig
20
20
  *
21
21
  * @callback TextGenerationPipelineCallbackString
22
22
  * @param {string} texts One prompt to complete.
@@ -84,7 +84,11 @@ declare const TextGenerationPipeline_base: new (options: TextPipelineConstructor
84
84
  * ```
85
85
  */
86
86
  export class TextGenerationPipeline extends TextGenerationPipeline_base {
87
- _call(texts: any, generate_kwargs?: {}): Promise<TextGenerationOutput | TextGenerationOutput[]>;
87
+ /**
88
+ * @param {string | string[] | import('../tokenization_utils.js').Message[] | import('../tokenization_utils.js').Message[][]} texts
89
+ * @param {Partial<TextGenerationConfig>} generate_kwargs
90
+ */
91
+ _call(texts: string | string[] | import("../tokenization_utils.js").Message[] | import("../tokenization_utils.js").Message[][], generate_kwargs?: Partial<TextGenerationConfig>): Promise<TextGenerationOutput | TextGenerationOutput[]>;
88
92
  }
89
93
  export type TextPipelineConstructorArgs = import("./_base.js").TextPipelineConstructorArgs;
90
94
  export type Disposable = import("./_base.js").Disposable;
@@ -123,7 +127,7 @@ export type TextGenerationSpecificParams = {
123
127
  */
124
128
  tokenizer_encode_kwargs?: any;
125
129
  };
126
- export type TextGenerationConfig = import("../generation/configuration_utils.js").GenerationConfig & TextGenerationSpecificParams;
130
+ export type TextGenerationConfig = import("../generation/parameters.js").GenerationFunctionParameters & TextGenerationSpecificParams;
127
131
  export type TextGenerationPipelineCallbackString = (texts: string, options?: Partial<TextGenerationConfig>) => Promise<TextGenerationStringOutput>;
128
132
  export type TextGenerationPipelineCallbackChat = (texts: Chat, options?: Partial<TextGenerationConfig>) => Promise<TextGenerationChatOutput>;
129
133
  export type TextGenerationPipelineCallbackStringBatched = (texts: string[], options?: Partial<TextGenerationConfig>) => Promise<TextGenerationStringOutput[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"text-generation.d.ts","sourceRoot":"","sources":["../../src/pipelines/text-generation.js"],"names":[],"mappings":"yDAoGqC,2BAA2B,KAAK,0BAA0B;AAtF/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;IAGI,gGA8FC;CACJ;0CAhMY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;mBAC/B,OAAO,0BAA0B,EAAE,OAAO,EAAE;;;;;oBAS3C,MAAM;;yCACP,0BAA0B,EAAE;;;;;oBAG3B,IAAI;;uCACL,wBAAwB,EAAE;mCAE1B,0BAA0B,GAAG,wBAAwB;mCACrD,oBAAoB,EAAE;;;;;;;;yBAGrB,OAAO;;;;uBACP,OAAO;;;;;;;mCAGR,OAAO,sCAAsC,EAAE,gBAAgB,GAAG,4BAA4B;2DAGhG,MAAM,YACN,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,0BAA0B,CAAC;yDAGrC,IAAI,YACJ,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,wBAAwB,CAAC;kEAGnC,MAAM,EAAE,YACR,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,0BAA0B,EAAE,CAAC;gEAGvC,IAAI,EAAE,YACN,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,wBAAwB,EAAE,CAAC;6CAEnC,oCAAoC,GAAG,kCAAkC,GAAG,2CAA2C,GAAG,yCAAyC;yCAEnK,2BAA2B,GAAG,8BAA8B,GAAG,UAAU"}
1
+ {"version":3,"file":"text-generation.d.ts","sourceRoot":"","sources":["../../src/pipelines/text-generation.js"],"names":[],"mappings":"yDAoGqC,2BAA2B,KAAK,0BAA0B;AAtF/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;IAGI;;;OAGG;IACH,aAHW,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,0BAA0B,EAAE,OAAO,EAAE,GAAG,OAAO,0BAA0B,EAAE,OAAO,EAAE,EAAE,oBACjH,OAAO,CAAC,oBAAoB,CAAC,0DAgGvC;CACJ;0CApMY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;mBAC/B,OAAO,0BAA0B,EAAE,OAAO,EAAE;;;;;oBAS3C,MAAM;;yCACP,0BAA0B,EAAE;;;;;oBAG3B,IAAI;;uCACL,wBAAwB,EAAE;mCAE1B,0BAA0B,GAAG,wBAAwB;mCACrD,oBAAoB,EAAE;;;;;;;;yBAGrB,OAAO;;;;uBACP,OAAO;;;;;;;mCAGR,OAAO,6BAA6B,EAAE,4BAA4B,GAAG,4BAA4B;2DAGnG,MAAM,YACN,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,0BAA0B,CAAC;yDAGrC,IAAI,YACJ,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,wBAAwB,CAAC;kEAGnC,MAAM,EAAE,YACR,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,0BAA0B,EAAE,CAAC;gEAGvC,IAAI,EAAE,YACN,OAAO,CAAC,oBAAoB,CAAC,KAC3B,OAAO,CAAC,wBAAwB,EAAE,CAAC;6CAEnC,oCAAoC,GAAG,kCAAkC,GAAG,2CAA2C,GAAG,yCAAyC;yCAEnK,2BAA2B,GAAG,8BAA8B,GAAG,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"text-to-audio.d.ts","sourceRoot":"","sources":["../../src/pipelines/text-to-audio.js"],"names":[],"mappings":"sDA2EqC,kCAAkC,KAAK,uBAAuB;AApEnG;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;IAGI,2BAA+C;IAU3C,sDAAsC;IAG1C,oFAyBC;IAED;;;;;;;;OAQG;IACH,8BAYC;IAED,sEASC;IAED;;;;uCAyBC;IAED,yEAaC;IAED;;uCAsBC;CACJ;+CAhNY,OAAO,YAAY,EAAE,gCAAgC;yBACrD,OAAO,YAAY,EAAE,UAAU;;;;;cAK9B,OAAO,6BAA6B,EAAE,eAAe;;iDACtD,gCAAgC,GAAG,cAAc;gCAIjD,QAAQ,EAAE;;;;;;;;yBAGT,MAAM,GAAC,YAAY,GAAC,MAAM,GAAC,GAAG;;;;;0BAC9B,MAAM;;;;YAEN,MAAM;;;;;uDAGT,MAAM,YACN,0BAA0B,KACxB,OAAO,CAAC,QAAQ,CAAC;;;;uDAGnB,MAAM,EAAE,YACR,0BAA0B,KACxB,OAAO,CAAC,iBAAiB,CAAC;0CAE1B,iCAAiC,GAAG,gCAAgC;sCAEpE,kCAAkC,GAAG,2BAA2B,GAAG,UAAU;yBApCjE,mBAAmB;uBADrB,oBAAoB"}
1
+ {"version":3,"file":"text-to-audio.d.ts","sourceRoot":"","sources":["../../src/pipelines/text-to-audio.js"],"names":[],"mappings":"sDA6EqC,kCAAkC,KAAK,uBAAuB;AApEnG;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;IAGI,2BAA+C;IAU3C,sDAAsC;IAG1C,oFAyBC;IAED;;;;;;;;OAQG;IACH,8BAYC;IAED,sEASC;IAED;;;;uCAyBC;IAED,yEAaC;IAED;;uCAsBC;CACJ;+CAhNY,OAAO,YAAY,EAAE,gCAAgC;yBACrD,OAAO,YAAY,EAAE,UAAU;;;;;cAK9B,OAAO,6BAA6B,EAAE,eAAe;;iDACtD,gCAAgC,GAAG,cAAc;gCAIjD,QAAQ,EAAE;;;;;;;;yBAGT,MAAM,GAAC,YAAY,GAAC,MAAM,GAAC,GAAG;;;;;0BAC9B,MAAM;;;;YAEN,MAAM;;;;;uDAGT,MAAM,YACN,0BAA0B,KACxB,OAAO,CAAC,QAAQ,CAAC;;;;uDAGnB,MAAM,EAAE,YACR,0BAA0B,KACxB,OAAO,CAAC,iBAAiB,CAAC;0CAE1B,iCAAiC,GAAG,gCAAgC;sCAEpE,kCAAkC,GAAG,2BAA2B,GAAG,UAAU;yBAtCjE,mBAAmB;uBADrB,oBAAoB"}
@@ -10,7 +10,7 @@ declare const Text2TextGenerationPipeline_base: new (options: TextPipelineConstr
10
10
  *
11
11
  * @callback Text2TextGenerationPipelineCallback Generate the output text(s) using text(s) given as inputs.
12
12
  * @param {string|string[]} texts Input text for the encoder.
13
- * @param {Partial<import('../generation/configuration_utils.js').GenerationConfig>} [options] Additional keyword arguments to pass along to the generate method of the model.
13
+ * @param {Partial<import('../generation/parameters.js').GenerationFunctionParameters>} [options] Additional keyword arguments to pass along to the generate method of the model.
14
14
  * @returns {Promise<Text2TextGenerationOutput>}
15
15
  *
16
16
  * @typedef {TextPipelineConstructorArgs & Text2TextGenerationPipelineCallback & Disposable} Text2TextGenerationPipelineType
@@ -32,7 +32,7 @@ declare const Text2TextGenerationPipeline_base: new (options: TextPipelineConstr
32
32
  export class Text2TextGenerationPipeline extends Text2TextGenerationPipeline_base {
33
33
  /** @type {'generated_text'} */
34
34
  _key: "generated_text";
35
- _call(texts: string | string[], options?: Partial<import("../generation/configuration_utils.js").GenerationConfig>): Promise<Text2TextGenerationOutput>;
35
+ _call(texts: string | string[], options?: Partial<import("../generation/parameters.js").GenerationFunctionParameters>): Promise<Text2TextGenerationOutput>;
36
36
  }
37
37
  export type TextPipelineConstructorArgs = import("./_base.js").TextPipelineConstructorArgs;
38
38
  export type Disposable = import("./_base.js").Disposable;
@@ -46,7 +46,7 @@ export type Text2TextGenerationOutput = Text2TextGenerationSingle[];
46
46
  /**
47
47
  * Generate the output text(s) using text(s) given as inputs.
48
48
  */
49
- export type Text2TextGenerationPipelineCallback = (texts: string | string[], options?: Partial<import("../generation/configuration_utils.js").GenerationConfig>) => Promise<Text2TextGenerationOutput>;
49
+ export type Text2TextGenerationPipelineCallback = (texts: string | string[], options?: Partial<import("../generation/parameters.js").GenerationFunctionParameters>) => Promise<Text2TextGenerationOutput>;
50
50
  export type Text2TextGenerationPipelineType = TextPipelineConstructorArgs & Text2TextGenerationPipelineCallback & Disposable;
51
51
  export {};
52
52
  //# sourceMappingURL=text2text-generation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text2text-generation.d.ts","sourceRoot":"","sources":["../../src/pipelines/text2text-generation.js"],"names":[],"mappings":"8DAqCqC,2BAA2B,KAAK,+BAA+B;AAjCpG;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;GAaG;AACH;IAGI,+BAA+B;IAC/B,MADW,gBAAgB,CACH;IA1BzB,aACQ,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,CAAC,OAAO,sCAAsC,EAAE,gBAAgB,CAAC,GACtE,OAAO,CAAC,yBAAyB,CAAC,CAE5C;CAsEF;0CApFY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;oBAK9B,MAAM;;wCACP,yBAAyB,EAAE;;;;0DAG7B,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,CAAC,OAAO,sCAAsC,EAAE,gBAAgB,CAAC,KACtE,OAAO,CAAC,yBAAyB,CAAC;8CAElC,2BAA2B,GAAG,mCAAmC,GAAG,UAAU"}
1
+ {"version":3,"file":"text2text-generation.d.ts","sourceRoot":"","sources":["../../src/pipelines/text2text-generation.js"],"names":[],"mappings":"8DAqCqC,2BAA2B,KAAK,+BAA+B;AAjCpG;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;GAaG;AACH;IAGI,+BAA+B;IAC/B,MADW,gBAAgB,CACH;IA1BzB,aACQ,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,CAAC,OAAO,6BAA6B,EAAE,4BAA4B,CAAC,GACzE,OAAO,CAAC,yBAAyB,CAAC,CAE5C;CAsEF;0CApFY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;oBAK9B,MAAM;;wCACP,yBAAyB,EAAE;;;;0DAG7B,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,CAAC,OAAO,6BAA6B,EAAE,4BAA4B,CAAC,KACzE,OAAO,CAAC,yBAAyB,CAAC;8CAElC,2BAA2B,GAAG,mCAAmC,GAAG,UAAU"}
@@ -10,7 +10,7 @@ declare const TranslationPipeline_base: new (options: TextPipelineConstructorArg
10
10
  *
11
11
  * @callback TranslationPipelineCallback Translate the text(s) given as inputs.
12
12
  * @param {string|string[]} texts Texts to be translated.
13
- * @param {import('../generation/configuration_utils.js').GenerationConfig} [options] Additional keyword arguments to pass along to the generate method of the model.
13
+ * @param {import('../generation/parameters.js').GenerationFunctionParameters} [options] Additional keyword arguments to pass along to the generate method of the model.
14
14
  * @returns {Promise<TranslationOutput>}
15
15
  *
16
16
  * @typedef {TextPipelineConstructorArgs & TranslationPipelineCallback & Disposable} TranslationPipelineType
@@ -82,7 +82,7 @@ export type TranslationOutput = TranslationSingle[];
82
82
  /**
83
83
  * Translate the text(s) given as inputs.
84
84
  */
85
- export type TranslationPipelineCallback = (texts: string | string[], options?: import("../generation/configuration_utils.js").GenerationConfig) => Promise<TranslationOutput>;
85
+ export type TranslationPipelineCallback = (texts: string | string[], options?: import("../generation/parameters.js").GenerationFunctionParameters) => Promise<TranslationOutput>;
86
86
  export type TranslationPipelineType = TextPipelineConstructorArgs & TranslationPipelineCallback & Disposable;
87
87
  export {};
88
88
  //# sourceMappingURL=translation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/pipelines/translation.js"],"names":[],"mappings":"sDAwEqC,2BAA2B,KAAK,uBAAuB;AAtE5F;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH;IAKI,iCAAiC;IACjC,MADW,kBAAkB,CACH;CAC7B;0CA3EY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;sBAK9B,MAAM;;gCACP,iBAAiB,EAAE;;;;kDAGrB,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,sCAAsC,EAAE,gBAAgB,KAC7D,OAAO,CAAC,iBAAiB,CAAC;sCAE1B,2BAA2B,GAAG,2BAA2B,GAAG,UAAU"}
1
+ {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/pipelines/translation.js"],"names":[],"mappings":"sDAwEqC,2BAA2B,KAAK,uBAAuB;AAtE5F;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH;IAKI,iCAAiC;IACjC,MADW,kBAAkB,CACH;CAC7B;0CA3EY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;sBAK9B,MAAM;;gCACP,iBAAiB,EAAE;;;;kDAGrB,MAAM,GAAC,MAAM,EAAE,YACf,OAAO,6BAA6B,EAAE,4BAA4B,KAChE,OAAO,CAAC,iBAAiB,CAAC;sCAE1B,2BAA2B,GAAG,2BAA2B,GAAG,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"zero-shot-classification.d.ts","sourceRoot":"","sources":["../../src/pipelines/zero-shot-classification.js"],"names":[],"mappings":"iEA+EqC,2BAA2B,KAAK,kCAAkC;AA3EvG;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IAWQ;;MAEC;IAED,mBAAgD;IAMhD,sBAAyF;IAO7F;;;+EAqDC;CACJ;0CA3JY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;cAK9B,MAAM;;;;YACN,MAAM,EAAE;;;;YACR,MAAM,EAAE;;;;;;;;;;0BAGR,MAAM;;;;;;;kBAEN,OAAO;;;;;mEAMV,MAAM,oBACN,MAAM,GAAC,MAAM,EAAE,YAEf,qCAAqC,KACnC,OAAO,CAAC,4BAA4B,CAAC;;;;kEAGvC,MAAM,EAAE,oBACR,MAAM,GAAC,MAAM,EAAE,YAEf,qCAAqC,KACnC,OAAO,CAAC,4BAA4B,EAAE,CAAC;qDAEvC,4CAA4C,GAAG,2CAA2C;iDAE1F,2BAA2B,GAAG,sCAAsC,GAAG,UAAU"}
1
+ {"version":3,"file":"zero-shot-classification.d.ts","sourceRoot":"","sources":["../../src/pipelines/zero-shot-classification.js"],"names":[],"mappings":"iEAgFqC,2BAA2B,KAAK,kCAAkC;AA3EvG;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IAWQ;;MAEC;IAED,mBAAgD;IAMhD,sBAAyF;IAO7F;;;+EAqDC;CACJ;0CA3JY,OAAO,YAAY,EAAE,2BAA2B;yBAChD,OAAO,YAAY,EAAE,UAAU;;;;;cAK9B,MAAM;;;;YACN,MAAM,EAAE;;;;YACR,MAAM,EAAE;;;;;;;;;;0BAGR,MAAM;;;;;;;kBAEN,OAAO;;;;;mEAMV,MAAM,oBACN,MAAM,GAAC,MAAM,EAAE,YAEf,qCAAqC,KACnC,OAAO,CAAC,4BAA4B,CAAC;;;;kEAGvC,MAAM,EAAE,oBACR,MAAM,GAAC,MAAM,EAAE,YAEf,qCAAqC,KACnC,OAAO,CAAC,4BAA4B,EAAE,CAAC;qDAEvC,4CAA4C,GAAG,2CAA2C;iDAE1F,2BAA2B,GAAG,sCAAsC,GAAG,UAAU"}