xinference 1.0.1__py3-none-any.whl → 1.2.1__py3-none-any.whl

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.

Potentially problematic release.


This version of xinference might be problematic. Click here for more details.

Files changed (343) hide show
  1. xinference/_compat.py +2 -0
  2. xinference/_version.py +3 -3
  3. xinference/api/restful_api.py +77 -71
  4. xinference/core/chat_interface.py +6 -1
  5. xinference/core/model.py +79 -19
  6. xinference/core/supervisor.py +172 -10
  7. xinference/core/utils.py +12 -8
  8. xinference/core/worker.py +102 -4
  9. xinference/deploy/cmdline.py +3 -1
  10. xinference/deploy/test/test_cmdline.py +56 -0
  11. xinference/isolation.py +24 -0
  12. xinference/model/audio/core.py +16 -0
  13. xinference/model/audio/cosyvoice.py +39 -6
  14. xinference/model/audio/f5tts.py +200 -0
  15. xinference/model/audio/f5tts_mlx.py +260 -0
  16. xinference/model/audio/fish_speech.py +36 -111
  17. xinference/model/audio/melotts.py +110 -0
  18. xinference/model/audio/model_spec.json +99 -3
  19. xinference/model/audio/model_spec_modelscope.json +27 -0
  20. xinference/model/audio/utils.py +32 -0
  21. xinference/model/audio/whisper.py +35 -10
  22. xinference/model/embedding/core.py +203 -142
  23. xinference/model/embedding/model_spec.json +7 -0
  24. xinference/model/embedding/model_spec_modelscope.json +8 -0
  25. xinference/model/image/core.py +69 -1
  26. xinference/model/image/model_spec.json +145 -4
  27. xinference/model/image/model_spec_modelscope.json +150 -4
  28. xinference/model/image/stable_diffusion/core.py +45 -13
  29. xinference/model/llm/__init__.py +4 -2
  30. xinference/model/llm/llm_family.json +536 -53
  31. xinference/model/llm/llm_family.py +15 -36
  32. xinference/model/llm/llm_family_modelscope.json +454 -20
  33. xinference/model/llm/memory.py +1 -1
  34. xinference/model/llm/mlx/core.py +248 -52
  35. xinference/model/llm/sglang/core.py +1 -0
  36. xinference/model/llm/transformers/chatglm.py +9 -5
  37. xinference/model/llm/transformers/cogagent.py +272 -0
  38. xinference/model/llm/transformers/core.py +2 -0
  39. xinference/model/llm/transformers/qwen2_vl.py +12 -1
  40. xinference/model/llm/transformers/utils.py +16 -8
  41. xinference/model/llm/utils.py +36 -4
  42. xinference/model/llm/vllm/core.py +53 -10
  43. xinference/model/llm/vllm/xavier/__init__.py +13 -0
  44. xinference/model/llm/vllm/xavier/allocator.py +74 -0
  45. xinference/model/llm/vllm/xavier/block.py +111 -0
  46. xinference/model/llm/vllm/xavier/block_manager.py +71 -0
  47. xinference/model/llm/vllm/xavier/block_tracker.py +129 -0
  48. xinference/model/llm/vllm/xavier/collective.py +74 -0
  49. xinference/model/llm/vllm/xavier/collective_manager.py +147 -0
  50. xinference/model/llm/vllm/xavier/engine.py +247 -0
  51. xinference/model/llm/vllm/xavier/executor.py +134 -0
  52. xinference/model/llm/vllm/xavier/scheduler.py +438 -0
  53. xinference/model/llm/vllm/xavier/test/__init__.py +13 -0
  54. xinference/model/llm/vllm/xavier/test/test_xavier.py +147 -0
  55. xinference/model/llm/vllm/xavier/transfer.py +319 -0
  56. xinference/model/video/diffusers.py +14 -0
  57. xinference/model/video/model_spec.json +15 -0
  58. xinference/model/video/model_spec_modelscope.json +16 -0
  59. xinference/thirdparty/cosyvoice/bin/average_model.py +92 -0
  60. xinference/thirdparty/cosyvoice/bin/export_jit.py +12 -2
  61. xinference/thirdparty/cosyvoice/bin/export_onnx.py +112 -0
  62. xinference/thirdparty/cosyvoice/bin/export_trt.sh +9 -0
  63. xinference/thirdparty/cosyvoice/bin/inference.py +5 -7
  64. xinference/thirdparty/cosyvoice/bin/spk2info.pt +0 -0
  65. xinference/thirdparty/cosyvoice/bin/train.py +42 -8
  66. xinference/thirdparty/cosyvoice/cli/cosyvoice.py +96 -25
  67. xinference/thirdparty/cosyvoice/cli/frontend.py +77 -30
  68. xinference/thirdparty/cosyvoice/cli/model.py +330 -80
  69. xinference/thirdparty/cosyvoice/dataset/dataset.py +6 -2
  70. xinference/thirdparty/cosyvoice/dataset/processor.py +76 -14
  71. xinference/thirdparty/cosyvoice/flow/decoder.py +92 -13
  72. xinference/thirdparty/cosyvoice/flow/flow.py +99 -9
  73. xinference/thirdparty/cosyvoice/flow/flow_matching.py +110 -13
  74. xinference/thirdparty/cosyvoice/flow/length_regulator.py +5 -4
  75. xinference/thirdparty/cosyvoice/hifigan/discriminator.py +140 -0
  76. xinference/thirdparty/cosyvoice/hifigan/generator.py +58 -42
  77. xinference/thirdparty/cosyvoice/hifigan/hifigan.py +67 -0
  78. xinference/thirdparty/cosyvoice/llm/llm.py +139 -6
  79. xinference/thirdparty/cosyvoice/tokenizer/assets/multilingual_zh_ja_yue_char_del.tiktoken +58836 -0
  80. xinference/thirdparty/cosyvoice/tokenizer/tokenizer.py +279 -0
  81. xinference/thirdparty/cosyvoice/transformer/embedding.py +2 -2
  82. xinference/thirdparty/cosyvoice/transformer/encoder_layer.py +7 -7
  83. xinference/thirdparty/cosyvoice/transformer/upsample_encoder.py +318 -0
  84. xinference/thirdparty/cosyvoice/utils/common.py +28 -1
  85. xinference/thirdparty/cosyvoice/utils/executor.py +69 -7
  86. xinference/thirdparty/cosyvoice/utils/file_utils.py +2 -12
  87. xinference/thirdparty/cosyvoice/utils/frontend_utils.py +9 -5
  88. xinference/thirdparty/cosyvoice/utils/losses.py +20 -0
  89. xinference/thirdparty/cosyvoice/utils/scheduler.py +1 -2
  90. xinference/thirdparty/cosyvoice/utils/train_utils.py +101 -45
  91. xinference/thirdparty/f5_tts/api.py +166 -0
  92. xinference/thirdparty/f5_tts/configs/E2TTS_Base_train.yaml +44 -0
  93. xinference/thirdparty/f5_tts/configs/E2TTS_Small_train.yaml +44 -0
  94. xinference/thirdparty/f5_tts/configs/F5TTS_Base_train.yaml +46 -0
  95. xinference/thirdparty/f5_tts/configs/F5TTS_Small_train.yaml +46 -0
  96. xinference/thirdparty/f5_tts/eval/README.md +49 -0
  97. xinference/thirdparty/f5_tts/eval/ecapa_tdnn.py +330 -0
  98. xinference/thirdparty/f5_tts/eval/eval_infer_batch.py +207 -0
  99. xinference/thirdparty/f5_tts/eval/eval_infer_batch.sh +13 -0
  100. xinference/thirdparty/f5_tts/eval/eval_librispeech_test_clean.py +84 -0
  101. xinference/thirdparty/f5_tts/eval/eval_seedtts_testset.py +84 -0
  102. xinference/thirdparty/f5_tts/eval/utils_eval.py +405 -0
  103. xinference/thirdparty/f5_tts/infer/README.md +191 -0
  104. xinference/thirdparty/f5_tts/infer/SHARED.md +74 -0
  105. xinference/thirdparty/f5_tts/infer/examples/basic/basic.toml +11 -0
  106. xinference/thirdparty/f5_tts/infer/examples/basic/basic_ref_en.wav +0 -0
  107. xinference/thirdparty/f5_tts/infer/examples/basic/basic_ref_zh.wav +0 -0
  108. xinference/thirdparty/f5_tts/infer/examples/multi/country.flac +0 -0
  109. xinference/thirdparty/f5_tts/infer/examples/multi/main.flac +0 -0
  110. xinference/thirdparty/f5_tts/infer/examples/multi/story.toml +19 -0
  111. xinference/thirdparty/f5_tts/infer/examples/multi/story.txt +1 -0
  112. xinference/thirdparty/f5_tts/infer/examples/multi/town.flac +0 -0
  113. xinference/thirdparty/f5_tts/infer/examples/vocab.txt +2545 -0
  114. xinference/thirdparty/f5_tts/infer/infer_cli.py +226 -0
  115. xinference/thirdparty/f5_tts/infer/infer_gradio.py +851 -0
  116. xinference/thirdparty/f5_tts/infer/speech_edit.py +193 -0
  117. xinference/thirdparty/f5_tts/infer/utils_infer.py +538 -0
  118. xinference/thirdparty/f5_tts/model/__init__.py +10 -0
  119. xinference/thirdparty/f5_tts/model/backbones/README.md +20 -0
  120. xinference/thirdparty/f5_tts/model/backbones/dit.py +163 -0
  121. xinference/thirdparty/f5_tts/model/backbones/mmdit.py +146 -0
  122. xinference/thirdparty/f5_tts/model/backbones/unett.py +219 -0
  123. xinference/thirdparty/f5_tts/model/cfm.py +285 -0
  124. xinference/thirdparty/f5_tts/model/dataset.py +319 -0
  125. xinference/thirdparty/f5_tts/model/modules.py +658 -0
  126. xinference/thirdparty/f5_tts/model/trainer.py +366 -0
  127. xinference/thirdparty/f5_tts/model/utils.py +185 -0
  128. xinference/thirdparty/f5_tts/scripts/count_max_epoch.py +33 -0
  129. xinference/thirdparty/f5_tts/scripts/count_params_gflops.py +39 -0
  130. xinference/thirdparty/f5_tts/socket_server.py +159 -0
  131. xinference/thirdparty/f5_tts/train/README.md +77 -0
  132. xinference/thirdparty/f5_tts/train/datasets/prepare_csv_wavs.py +139 -0
  133. xinference/thirdparty/f5_tts/train/datasets/prepare_emilia.py +230 -0
  134. xinference/thirdparty/f5_tts/train/datasets/prepare_libritts.py +92 -0
  135. xinference/thirdparty/f5_tts/train/datasets/prepare_ljspeech.py +65 -0
  136. xinference/thirdparty/f5_tts/train/datasets/prepare_wenetspeech4tts.py +125 -0
  137. xinference/thirdparty/f5_tts/train/finetune_cli.py +174 -0
  138. xinference/thirdparty/f5_tts/train/finetune_gradio.py +1846 -0
  139. xinference/thirdparty/f5_tts/train/train.py +75 -0
  140. xinference/thirdparty/fish_speech/fish_speech/conversation.py +94 -83
  141. xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/llama.py +63 -20
  142. xinference/thirdparty/fish_speech/fish_speech/text/clean.py +1 -26
  143. xinference/thirdparty/fish_speech/fish_speech/text/spliter.py +1 -1
  144. xinference/thirdparty/fish_speech/fish_speech/tokenizer.py +152 -0
  145. xinference/thirdparty/fish_speech/fish_speech/train.py +2 -2
  146. xinference/thirdparty/fish_speech/fish_speech/webui/manage.py +1 -1
  147. xinference/thirdparty/fish_speech/tools/{post_api.py → api_client.py} +7 -13
  148. xinference/thirdparty/fish_speech/tools/api_server.py +98 -0
  149. xinference/thirdparty/fish_speech/tools/download_models.py +5 -5
  150. xinference/thirdparty/fish_speech/tools/fish_e2e.py +2 -2
  151. xinference/thirdparty/fish_speech/tools/inference_engine/__init__.py +192 -0
  152. xinference/thirdparty/fish_speech/tools/inference_engine/reference_loader.py +125 -0
  153. xinference/thirdparty/fish_speech/tools/inference_engine/utils.py +39 -0
  154. xinference/thirdparty/fish_speech/tools/inference_engine/vq_manager.py +57 -0
  155. xinference/thirdparty/fish_speech/tools/llama/eval_in_context.py +2 -2
  156. xinference/thirdparty/fish_speech/tools/llama/generate.py +117 -89
  157. xinference/thirdparty/fish_speech/tools/run_webui.py +104 -0
  158. xinference/thirdparty/fish_speech/tools/schema.py +11 -28
  159. xinference/thirdparty/fish_speech/tools/server/agent/__init__.py +57 -0
  160. xinference/thirdparty/fish_speech/tools/server/agent/generate.py +119 -0
  161. xinference/thirdparty/fish_speech/tools/server/agent/generation_utils.py +122 -0
  162. xinference/thirdparty/fish_speech/tools/server/agent/pre_generation_utils.py +72 -0
  163. xinference/thirdparty/fish_speech/tools/server/api_utils.py +75 -0
  164. xinference/thirdparty/fish_speech/tools/server/exception_handler.py +27 -0
  165. xinference/thirdparty/fish_speech/tools/server/inference.py +45 -0
  166. xinference/thirdparty/fish_speech/tools/server/model_manager.py +122 -0
  167. xinference/thirdparty/fish_speech/tools/server/model_utils.py +129 -0
  168. xinference/thirdparty/fish_speech/tools/server/views.py +246 -0
  169. xinference/thirdparty/fish_speech/tools/webui/__init__.py +173 -0
  170. xinference/thirdparty/fish_speech/tools/webui/inference.py +91 -0
  171. xinference/thirdparty/fish_speech/tools/webui/variables.py +14 -0
  172. xinference/thirdparty/matcha/utils/utils.py +2 -2
  173. xinference/thirdparty/melo/api.py +135 -0
  174. xinference/thirdparty/melo/app.py +61 -0
  175. xinference/thirdparty/melo/attentions.py +459 -0
  176. xinference/thirdparty/melo/commons.py +160 -0
  177. xinference/thirdparty/melo/configs/config.json +94 -0
  178. xinference/thirdparty/melo/data/example/metadata.list +20 -0
  179. xinference/thirdparty/melo/data_utils.py +413 -0
  180. xinference/thirdparty/melo/download_utils.py +67 -0
  181. xinference/thirdparty/melo/infer.py +25 -0
  182. xinference/thirdparty/melo/init_downloads.py +14 -0
  183. xinference/thirdparty/melo/losses.py +58 -0
  184. xinference/thirdparty/melo/main.py +36 -0
  185. xinference/thirdparty/melo/mel_processing.py +174 -0
  186. xinference/thirdparty/melo/models.py +1030 -0
  187. xinference/thirdparty/melo/modules.py +598 -0
  188. xinference/thirdparty/melo/monotonic_align/__init__.py +16 -0
  189. xinference/thirdparty/melo/monotonic_align/core.py +46 -0
  190. xinference/thirdparty/melo/preprocess_text.py +135 -0
  191. xinference/thirdparty/melo/split_utils.py +174 -0
  192. xinference/thirdparty/melo/text/__init__.py +35 -0
  193. xinference/thirdparty/melo/text/chinese.py +199 -0
  194. xinference/thirdparty/melo/text/chinese_bert.py +107 -0
  195. xinference/thirdparty/melo/text/chinese_mix.py +253 -0
  196. xinference/thirdparty/melo/text/cleaner.py +36 -0
  197. xinference/thirdparty/melo/text/cleaner_multiling.py +110 -0
  198. xinference/thirdparty/melo/text/cmudict.rep +129530 -0
  199. xinference/thirdparty/melo/text/cmudict_cache.pickle +0 -0
  200. xinference/thirdparty/melo/text/english.py +284 -0
  201. xinference/thirdparty/melo/text/english_bert.py +39 -0
  202. xinference/thirdparty/melo/text/english_utils/abbreviations.py +35 -0
  203. xinference/thirdparty/melo/text/english_utils/number_norm.py +97 -0
  204. xinference/thirdparty/melo/text/english_utils/time_norm.py +47 -0
  205. xinference/thirdparty/melo/text/es_phonemizer/base.py +140 -0
  206. xinference/thirdparty/melo/text/es_phonemizer/cleaner.py +109 -0
  207. xinference/thirdparty/melo/text/es_phonemizer/es_symbols.json +79 -0
  208. xinference/thirdparty/melo/text/es_phonemizer/es_symbols.txt +1 -0
  209. xinference/thirdparty/melo/text/es_phonemizer/es_symbols_v2.json +83 -0
  210. xinference/thirdparty/melo/text/es_phonemizer/es_to_ipa.py +12 -0
  211. xinference/thirdparty/melo/text/es_phonemizer/example_ipa.txt +400 -0
  212. xinference/thirdparty/melo/text/es_phonemizer/gruut_wrapper.py +253 -0
  213. xinference/thirdparty/melo/text/es_phonemizer/punctuation.py +174 -0
  214. xinference/thirdparty/melo/text/es_phonemizer/spanish_symbols.txt +1 -0
  215. xinference/thirdparty/melo/text/es_phonemizer/test.ipynb +124 -0
  216. xinference/thirdparty/melo/text/fr_phonemizer/base.py +140 -0
  217. xinference/thirdparty/melo/text/fr_phonemizer/cleaner.py +122 -0
  218. xinference/thirdparty/melo/text/fr_phonemizer/en_symbols.json +78 -0
  219. xinference/thirdparty/melo/text/fr_phonemizer/example_ipa.txt +1 -0
  220. xinference/thirdparty/melo/text/fr_phonemizer/fr_symbols.json +89 -0
  221. xinference/thirdparty/melo/text/fr_phonemizer/fr_to_ipa.py +30 -0
  222. xinference/thirdparty/melo/text/fr_phonemizer/french_abbreviations.py +48 -0
  223. xinference/thirdparty/melo/text/fr_phonemizer/french_symbols.txt +1 -0
  224. xinference/thirdparty/melo/text/fr_phonemizer/gruut_wrapper.py +258 -0
  225. xinference/thirdparty/melo/text/fr_phonemizer/punctuation.py +172 -0
  226. xinference/thirdparty/melo/text/french.py +94 -0
  227. xinference/thirdparty/melo/text/french_bert.py +39 -0
  228. xinference/thirdparty/melo/text/japanese.py +647 -0
  229. xinference/thirdparty/melo/text/japanese_bert.py +49 -0
  230. xinference/thirdparty/melo/text/ko_dictionary.py +44 -0
  231. xinference/thirdparty/melo/text/korean.py +192 -0
  232. xinference/thirdparty/melo/text/opencpop-strict.txt +429 -0
  233. xinference/thirdparty/melo/text/spanish.py +122 -0
  234. xinference/thirdparty/melo/text/spanish_bert.py +39 -0
  235. xinference/thirdparty/melo/text/symbols.py +290 -0
  236. xinference/thirdparty/melo/text/tone_sandhi.py +769 -0
  237. xinference/thirdparty/melo/train.py +635 -0
  238. xinference/thirdparty/melo/train.sh +19 -0
  239. xinference/thirdparty/melo/transforms.py +209 -0
  240. xinference/thirdparty/melo/utils.py +424 -0
  241. xinference/types.py +15 -0
  242. xinference/web/ui/build/asset-manifest.json +6 -6
  243. xinference/web/ui/build/index.html +1 -1
  244. xinference/web/ui/build/static/css/main.51a587ff.css +2 -0
  245. xinference/web/ui/build/static/css/main.51a587ff.css.map +1 -0
  246. xinference/web/ui/build/static/js/main.b0936c54.js +3 -0
  247. xinference/web/ui/build/static/js/main.b0936c54.js.map +1 -0
  248. xinference/web/ui/node_modules/.cache/babel-loader/03c4052f1b91f6ba0c5389bdcf49c43319b4076c08e4b8585dab312538ae290a.json +1 -0
  249. xinference/web/ui/node_modules/.cache/babel-loader/1786b83003b8e9605a0f5f855a185d4d16e38fc893dfb326a2a9cca206b4240a.json +1 -0
  250. xinference/web/ui/node_modules/.cache/babel-loader/17cbc181dd674b9150b80c73ed6a82656de0082d857f6e5f66d9716129ac0b38.json +1 -0
  251. xinference/web/ui/node_modules/.cache/babel-loader/185ceb8872d562e032b47e79df6a45670e06345b8ed70aad1a131e0476783c5c.json +1 -0
  252. xinference/web/ui/node_modules/.cache/babel-loader/26b8c9f34b0bed789b3a833767672e39302d1e0c09b4276f4d58d1df7b6bd93b.json +1 -0
  253. xinference/web/ui/node_modules/.cache/babel-loader/2b484da66c724d0d56a40849c109327408796a668b1381511b6e9e03baa48658.json +1 -0
  254. xinference/web/ui/node_modules/.cache/babel-loader/2cbbbce9b84df73330d4c42b82436ed881b3847628f2fbc346aa62e2859fd88c.json +1 -0
  255. xinference/web/ui/node_modules/.cache/babel-loader/2ec9b14431ed33ce6901bf9f27007be4e6e472709c99d6e22b50ce528e4b78ee.json +1 -0
  256. xinference/web/ui/node_modules/.cache/babel-loader/3b966db018f96be4a055d6ca205f0990d4d0b370e2980c17d8bca2c9a021819c.json +1 -0
  257. xinference/web/ui/node_modules/.cache/babel-loader/3eefb411b24c2b3ce053570ef50daccf154022f0e168be5ed0fec21394baf9f4.json +1 -0
  258. xinference/web/ui/node_modules/.cache/babel-loader/522b229e3cac219123f0d69673f5570e191c2d2a505dc65b312d336eae2279c0.json +1 -0
  259. xinference/web/ui/node_modules/.cache/babel-loader/52e45f17ba300580ea3fcc9f9228ccba194bb092b76f25e9255af311f8b05aab.json +1 -0
  260. xinference/web/ui/node_modules/.cache/babel-loader/5a0bc4631f936459afc1a3b1d3ec2420118b1f00e11f60ccac3e08088f3f27a8.json +1 -0
  261. xinference/web/ui/node_modules/.cache/babel-loader/611fa2c6c53b66039991d06dfb0473b5ab37fc63b4564e0f6e1718523768a045.json +1 -0
  262. xinference/web/ui/node_modules/.cache/babel-loader/6329bc76c406fe5eb305412383fbde5950f847bb5e43261f73f37622c365acb4.json +1 -0
  263. xinference/web/ui/node_modules/.cache/babel-loader/63c8e07687ea53a4f8a910ee5e42e0eb26cd1acbfbe820f3e3248a786ee51401.json +1 -0
  264. xinference/web/ui/node_modules/.cache/babel-loader/69b2d5001684174ec9da57e07914eed3eac4960018bceb6cbfa801d861301d7c.json +1 -0
  265. xinference/web/ui/node_modules/.cache/babel-loader/710c1acda69e561e30a933b98c6a56d50197868b15c21e2aad55ab6d46649eb6.json +1 -0
  266. xinference/web/ui/node_modules/.cache/babel-loader/720deca1fce5a1dc5056048fa8258fd138a82ea855f350b6613f104a73fb761f.json +1 -0
  267. xinference/web/ui/node_modules/.cache/babel-loader/76a23b92d26a499c57e61eea2b895fbc9771bd0849a72e66f8e633192017978b.json +1 -0
  268. xinference/web/ui/node_modules/.cache/babel-loader/858063f23b34dfe600254eb5afd85518b0002ec4b30b7386616c45600826e3b2.json +1 -0
  269. xinference/web/ui/node_modules/.cache/babel-loader/920b82c1c89124cf217109eeedbfcd3aae3b917be50c9dfb6bbb4ce26bdfd2e7.json +1 -0
  270. xinference/web/ui/node_modules/.cache/babel-loader/94d8b7aeb0076f2ce07db598cea0e87b13bc8d5614eb530b8d6e696c2daf6f88.json +1 -0
  271. xinference/web/ui/node_modules/.cache/babel-loader/9e917fe7022d01b2ccbe5cc0ce73d70bb72bee584ff293bad71bdff6695dee28.json +1 -0
  272. xinference/web/ui/node_modules/.cache/babel-loader/9f28fdb8399f1d0474f0aca86f1658dc94f5bf0c90f6146352de150692de8862.json +1 -0
  273. xinference/web/ui/node_modules/.cache/babel-loader/a0dfafa06b2bb7cba8cad41c482503f61944f759f4318139362602ef5cc47ccb.json +1 -0
  274. xinference/web/ui/node_modules/.cache/babel-loader/a3ff866acddf34917a7ee399e0e571a4dfd8ba66d5057db885f243e16a6eb17d.json +1 -0
  275. xinference/web/ui/node_modules/.cache/babel-loader/afb8084f539534cd594755ea2205ecd5bd1f62dddcfdf75a2eace59a28131278.json +1 -0
  276. xinference/web/ui/node_modules/.cache/babel-loader/b57b1438b77294c1f3f6cfce12ac487d8106c6f016975ba0aec94d98997e2e1e.json +1 -0
  277. xinference/web/ui/node_modules/.cache/babel-loader/b9917b0bf8e4d55ccbac1c334aa04d6ff3c5b6ed9e5d38b9ea2c687fa7d3f5a9.json +1 -0
  278. xinference/web/ui/node_modules/.cache/babel-loader/bbcc94b0149963d1d6f267ee1f4f03d3925b758392ce2f516c3fe8af0e0169fc.json +1 -0
  279. xinference/web/ui/node_modules/.cache/babel-loader/bdee44abeadc4abc17d41c52eb49c6e19a4b1a267b6e16876ce91bdeeebfc52d.json +1 -0
  280. xinference/web/ui/node_modules/.cache/babel-loader/beb112b70f4a56db95920a9e20efb6c97c37b68450716730217a9ee1a9ae92be.json +1 -0
  281. xinference/web/ui/node_modules/.cache/babel-loader/c88db97be0cdf440193b3995996e83510a04cb00048135485fc0e26d197e80b5.json +1 -0
  282. xinference/web/ui/node_modules/.cache/babel-loader/d49e5314d34310a62d01a03067ce1bec5da00abce84c5196aa9c6842fa79a430.json +1 -0
  283. xinference/web/ui/node_modules/.cache/babel-loader/d7664d18c4ddbad9c3a6a31b91f7c00fb0dde804608674a9860ee50f33e54708.json +1 -0
  284. xinference/web/ui/node_modules/.cache/babel-loader/d9072c318b819b7c90a0f7e9cc0b6413b4dbeb8e9859898e53d75ea882fcde99.json +1 -0
  285. xinference/web/ui/node_modules/.cache/babel-loader/db16a983bc08a05f0439cc61ca0840e49e1d8400eef678909f16c032a418a3d6.json +1 -0
  286. xinference/web/ui/node_modules/.cache/babel-loader/dc249829767b8abcbc3677e0b07b6d3ecbfdfe6d08cfe23a665eb33373a9aa9d.json +1 -0
  287. xinference/web/ui/node_modules/.cache/babel-loader/e242c583c2dbc2784f0fcf513523975f7d5df447e106c1c17e49e8578a6fc3ed.json +1 -0
  288. xinference/web/ui/node_modules/.cache/babel-loader/eac5f1296513e69e4b96f750ddccd4d0264e2bae4e4c449144e83274a48698d9.json +1 -0
  289. xinference/web/ui/node_modules/.cache/babel-loader/ed57202cb79649bb716400436590245547df241988fc7c8e1d85d132299542d2.json +1 -0
  290. xinference/web/ui/node_modules/.cache/babel-loader/f125bf72e773a14cdaebd0c343e80adb909d12e317ee5c00cd4a57442fbe2c62.json +1 -0
  291. xinference/web/ui/node_modules/.cache/babel-loader/f91af913d7f91c410719ab13136aaed3aaf0f8dda06652f25c42cb5231587398.json +1 -0
  292. xinference/web/ui/node_modules/.package-lock.json +67 -3
  293. xinference/web/ui/node_modules/@babel/runtime/package.json +592 -538
  294. xinference/web/ui/node_modules/html-parse-stringify/package.json +50 -0
  295. xinference/web/ui/node_modules/i18next/dist/esm/package.json +1 -0
  296. xinference/web/ui/node_modules/i18next/package.json +129 -0
  297. xinference/web/ui/node_modules/react-i18next/.eslintrc.json +74 -0
  298. xinference/web/ui/node_modules/react-i18next/dist/es/package.json +1 -0
  299. xinference/web/ui/node_modules/react-i18next/package.json +162 -0
  300. xinference/web/ui/node_modules/void-elements/package.json +34 -0
  301. xinference/web/ui/package-lock.json +69 -3
  302. xinference/web/ui/package.json +2 -0
  303. xinference/web/ui/src/locales/en.json +186 -0
  304. xinference/web/ui/src/locales/zh.json +186 -0
  305. {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/METADATA +68 -32
  306. {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/RECORD +316 -122
  307. xinference/thirdparty/cosyvoice/bin/export_trt.py +0 -8
  308. xinference/thirdparty/fish_speech/tools/api.py +0 -943
  309. xinference/thirdparty/fish_speech/tools/msgpack_api.py +0 -95
  310. xinference/thirdparty/fish_speech/tools/webui.py +0 -548
  311. xinference/web/ui/build/static/css/main.5061c4c3.css +0 -2
  312. xinference/web/ui/build/static/css/main.5061c4c3.css.map +0 -1
  313. xinference/web/ui/build/static/js/main.2f269bb3.js +0 -3
  314. xinference/web/ui/build/static/js/main.2f269bb3.js.map +0 -1
  315. xinference/web/ui/node_modules/.cache/babel-loader/07ce9e632e6aff24d7aa3ad8e48224433bbfeb0d633fca723453f1fcae0c9f1c.json +0 -1
  316. xinference/web/ui/node_modules/.cache/babel-loader/1130403f9e46f5738a23b45ac59b57de8f360c908c713e2c0670c2cce9bd367a.json +0 -1
  317. xinference/web/ui/node_modules/.cache/babel-loader/131091b25d26b17cdca187d7542a21475c211138d900cf667682260e76ef9463.json +0 -1
  318. xinference/web/ui/node_modules/.cache/babel-loader/1f269fb2a368363c1cb2237825f1dba093b6bdd8c44cc05954fd19ec2c1fff03.json +0 -1
  319. xinference/web/ui/node_modules/.cache/babel-loader/331312668fa8bd3d7401818f4a25fa98135d7f61371cd6bfff78b18cf4fbdd92.json +0 -1
  320. xinference/web/ui/node_modules/.cache/babel-loader/40f17338fc75ae095de7d2b4d8eae0d5ca0193a7e2bcece4ee745b22a7a2f4b7.json +0 -1
  321. xinference/web/ui/node_modules/.cache/babel-loader/4de9a6942c5f1749d6cbfdd54279699975f16016b182848bc253886f52ec2ec3.json +0 -1
  322. xinference/web/ui/node_modules/.cache/babel-loader/822586ed1077201b64b954f12f25e3f9b45678c1acbabe53d8af3ca82ca71f33.json +0 -1
  323. xinference/web/ui/node_modules/.cache/babel-loader/8d33354bd2100c8602afc3341f131a88cc36aaeecd5a4b365ed038514708e350.json +0 -1
  324. xinference/web/ui/node_modules/.cache/babel-loader/9375a35b05d56989b2755bf72161fa707c92f28569d33765a75f91a568fda6e9.json +0 -1
  325. xinference/web/ui/node_modules/.cache/babel-loader/a158a9ffa0c9b169aee53dd4a0c44501a596755b4e4f6ede7746d65a72e2a71f.json +0 -1
  326. xinference/web/ui/node_modules/.cache/babel-loader/bd6ad8159341315a1764c397621a560809f7eb7219ab5174c801fca7e969d943.json +0 -1
  327. xinference/web/ui/node_modules/.cache/babel-loader/c7bf40bab396765f67d0fed627ed3665890608b2d0edaa3e8cb7cfc96310db45.json +0 -1
  328. xinference/web/ui/node_modules/.cache/babel-loader/d6c643278a0b28320e6f33a60f5fb64c053997cbdc39a60e53ccc574688ade9e.json +0 -1
  329. xinference/web/ui/node_modules/.cache/babel-loader/e42b72d4cc1ea412ebecbb8d040dc6c6bfee462c33903c2f1f3facb602ad742e.json +0 -1
  330. xinference/web/ui/node_modules/.cache/babel-loader/e64b7e8cedcf43d4c95deba60ec1341855c887705805bb62431693118b870c69.json +0 -1
  331. xinference/web/ui/node_modules/.cache/babel-loader/f5039ddbeb815c51491a1989532006b96fc3ae49c6c60e3c097f875b4ae915ae.json +0 -1
  332. xinference/web/ui/node_modules/.cache/babel-loader/f72f011744c4649fabddca6f7a9327861ac0a315a89b1a2e62a39774e7863845.json +0 -1
  333. xinference/web/ui/node_modules/.cache/babel-loader/feabb04b4aa507102da0a64398a40818e878fd1df9b75dda8461b3e1e7ff3f11.json +0 -1
  334. /xinference/thirdparty/{cosyvoice/bin → f5_tts}/__init__.py +0 -0
  335. /xinference/thirdparty/{cosyvoice/flow → melo}/__init__.py +0 -0
  336. /xinference/thirdparty/{cosyvoice/hifigan → melo/text/english_utils}/__init__.py +0 -0
  337. /xinference/thirdparty/{cosyvoice/llm → melo/text/es_phonemizer}/__init__.py +0 -0
  338. /xinference/thirdparty/{fish_speech/tools → melo/text/fr_phonemizer}/__init__.py +0 -0
  339. /xinference/web/ui/build/static/js/{main.2f269bb3.js.LICENSE.txt → main.b0936c54.js.LICENSE.txt} +0 -0
  340. {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/LICENSE +0 -0
  341. {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/WHEEL +0 -0
  342. {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/entry_points.txt +0 -0
  343. {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _defineProperty from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import AddIcon from'@mui/icons-material/Add';import DeleteIcon from'@mui/icons-material/Delete';import{Alert,Box,Button,FormControlLabel,Radio,RadioGroup,TextField,Tooltip}from'@mui/material';import React,{useEffect,useState}from'react';import{useTranslation}from'react-i18next';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";import{Fragment as _Fragment}from\"react/jsx-runtime\";var modelFormatArr=[{value:'pytorch',label:'PyTorch'},{value:'ggufv2',label:'GGUF'},{value:'gptq',label:'GPTQ'},{value:'awq',label:'AWQ'},{value:'fp8',label:'FP8'},{value:'mlx',label:'MLX'}];var AddModelSpecs=function AddModelSpecs(_ref){var isJump=_ref.isJump,formData=_ref.formData,specsDataArr=_ref.specsDataArr,onGetArr=_ref.onGetArr,scrollRef=_ref.scrollRef;var _useState=useState(0),_useState2=_slicedToArray(_useState,2),count=_useState2[0],setCount=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),specsArr=_useState4[0],setSpecsArr=_useState4[1];var _useState5=useState([]),_useState6=_slicedToArray(_useState5,2),pathArr=_useState6[0],setPathArr=_useState6[1];var _useState7=useState([]),_useState8=_slicedToArray(_useState7,2),modelSizeAlertId=_useState8[0],setModelSizeAlertId=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),quantizationAlertId=_useState10[0],setQuantizationAlertId=_useState10[1];var _useState11=useState(false),_useState12=_slicedToArray(_useState11,2),isError=_useState12[0],setIsError=_useState12[1];var _useState13=useState(false),_useState14=_slicedToArray(_useState13,2),isAdd=_useState14[0],setIsAdd=_useState14[1];var _useTranslation=useTranslation(),t=_useTranslation.t;useEffect(function(){if(isJump){var dataArr=specsDataArr.map(function(item,index){var model_uri=item.model_uri,model_size_in_billions=item.model_size_in_billions,model_format=item.model_format,quantizations=item.quantizations,model_file_name_template=item.model_file_name_template;var size=model_size_in_billions;if(typeof size!=='number')size=size.split('_').join('.');return{id:index,model_uri:model_uri,model_size_in_billions:size,model_format:model_format,quantizations:quantizations,model_file_name_template:model_file_name_template};});setCount(dataArr.length);setSpecsArr(dataArr);var subPathArr=[];specsDataArr.forEach(function(item){if(item.model_format!=='ggufv2'){subPathArr.push(item.model_uri);}else{subPathArr.push(item.model_uri+'/'+item.model_file_name_template);}});setPathArr(subPathArr);}else{setSpecsArr([_objectSpread({id:count},formData)]);setCount(count+1);setPathArr([formData.model_uri]);}},[]);useEffect(function(){var arr=specsArr.map(function(item){var uri=item.model_uri,size=item.model_size_in_billions,modelFormat=item.model_format,quantizations=item.quantizations,model_file_name_template=item.model_file_name_template;var handleSize=parseInt(size)===parseFloat(size)?Number(size):size.split('.').join('_');var handleQuantization=quantizations;if(modelFormat==='pytorch'){handleQuantization=['none'];}else if(handleQuantization[0]===''&&modelFormat==='ggufv2'){handleQuantization=['default'];}return{model_uri:uri,model_size_in_billions:handleSize,model_format:modelFormat,quantizations:handleQuantization,model_file_name_template:model_file_name_template};});setIsError(true);if(modelSizeAlertId.length===0&&quantizationAlertId.length===0){setIsError(false);}onGetArr(arr,isError);isAdd&&handleScrollBottom();setIsAdd(false);},[specsArr,isError]);var handleAddSpecs=function handleAddSpecs(){setCount(count+1);var item={id:count,model_uri:'/path/to/llama-1',model_size_in_billions:7,model_format:'pytorch',quantizations:[]};setSpecsArr([].concat(_toConsumableArray(specsArr),[item]));setIsAdd(true);setPathArr([].concat(_toConsumableArray(pathArr),['/path/to/llama-1']));};var handleUpdateSpecsArr=function handleUpdateSpecsArr(index,type,newValue){if(type==='model_format'){var subPathArr=_toConsumableArray(pathArr);if(specsArr[index].model_format!=='ggufv2'){pathArr[index]=specsArr[index].model_uri;}else{pathArr[index]=specsArr[index].model_uri+'/'+specsArr[index].model_file_name_template;}setPathArr(subPathArr);}setSpecsArr(specsArr.map(function(item,subIndex){if(subIndex===index){if(type==='quantizations'){return _objectSpread(_objectSpread({},item),{},_defineProperty({},type,[newValue]));}else if(type==='model_format'){if(newValue==='ggufv2'){var _getPathComponents=getPathComponents(pathArr[index]),baseDir=_getPathComponents.baseDir,filename=_getPathComponents.filename;var obj=_objectSpread(_objectSpread({},item),{},{model_format:newValue,quantizations:[''],model_uri:baseDir,model_file_name_template:filename});return obj;}else{var _ref2;var id=item.id,model_size_in_billions=item.model_size_in_billions,model_format=item.model_format;return _ref2={id:id,model_uri:pathArr[index],model_size_in_billions:model_size_in_billions,model_format:model_format},_defineProperty(_ref2,type,newValue),_defineProperty(_ref2,\"quantizations\",['']),_ref2;}}else if(type==='model_uri'){var _subPathArr=_toConsumableArray(pathArr);_subPathArr[index]=newValue;setPathArr(_subPathArr);if(item.model_format==='ggufv2'){var _getPathComponents2=getPathComponents(newValue),_baseDir=_getPathComponents2.baseDir,_filename=_getPathComponents2.filename;var _obj=_objectSpread(_objectSpread({},item),{},{model_uri:_baseDir,model_file_name_template:_filename});return _obj;}else{return _objectSpread(_objectSpread({},item),{},_defineProperty({},type,newValue));}}else{return _objectSpread(_objectSpread({},item),{},_defineProperty({},type,newValue));}}return item;}));};var handleDeleteSpecs=function handleDeleteSpecs(index){setSpecsArr(specsArr.filter(function(_,subIndex){return index!==subIndex;}));};var getPathComponents=function getPathComponents(path){var normalizedPath=path.replace(/\\\\/g,'/');var baseDir=normalizedPath.substring(0,normalizedPath.lastIndexOf('/'));var filename=normalizedPath.substring(normalizedPath.lastIndexOf('/')+1);return{baseDir:baseDir,filename:filename};};var handleModelSize=function handleModelSize(index,value,id){setModelSizeAlertId(modelSizeAlertId.filter(function(item){return item!==id;}));handleUpdateSpecsArr(index,'model_size_in_billions',value);if(value!==''&&(!Number(value)||Number(value)<=0)){var modelSizeAlertIdArr=Array.from(new Set([].concat(_toConsumableArray(modelSizeAlertId),[id])));setModelSizeAlertId(modelSizeAlertIdArr);}};var handleQuantization=function handleQuantization(model_format,index,value,id){setQuantizationAlertId(quantizationAlertId.filter(function(item){return item!==id;}));handleUpdateSpecsArr(index,'quantizations',value);if((model_format==='gptq'||model_format==='awq'||model_format==='fp8'||model_format==='mlx')&&value===''){var quantizationAlertIdArr=Array.from(new Set([].concat(_toConsumableArray(quantizationAlertId),[id])));setQuantizationAlertId(quantizationAlertIdArr);}};var handleScrollBottom=function handleScrollBottom(){scrollRef.current.scrollTo({top:scrollRef.current.scrollHeight,behavior:'smooth'});};return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'flex',alignItems:'center',marginBottom:10},children:[/*#__PURE__*/_jsx(\"label\",{style:{width:'100px'},children:t('registerModel.modelSpecs')}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",size:\"small\",endIcon:/*#__PURE__*/_jsx(AddIcon,{}),className:\"addBtn\",onClick:handleAddSpecs,children:t('registerModel.more')})]}),/*#__PURE__*/_jsx(\"div\",{className:\"specs_container\",children:specsArr.map(function(item,index){return/*#__PURE__*/_jsxs(\"div\",{className:\"item\",children:[/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5},children:t('registerModel.modelFormat')}),/*#__PURE__*/_jsx(RadioGroup,{value:item.model_format,onChange:function onChange(e){handleUpdateSpecsArr(index,'model_format',e.target.value);if(e.target.value==='gptq'||e.target.value==='awq'||e.target.value==='fp8'||e.target.value==='mlx'){var quantizationAlertIdArr=Array.from(new Set([].concat(_toConsumableArray(quantizationAlertId),[item.id])));setQuantizationAlertId(quantizationAlertIdArr);}else{setQuantizationAlertId([]);}},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:modelFormatArr.map(function(item){return/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:item.value,control:/*#__PURE__*/_jsx(Radio,{}),label:item.label})},item.value);})})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:item.model_uri!==''?false:true,style:{minWidth:'60%'},label:t('registerModel.modelPath'),size:\"small\",value:item.model_format!=='ggufv2'?item.model_uri:item.model_uri+'/'+item.model_file_name_template,onChange:function onChange(e){handleUpdateSpecsArr(index,'model_uri',e.target.value);},helperText:t('registerModel.provideModelDirectoryOrFilePath')}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:Number(item.model_size_in_billions)>0?false:true,label:t('registerModel.modelSizeBillions'),size:\"small\",value:item.model_size_in_billions,onChange:function onChange(e){handleModelSize(index,e.target.value,item.id);}}),modelSizeAlertId.includes(item.id)&&/*#__PURE__*/_jsx(Alert,{severity:\"error\",children:t('registerModel.enterNumberGreaterThanZero')}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),item.model_format!=='pytorch'&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(TextField,{style:{minWidth:'60%'},label:item.model_format==='gptq'||item.model_format==='awq'||item.model_format==='fp8'||item.model_format==='mlx'?t('registerModel.quantization'):t('registerModel.quantizationOptional'),size:\"small\",value:item.quantizations[0],onChange:function onChange(e){handleQuantization(item.model_format,index,e.target.value,item.id);},helperText:item.model_format==='gptq'||item.model_format==='awq'||item.model_format==='fp8'||item.model_format==='mlx'?t('registerModel.carefulQuantizationForModelRegistration'):''}),item.model_format!=='ggufv2'&&quantizationAlertId.includes(item.id)&&item.quantizations[0]==''&&/*#__PURE__*/_jsx(Alert,{severity:\"error\",children:t('registerModel.quantizationCannotBeEmpty')})]}),specsArr.length>1&&/*#__PURE__*/_jsx(Tooltip,{title:t('registerModel.delete'),placement:\"top\",children:/*#__PURE__*/_jsx(\"div\",{className:\"deleteBtn\",onClick:function onClick(){return handleDeleteSpecs(index);},children:/*#__PURE__*/_jsx(DeleteIcon,{className:\"deleteIcon\"})})})]},item.id);})})]});};export default AddModelSpecs;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',alignItems:'center',width:'100%'}};","map":{"version":3,"names":["AddIcon","DeleteIcon","Alert","Box","Button","FormControlLabel","Radio","RadioGroup","TextField","Tooltip","React","useEffect","useState","useTranslation","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","modelFormatArr","value","label","AddModelSpecs","_ref","isJump","formData","specsDataArr","onGetArr","scrollRef","_useState","_useState2","_slicedToArray","count","setCount","_useState3","_useState4","specsArr","setSpecsArr","_useState5","_useState6","pathArr","setPathArr","_useState7","_useState8","modelSizeAlertId","setModelSizeAlertId","_useState9","_useState10","quantizationAlertId","setQuantizationAlertId","_useState11","_useState12","isError","setIsError","_useState13","_useState14","isAdd","setIsAdd","_useTranslation","t","dataArr","map","item","index","model_uri","model_size_in_billions","model_format","quantizations","model_file_name_template","size","split","join","id","length","subPathArr","forEach","push","_objectSpread","arr","uri","modelFormat","handleSize","parseInt","parseFloat","Number","handleQuantization","handleScrollBottom","handleAddSpecs","concat","_toConsumableArray","handleUpdateSpecsArr","type","newValue","subIndex","_defineProperty","_getPathComponents","getPathComponents","baseDir","filename","obj","_ref2","_getPathComponents2","handleDeleteSpecs","filter","_","path","normalizedPath","replace","substring","lastIndexOf","handleModelSize","modelSizeAlertIdArr","Array","from","Set","quantizationAlertIdArr","current","scrollTo","top","scrollHeight","behavior","children","style","display","alignItems","marginBottom","width","variant","endIcon","className","onClick","paddingLeft","onChange","e","target","sx","styles","checkboxWrapper","marginLeft","control","padding","error","minWidth","helperText","includes","severity","title","placement","baseFormControl","margin","flexWrap"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/components/addModelSpecs.js"],"sourcesContent":["import AddIcon from '@mui/icons-material/Add'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport {\n Alert,\n Box,\n Button,\n FormControlLabel,\n Radio,\n RadioGroup,\n TextField,\n Tooltip,\n} from '@mui/material'\nimport React, { useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nconst modelFormatArr = [\n { value: 'pytorch', label: 'PyTorch' },\n { value: 'ggufv2', label: 'GGUF' },\n { value: 'gptq', label: 'GPTQ' },\n { value: 'awq', label: 'AWQ' },\n { value: 'fp8', label: 'FP8' },\n { value: 'mlx', label: 'MLX' },\n]\n\nconst AddModelSpecs = ({\n isJump,\n formData,\n specsDataArr,\n onGetArr,\n scrollRef,\n}) => {\n const [count, setCount] = useState(0)\n const [specsArr, setSpecsArr] = useState([])\n const [pathArr, setPathArr] = useState([])\n const [modelSizeAlertId, setModelSizeAlertId] = useState([])\n const [quantizationAlertId, setQuantizationAlertId] = useState([])\n const [isError, setIsError] = useState(false)\n const [isAdd, setIsAdd] = useState(false)\n const { t } = useTranslation()\n\n useEffect(() => {\n if (isJump) {\n const dataArr = specsDataArr.map((item, index) => {\n const {\n model_uri,\n model_size_in_billions,\n model_format,\n quantizations,\n model_file_name_template,\n } = item\n let size = model_size_in_billions\n if (typeof size !== 'number') size = size.split('_').join('.')\n\n return {\n id: index,\n model_uri,\n model_size_in_billions: size,\n model_format,\n quantizations,\n model_file_name_template,\n }\n })\n setCount(dataArr.length)\n setSpecsArr(dataArr)\n\n const subPathArr = []\n specsDataArr.forEach((item) => {\n if (item.model_format !== 'ggufv2') {\n subPathArr.push(item.model_uri)\n } else {\n subPathArr.push(item.model_uri + '/' + item.model_file_name_template)\n }\n })\n setPathArr(subPathArr)\n } else {\n setSpecsArr([\n {\n id: count,\n ...formData,\n },\n ])\n setCount(count + 1)\n setPathArr([formData.model_uri])\n }\n }, [])\n\n useEffect(() => {\n const arr = specsArr.map((item) => {\n const {\n model_uri: uri,\n model_size_in_billions: size,\n model_format: modelFormat,\n quantizations,\n model_file_name_template,\n } = item\n const handleSize =\n parseInt(size) === parseFloat(size)\n ? Number(size)\n : size.split('.').join('_')\n\n let handleQuantization = quantizations\n if (modelFormat === 'pytorch') {\n handleQuantization = ['none']\n } else if (handleQuantization[0] === '' && modelFormat === 'ggufv2') {\n handleQuantization = ['default']\n }\n\n return {\n model_uri: uri,\n model_size_in_billions: handleSize,\n model_format: modelFormat,\n quantizations: handleQuantization,\n model_file_name_template,\n }\n })\n setIsError(true)\n if (modelSizeAlertId.length === 0 && quantizationAlertId.length === 0) {\n setIsError(false)\n }\n onGetArr(arr, isError)\n isAdd && handleScrollBottom()\n setIsAdd(false)\n }, [specsArr, isError])\n\n const handleAddSpecs = () => {\n setCount(count + 1)\n const item = {\n id: count,\n model_uri: '/path/to/llama-1',\n model_size_in_billions: 7,\n model_format: 'pytorch',\n quantizations: [],\n }\n setSpecsArr([...specsArr, item])\n setIsAdd(true)\n setPathArr([...pathArr, '/path/to/llama-1'])\n }\n\n const handleUpdateSpecsArr = (index, type, newValue) => {\n if (type === 'model_format') {\n const subPathArr = [...pathArr]\n if (specsArr[index].model_format !== 'ggufv2') {\n pathArr[index] = specsArr[index].model_uri\n } else {\n pathArr[index] =\n specsArr[index].model_uri +\n '/' +\n specsArr[index].model_file_name_template\n }\n setPathArr(subPathArr)\n }\n\n setSpecsArr(\n specsArr.map((item, subIndex) => {\n if (subIndex === index) {\n if (type === 'quantizations') {\n return { ...item, [type]: [newValue] }\n } else if (type === 'model_format') {\n if (newValue === 'ggufv2') {\n const { baseDir, filename } = getPathComponents(pathArr[index])\n const obj = {\n ...item,\n model_format: newValue,\n quantizations: [''],\n model_uri: baseDir,\n model_file_name_template: filename,\n }\n return obj\n } else {\n const { id, model_size_in_billions, model_format } = item\n return {\n id,\n model_uri: pathArr[index],\n model_size_in_billions,\n model_format,\n [type]: newValue,\n quantizations: [''],\n }\n }\n } else if (type === 'model_uri') {\n const subPathArr = [...pathArr]\n subPathArr[index] = newValue\n setPathArr(subPathArr)\n if (item.model_format === 'ggufv2') {\n const { baseDir, filename } = getPathComponents(newValue)\n const obj = {\n ...item,\n model_uri: baseDir,\n model_file_name_template: filename,\n }\n return obj\n } else {\n return { ...item, [type]: newValue }\n }\n } else {\n return { ...item, [type]: newValue }\n }\n }\n return item\n })\n )\n }\n\n const handleDeleteSpecs = (index) => {\n setSpecsArr(specsArr.filter((_, subIndex) => index !== subIndex))\n }\n\n const getPathComponents = (path) => {\n const normalizedPath = path.replace(/\\\\/g, '/')\n const baseDir = normalizedPath.substring(0, normalizedPath.lastIndexOf('/'))\n const filename = normalizedPath.substring(\n normalizedPath.lastIndexOf('/') + 1\n )\n return { baseDir, filename }\n }\n\n const handleModelSize = (index, value, id) => {\n setModelSizeAlertId(modelSizeAlertId.filter((item) => item !== id))\n handleUpdateSpecsArr(index, 'model_size_in_billions', value)\n if (value !== '' && (!Number(value) || Number(value) <= 0)) {\n const modelSizeAlertIdArr = Array.from(new Set([...modelSizeAlertId, id]))\n setModelSizeAlertId(modelSizeAlertIdArr)\n }\n }\n\n const handleQuantization = (model_format, index, value, id) => {\n setQuantizationAlertId(quantizationAlertId.filter((item) => item !== id))\n handleUpdateSpecsArr(index, 'quantizations', value)\n if (\n (model_format === 'gptq' ||\n model_format === 'awq' ||\n model_format === 'fp8' ||\n model_format === 'mlx') &&\n value === ''\n ) {\n const quantizationAlertIdArr = Array.from(\n new Set([...quantizationAlertId, id])\n )\n setQuantizationAlertId(quantizationAlertIdArr)\n }\n }\n\n const handleScrollBottom = () => {\n scrollRef.current.scrollTo({\n top: scrollRef.current.scrollHeight,\n behavior: 'smooth',\n })\n }\n\n return (\n <>\n <div style={{ display: 'flex', alignItems: 'center', marginBottom: 10 }}>\n <label style={{ width: '100px' }}>\n {t('registerModel.modelSpecs')}\n </label>\n <Button\n variant=\"contained\"\n size=\"small\"\n endIcon={<AddIcon />}\n className=\"addBtn\"\n onClick={handleAddSpecs}\n >\n {t('registerModel.more')}\n </Button>\n </div>\n <div className=\"specs_container\">\n {specsArr.map((item, index) => (\n <div className=\"item\" key={item.id}>\n <label\n style={{\n paddingLeft: 5,\n }}\n >\n {t('registerModel.modelFormat')}\n </label>\n <RadioGroup\n value={item.model_format}\n onChange={(e) => {\n handleUpdateSpecsArr(index, 'model_format', e.target.value)\n if (\n e.target.value === 'gptq' ||\n e.target.value === 'awq' ||\n e.target.value === 'fp8' ||\n e.target.value === 'mlx'\n ) {\n const quantizationAlertIdArr = Array.from(\n new Set([...quantizationAlertId, item.id])\n )\n setQuantizationAlertId(quantizationAlertIdArr)\n } else {\n setQuantizationAlertId([])\n }\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n {modelFormatArr.map((item) => (\n <Box key={item.value} sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value={item.value}\n control={<Radio />}\n label={item.label}\n />\n </Box>\n ))}\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={item.model_uri !== '' ? false : true}\n style={{ minWidth: '60%' }}\n label={t('registerModel.modelPath')}\n size=\"small\"\n value={\n item.model_format !== 'ggufv2'\n ? item.model_uri\n : item.model_uri + '/' + item.model_file_name_template\n }\n onChange={(e) => {\n handleUpdateSpecsArr(index, 'model_uri', e.target.value)\n }}\n helperText={t('registerModel.provideModelDirectoryOrFilePath')}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={Number(item.model_size_in_billions) > 0 ? false : true}\n label={t('registerModel.modelSizeBillions')}\n size=\"small\"\n value={item.model_size_in_billions}\n onChange={(e) => {\n handleModelSize(index, e.target.value, item.id)\n }}\n />\n {modelSizeAlertId.includes(item.id) && (\n <Alert severity=\"error\">\n {t('registerModel.enterNumberGreaterThanZero')}\n </Alert>\n )}\n <Box padding=\"15px\"></Box>\n\n {item.model_format !== 'pytorch' && (\n <>\n <TextField\n style={{ minWidth: '60%' }}\n label={\n item.model_format === 'gptq' ||\n item.model_format === 'awq' ||\n item.model_format === 'fp8' ||\n item.model_format === 'mlx'\n ? t('registerModel.quantization')\n : t('registerModel.quantizationOptional')\n }\n size=\"small\"\n value={item.quantizations[0]}\n onChange={(e) => {\n handleQuantization(\n item.model_format,\n index,\n e.target.value,\n item.id\n )\n }}\n helperText={\n item.model_format === 'gptq' ||\n item.model_format === 'awq' ||\n item.model_format === 'fp8' ||\n item.model_format === 'mlx'\n ? t(\n 'registerModel.carefulQuantizationForModelRegistration'\n )\n : ''\n }\n />\n {item.model_format !== 'ggufv2' &&\n quantizationAlertId.includes(item.id) &&\n item.quantizations[0] == '' && (\n <Alert severity=\"error\">\n {t('registerModel.quantizationCannotBeEmpty')}\n </Alert>\n )}\n </>\n )}\n\n {specsArr.length > 1 && (\n <Tooltip title={t('registerModel.delete')} placement=\"top\">\n <div\n className=\"deleteBtn\"\n onClick={() => handleDeleteSpecs(index)}\n >\n <DeleteIcon className=\"deleteIcon\" />\n </div>\n </Tooltip>\n )}\n </div>\n ))}\n </div>\n </>\n )\n}\n\nexport default AddModelSpecs\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n width: '100%',\n },\n}\n"],"mappings":"6jBAAA,MAAO,CAAAA,OAAO,KAAM,yBAAyB,CAC7C,MAAO,CAAAC,UAAU,KAAM,4BAA4B,CACnD,OACEC,KAAK,CACLC,GAAG,CACHC,MAAM,CACNC,gBAAgB,CAChBC,KAAK,CACLC,UAAU,CACVC,SAAS,CACTC,OAAO,KACF,eAAe,CACtB,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAClD,OAASC,cAAc,KAAQ,eAAe,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,gCAAAC,QAAA,IAAAC,SAAA,yBAE9C,GAAM,CAAAC,cAAc,CAAG,CACrB,CAAEC,KAAK,CAAE,SAAS,CAAEC,KAAK,CAAE,SAAU,CAAC,CACtC,CAAED,KAAK,CAAE,QAAQ,CAAEC,KAAK,CAAE,MAAO,CAAC,CAClC,CAAED,KAAK,CAAE,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AAI,CAAE,OACR,CAAC,CACDoE,eAAe,CAAE,CACfd,OAAO,CAAE,MAAM,CACf2B,QAAQ,CAAE,MAAM,CAChB1B,UAAU,CAAE,QAAQ,CACpBE,KAAK,CAAE,MACT,CACF,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _defineProperty from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _toConsumableArray from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _objectWithoutProperties from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nimport _objectSpread from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nvar _excluded = [\"format\"],\n _excluded2 = [\"children\", \"count\", \"parent\", \"i18nKey\", \"context\", \"tOptions\", \"values\", \"defaults\", \"components\", \"ns\", \"i18n\", \"t\", \"shouldUnescape\"];\nimport { Fragment, isValidElement, cloneElement, createElement, Children } from 'react';\nimport HTML from 'html-parse-stringify';\nimport { isObject, isString, warn, warnOnce } from './utils.js';\nimport { getDefaults } from './defaults.js';\nimport { getI18n } from './i18nInstance.js';\nvar hasChildren = function hasChildren(node, checkLength) {\n var _node$props$children, _node$props;\n if (!node) return false;\n var base = (_node$props$children = (_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.children) !== null && _node$props$children !== void 0 ? _node$props$children : node.children;\n if (checkLength) return base.length > 0;\n return !!base;\n};\nvar getChildren = function getChildren(node) {\n var _node$props$children2, _node$props2, _node$props3;\n if (!node) return [];\n var children = (_node$props$children2 = (_node$props2 = node.props) === null || _node$props2 === void 0 ? void 0 : _node$props2.children) !== null && _node$props$children2 !== void 0 ? _node$props$children2 : node.children;\n return (_node$props3 = node.props) !== null && _node$props3 !== void 0 && _node$props3.i18nIsDynamicList ? getAsArray(children) : children;\n};\nvar hasValidReactChildren = function hasValidReactChildren(children) {\n return Array.isArray(children) && children.every(isValidElement);\n};\nvar getAsArray = function getAsArray(data) {\n return Array.isArray(data) ? data : [data];\n};\nvar mergeProps = function mergeProps(source, target) {\n var newTarget = _objectSpread({}, target);\n newTarget.props = Object.assign(source.props, target.props);\n return newTarget;\n};\nexport var nodesToString = function nodesToString(children, i18nOptions, i18n, i18nKey) {\n var _i18nOptions$transKee;\n if (!children) return '';\n var stringNode = '';\n var childrenArray = getAsArray(children);\n var keepArray = i18nOptions !== null && i18nOptions !== void 0 && i18nOptions.transSupportBasicHtmlNodes ? (_i18nOptions$transKee = i18nOptions.transKeepBasicHtmlNodesFor) !== null && _i18nOptions$transKee !== void 0 ? _i18nOptions$transKee : [] : [];\n childrenArray.forEach(function (child, childIndex) {\n if (isString(child)) {\n stringNode += \"\".concat(child);\n return;\n }\n if (isValidElement(child)) {\n var props = child.props,\n type = child.type;\n var childPropsCount = Object.keys(props).length;\n var shouldKeepChild = keepArray.indexOf(type) > -1;\n var childChildren = props.children;\n if (!childChildren && shouldKeepChild && !childPropsCount) {\n stringNode += \"<\".concat(type, \"/>\");\n return;\n }\n if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {\n stringNode += \"<\".concat(childIndex, \"></\").concat(childIndex, \">\");\n return;\n }\n if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {\n stringNode += \"<\".concat(type, \">\").concat(childChildren, \"</\").concat(type, \">\");\n return;\n }\n var content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);\n stringNode += \"<\".concat(childIndex, \">\").concat(content, \"</\").concat(childIndex, \">\");\n return;\n }\n if (child === null) {\n warn(i18n, 'TRANS_NULL_VALUE', \"Passed in a null value as child\", {\n i18nKey: i18nKey\n });\n return;\n }\n if (isObject(child)) {\n var format = child.format,\n clone = _objectWithoutProperties(child, _excluded);\n var keys = Object.keys(clone);\n if (keys.length === 1) {\n var value = format ? \"\".concat(keys[0], \", \").concat(format) : keys[0];\n stringNode += \"{{\".concat(value, \"}}\");\n return;\n }\n warn(i18n, 'TRANS_INVALID_OBJ', \"Invalid child - Object should only have keys {{ value, format }} (format is optional).\", {\n i18nKey: i18nKey,\n child: child\n });\n return;\n }\n warn(i18n, 'TRANS_INVALID_VAR', \"Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.\", {\n i18nKey: i18nKey,\n child: child\n });\n });\n return stringNode;\n};\nvar renderNodes = function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {\n if (targetString === '') return [];\n var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];\n var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map(function (keep) {\n return \"<\".concat(keep);\n }).join('|')).test(targetString);\n if (!children && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];\n var data = {};\n var getData = function getData(childs) {\n var childrenArray = getAsArray(childs);\n childrenArray.forEach(function (child) {\n if (isString(child)) return;\n if (hasChildren(child)) getData(getChildren(child));else if (isObject(child) && !isValidElement(child)) Object.assign(data, child);\n });\n };\n getData(children);\n var ast = HTML.parse(\"<0>\".concat(targetString, \"</0>\"));\n var opts = _objectSpread(_objectSpread({}, data), combinedTOpts);\n var renderInner = function renderInner(child, node, rootReactNode) {\n var _child$props;\n var childs = getChildren(child);\n var mappedChildren = mapAST(childs, node.children, rootReactNode);\n return hasValidReactChildren(childs) && mappedChildren.length === 0 || (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.i18nIsDynamicList ? childs : mappedChildren;\n };\n var pushTranslatedJSX = function pushTranslatedJSX(child, inner, mem, i, isVoid) {\n if (child.dummy) {\n child.children = inner;\n mem.push(cloneElement(child, {\n key: i\n }, isVoid ? undefined : inner));\n } else {\n mem.push.apply(mem, _toConsumableArray(Children.map([child], function (c) {\n var props = _objectSpread({}, c.props);\n delete props.i18nIsDynamicList;\n return createElement(c.type, _objectSpread(_objectSpread({}, props), {}, {\n key: i,\n ref: c.ref\n }), isVoid ? null : inner);\n })));\n }\n };\n var mapAST = function mapAST(reactNode, astNode, rootReactNode) {\n var reactNodes = getAsArray(reactNode);\n var astNodes = getAsArray(astNode);\n return astNodes.reduce(function (mem, node, i) {\n var _node$children;\n var translationContent = ((_node$children = node.children) === null || _node$children === void 0 || (_node$children = _node$children[0]) === null || _node$children === void 0 ? void 0 : _node$children.content) && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);\n if (node.type === 'tag') {\n var tmp = reactNodes[parseInt(node.name, 10)];\n if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];\n if (!tmp) tmp = {};\n var child = Object.keys(node.attrs).length !== 0 ? mergeProps({\n props: node.attrs\n }, tmp) : tmp;\n var isElement = isValidElement(child);\n var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;\n var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject(child) && child.dummy && !isElement;\n var isKnownComponent = isObject(children) && Object.hasOwnProperty.call(children, node.name);\n if (isString(child)) {\n var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);\n mem.push(value);\n } else if (hasChildren(child) || isValidTranslationWithChildren) {\n var inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (isEmptyTransWithHTML) {\n var _inner = mapAST(reactNodes, node.children, rootReactNode);\n pushTranslatedJSX(child, _inner, mem, i);\n } else if (Number.isNaN(parseFloat(node.name))) {\n if (isKnownComponent) {\n var _inner2 = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);\n } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {\n if (node.voidElement) {\n mem.push(createElement(node.name, {\n key: \"\".concat(node.name, \"-\").concat(i)\n }));\n } else {\n var _inner3 = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(createElement(node.name, {\n key: \"\".concat(node.name, \"-\").concat(i)\n }, _inner3));\n }\n } else if (node.voidElement) {\n mem.push(\"<\".concat(node.name, \" />\"));\n } else {\n var _inner4 = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(\"<\".concat(node.name, \">\").concat(_inner4, \"</\").concat(node.name, \">\"));\n }\n } else if (isObject(child) && !isElement) {\n var content = node.children[0] ? translationContent : null;\n if (content) mem.push(content);\n } else {\n pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent);\n }\n } else if (node.type === 'text') {\n var wrapTextNodes = i18nOptions.transWrapTextNodes;\n var _content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);\n if (wrapTextNodes) {\n mem.push(createElement(wrapTextNodes, {\n key: \"\".concat(node.name, \"-\").concat(i)\n }, _content));\n } else {\n mem.push(_content);\n }\n }\n return mem;\n }, []);\n };\n var result = mapAST([{\n dummy: true,\n children: children || []\n }], ast, getAsArray(children || []));\n return getChildren(result[0]);\n};\nvar fixComponentProps = function fixComponentProps(component, index, translation) {\n var componentKey = component.key || index;\n var comp = cloneElement(component, {\n key: componentKey\n });\n if (!comp.props || !comp.props.children || translation.indexOf(\"\".concat(index, \"/>\")) < 0 && translation.indexOf(\"\".concat(index, \" />\")) < 0) {\n return comp;\n }\n function Componentized() {\n return createElement(Fragment, null, comp);\n }\n return createElement(Componentized);\n};\nvar generateArrayComponents = function generateArrayComponents(components, translation) {\n return components.map(function (c, index) {\n return fixComponentProps(c, index, translation);\n });\n};\nvar generateObjectComponents = function generateObjectComponents(components, translation) {\n var componentMap = {};\n Object.keys(components).forEach(function (c) {\n Object.assign(componentMap, _defineProperty({}, c, fixComponentProps(components[c], c, translation)));\n });\n return componentMap;\n};\nvar generateComponents = function generateComponents(components, translation, i18n, i18nKey) {\n if (!components) return null;\n if (Array.isArray(components)) {\n return generateArrayComponents(components, translation);\n }\n if (isObject(components)) {\n return generateObjectComponents(components, translation);\n }\n warnOnce(i18n, 'TRANS_INVALID_COMPONENTS', \"<Trans /> \\\"components\\\" prop expects an object or array\", {\n i18nKey: i18nKey\n });\n return null;\n};\nexport function Trans(_ref) {\n var _i18n$options, _i18n$options2, _i18n$options3, _i18n$options4;\n var children = _ref.children,\n count = _ref.count,\n parent = _ref.parent,\n i18nKey = _ref.i18nKey,\n context = _ref.context,\n _ref$tOptions = _ref.tOptions,\n tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,\n values = _ref.values,\n defaults = _ref.defaults,\n components = _ref.components,\n ns = _ref.ns,\n i18nFromProps = _ref.i18n,\n tFromProps = _ref.t,\n shouldUnescape = _ref.shouldUnescape,\n additionalProps = _objectWithoutProperties(_ref, _excluded2);\n var i18n = i18nFromProps || getI18n();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', \"Trans: You need to pass in an i18next instance using i18nextReactModule\", {\n i18nKey: i18nKey\n });\n return children;\n }\n var t = tFromProps || i18n.t.bind(i18n) || function (k) {\n return k;\n };\n var reactI18nextOptions = _objectSpread(_objectSpread({}, getDefaults()), (_i18n$options = i18n.options) === null || _i18n$options === void 0 ? void 0 : _i18n$options.react);\n var namespaces = ns || t.ns || ((_i18n$options2 = i18n.options) === null || _i18n$options2 === void 0 ? void 0 : _i18n$options2.defaultNS);\n namespaces = isString(namespaces) ? [namespaces] : namespaces || ['translation'];\n var nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);\n var defaultValue = defaults || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;\n var hashTransKey = reactI18nextOptions.hashTransKey;\n var key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);\n if ((_i18n$options3 = i18n.options) !== null && _i18n$options3 !== void 0 && (_i18n$options3 = _i18n$options3.interpolation) !== null && _i18n$options3 !== void 0 && _i18n$options3.defaultVariables) {\n values = values && Object.keys(values).length > 0 ? _objectSpread(_objectSpread({}, values), i18n.options.interpolation.defaultVariables) : _objectSpread({}, i18n.options.interpolation.defaultVariables);\n }\n var interpolationOverride = values || count !== undefined && !((_i18n$options4 = i18n.options) !== null && _i18n$options4 !== void 0 && (_i18n$options4 = _i18n$options4.interpolation) !== null && _i18n$options4 !== void 0 && _i18n$options4.alwaysFormat) || !children ? tOptions.interpolation : {\n interpolation: _objectSpread(_objectSpread({}, tOptions.interpolation), {}, {\n prefix: '#$?',\n suffix: '?$#'\n })\n };\n var combinedTOpts = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tOptions), {}, {\n context: context || tOptions.context,\n count: count\n }, values), interpolationOverride), {}, {\n defaultValue: defaultValue,\n ns: namespaces\n });\n var translation = key ? t(key, combinedTOpts) : defaultValue;\n var generatedComponents = generateComponents(components, translation, i18n, i18nKey);\n var content = renderNodes(generatedComponents || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);\n var useAsParent = parent !== null && parent !== void 0 ? parent : reactI18nextOptions.defaultTransParent;\n return useAsParent ? createElement(useAsParent, additionalProps, content) : content;\n}","map":{"version":3,"names":["Fragment","isValidElement","cloneElement","createElement","Children","HTML","isObject","isString","warn","warnOnce","getDefaults","getI18n","hasChildren","node","checkLength","_node$props$children","_node$props","base","props","children","length","getChildren","_node$props$children2","_node$props2","_node$props3","i18nIsDynamicList","getAsArray","hasValidReactChildren","Array","isArray","every","data","mergeProps","source","target","newTarget","_objectSpread","Object","assign","nodesToString","i18nOptions","i18n","i18nKey","_i18nOptions$transKee","stringNode","childrenArray","keepArray","transSupportBasicHtmlNodes","transKeepBasicHtmlNodesFor","forEach","child","childIndex","concat","type","childPropsCount","keys","shouldKeepChild","indexOf","childChildren","content","format","clone","_objectWithoutProperties","_excluded","value","renderNodes","targetString","combinedTOpts","shouldUnescape","emptyChildrenButNeedsHandling","RegExp","map","keep","join","test","getData","childs","ast","parse","opts","renderInner","rootReactNode","_child$props","mappedChildren","mapAST","pushTranslatedJSX","inner","mem","i","isVoid","dummy","push","key","undefined","apply","_toConsumableArray","c","ref","reactNode","astNode","reactNodes","astNodes","reduce","_node$children","translationContent","services","interpolator","interpolate","language","tmp","parseInt","name","attrs","isElement","isValidTranslationWithChildren","voidElement","isEmptyTransWithHTML","isKnownComponent","hasOwnProperty","call","Number","isNaN","parseFloat","wrapTextNodes","transWrapTextNodes","unescape","result","fixComponentProps","component","index","translation","componentKey","comp","Componentized","generateArrayComponents","components","generateObjectComponents","componentMap","_defineProperty","generateComponents","Trans","_ref","_i18n$options","_i18n$options2","_i18n$options3","_i18n$options4","count","parent","context","_ref$tOptions","tOptions","values","defaults","ns","i18nFromProps","tFromProps","t","additionalProps","_excluded2","bind","k","reactI18nextOptions","options","react","namespaces","defaultNS","nodeAsString","defaultValue","transEmptyNodeValue","hashTransKey","interpolation","defaultVariables","interpolationOverride","alwaysFormat","prefix","suffix","generatedComponents","useAsParent","defaultTransParent"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/TransWithoutContext.js"],"sourcesContent":["import { Fragment, isValidElement, cloneElement, createElement, Children } from 'react';\nimport HTML from 'html-parse-stringify';\nimport { isObject, isString, warn, warnOnce } from './utils.js';\nimport { getDefaults } from './defaults.js';\nimport { getI18n } from './i18nInstance.js';\nconst hasChildren = (node, checkLength) => {\n if (!node) return false;\n const base = node.props?.children ?? node.children;\n if (checkLength) return base.length > 0;\n return !!base;\n};\nconst getChildren = node => {\n if (!node) return [];\n const children = node.props?.children ?? node.children;\n return node.props?.i18nIsDynamicList ? getAsArray(children) : children;\n};\nconst hasValidReactChildren = children => Array.isArray(children) && children.every(isValidElement);\nconst getAsArray = data => Array.isArray(data) ? data : [data];\nconst mergeProps = (source, target) => {\n const newTarget = {\n ...target\n };\n newTarget.props = Object.assign(source.props, target.props);\n return newTarget;\n};\nexport const nodesToString = (children, i18nOptions, i18n, i18nKey) => {\n if (!children) return '';\n let stringNode = '';\n const childrenArray = getAsArray(children);\n const keepArray = i18nOptions?.transSupportBasicHtmlNodes ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : [];\n childrenArray.forEach((child, childIndex) => {\n if (isString(child)) {\n stringNode += `${child}`;\n return;\n }\n if (isValidElement(child)) {\n const {\n props,\n type\n } = child;\n const childPropsCount = Object.keys(props).length;\n const shouldKeepChild = keepArray.indexOf(type) > -1;\n const childChildren = props.children;\n if (!childChildren && shouldKeepChild && !childPropsCount) {\n stringNode += `<${type}/>`;\n return;\n }\n if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {\n stringNode += `<${childIndex}></${childIndex}>`;\n return;\n }\n if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {\n stringNode += `<${type}>${childChildren}</${type}>`;\n return;\n }\n const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);\n stringNode += `<${childIndex}>${content}</${childIndex}>`;\n return;\n }\n if (child === null) {\n warn(i18n, 'TRANS_NULL_VALUE', `Passed in a null value as child`, {\n i18nKey\n });\n return;\n }\n if (isObject(child)) {\n const {\n format,\n ...clone\n } = child;\n const keys = Object.keys(clone);\n if (keys.length === 1) {\n const value = format ? `${keys[0]}, ${format}` : keys[0];\n stringNode += `{{${value}}}`;\n return;\n }\n warn(i18n, 'TRANS_INVALID_OBJ', `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, {\n i18nKey,\n child\n });\n return;\n }\n warn(i18n, 'TRANS_INVALID_VAR', `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, {\n i18nKey,\n child\n });\n });\n return stringNode;\n};\nconst renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => {\n if (targetString === '') return [];\n const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];\n const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map(keep => `<${keep}`).join('|')).test(targetString);\n if (!children && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];\n const data = {};\n const getData = childs => {\n const childrenArray = getAsArray(childs);\n childrenArray.forEach(child => {\n if (isString(child)) return;\n if (hasChildren(child)) getData(getChildren(child));else if (isObject(child) && !isValidElement(child)) Object.assign(data, child);\n });\n };\n getData(children);\n const ast = HTML.parse(`<0>${targetString}</0>`);\n const opts = {\n ...data,\n ...combinedTOpts\n };\n const renderInner = (child, node, rootReactNode) => {\n const childs = getChildren(child);\n const mappedChildren = mapAST(childs, node.children, rootReactNode);\n return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props?.i18nIsDynamicList ? childs : mappedChildren;\n };\n const pushTranslatedJSX = (child, inner, mem, i, isVoid) => {\n if (child.dummy) {\n child.children = inner;\n mem.push(cloneElement(child, {\n key: i\n }, isVoid ? undefined : inner));\n } else {\n mem.push(...Children.map([child], c => {\n const props = {\n ...c.props\n };\n delete props.i18nIsDynamicList;\n return createElement(c.type, {\n ...props,\n key: i,\n ref: c.ref\n }, isVoid ? null : inner);\n }));\n }\n };\n const mapAST = (reactNode, astNode, rootReactNode) => {\n const reactNodes = getAsArray(reactNode);\n const astNodes = getAsArray(astNode);\n return astNodes.reduce((mem, node, i) => {\n const translationContent = node.children?.[0]?.content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);\n if (node.type === 'tag') {\n let tmp = reactNodes[parseInt(node.name, 10)];\n if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];\n if (!tmp) tmp = {};\n const child = Object.keys(node.attrs).length !== 0 ? mergeProps({\n props: node.attrs\n }, tmp) : tmp;\n const isElement = isValidElement(child);\n const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;\n const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject(child) && child.dummy && !isElement;\n const isKnownComponent = isObject(children) && Object.hasOwnProperty.call(children, node.name);\n if (isString(child)) {\n const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);\n mem.push(value);\n } else if (hasChildren(child) || isValidTranslationWithChildren) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (isEmptyTransWithHTML) {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (Number.isNaN(parseFloat(node.name))) {\n if (isKnownComponent) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i, node.voidElement);\n } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {\n if (node.voidElement) {\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }));\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }, inner));\n }\n } else if (node.voidElement) {\n mem.push(`<${node.name} />`);\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(`<${node.name}>${inner}</${node.name}>`);\n }\n } else if (isObject(child) && !isElement) {\n const content = node.children[0] ? translationContent : null;\n if (content) mem.push(content);\n } else {\n pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent);\n }\n } else if (node.type === 'text') {\n const wrapTextNodes = i18nOptions.transWrapTextNodes;\n const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);\n if (wrapTextNodes) {\n mem.push(createElement(wrapTextNodes, {\n key: `${node.name}-${i}`\n }, content));\n } else {\n mem.push(content);\n }\n }\n return mem;\n }, []);\n };\n const result = mapAST([{\n dummy: true,\n children: children || []\n }], ast, getAsArray(children || []));\n return getChildren(result[0]);\n};\nconst fixComponentProps = (component, index, translation) => {\n const componentKey = component.key || index;\n const comp = cloneElement(component, {\n key: componentKey\n });\n if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {\n return comp;\n }\n function Componentized() {\n return createElement(Fragment, null, comp);\n }\n return createElement(Componentized);\n};\nconst generateArrayComponents = (components, translation) => components.map((c, index) => fixComponentProps(c, index, translation));\nconst generateObjectComponents = (components, translation) => {\n const componentMap = {};\n Object.keys(components).forEach(c => {\n Object.assign(componentMap, {\n [c]: fixComponentProps(components[c], c, translation)\n });\n });\n return componentMap;\n};\nconst generateComponents = (components, translation, i18n, i18nKey) => {\n if (!components) return null;\n if (Array.isArray(components)) {\n return generateArrayComponents(components, translation);\n }\n if (isObject(components)) {\n return generateObjectComponents(components, translation);\n }\n warnOnce(i18n, 'TRANS_INVALID_COMPONENTS', `<Trans /> \"components\" prop expects an object or array`, {\n i18nKey\n });\n return null;\n};\nexport function Trans({\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n}) {\n const i18n = i18nFromProps || getI18n();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', `Trans: You need to pass in an i18next instance using i18nextReactModule`, {\n i18nKey\n });\n return children;\n }\n const t = tFromProps || i18n.t.bind(i18n) || (k => k);\n const reactI18nextOptions = {\n ...getDefaults(),\n ...i18n.options?.react\n };\n let namespaces = ns || t.ns || i18n.options?.defaultNS;\n namespaces = isString(namespaces) ? [namespaces] : namespaces || ['translation'];\n const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);\n const defaultValue = defaults || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;\n const {\n hashTransKey\n } = reactI18nextOptions;\n const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);\n if (i18n.options?.interpolation?.defaultVariables) {\n values = values && Object.keys(values).length > 0 ? {\n ...values,\n ...i18n.options.interpolation.defaultVariables\n } : {\n ...i18n.options.interpolation.defaultVariables\n };\n }\n const interpolationOverride = values || count !== undefined && !i18n.options?.interpolation?.alwaysFormat || !children ? tOptions.interpolation : {\n interpolation: {\n ...tOptions.interpolation,\n prefix: '#$?',\n suffix: '?$#'\n }\n };\n const combinedTOpts = {\n ...tOptions,\n context: context || tOptions.context,\n count,\n ...values,\n ...interpolationOverride,\n defaultValue,\n ns: namespaces\n };\n const translation = key ? t(key, combinedTOpts) : defaultValue;\n const generatedComponents = generateComponents(components, translation, i18n, i18nKey);\n const content = renderNodes(generatedComponents || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);\n const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;\n return useAsParent ? createElement(useAsParent, additionalProps, content) : content;\n}"],"mappings":";;;;;;AAAA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,YAAY,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,OAAO;AACvF,OAAOC,IAAI,MAAM,sBAAsB;AACvC,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,YAAY;AAC/D,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAAI,EAAEC,WAAW,EAAK;EAAA,IAAAC,oBAAA,EAAAC,WAAA;EACzC,IAAI,CAACH,IAAI,EAAE,OAAO,KAAK;EACvB,IAAMI,IAAI,IAAAF,oBAAA,IAAAC,WAAA,GAAGH,IAAI,CAACK,KAAK,cAAAF,WAAA,uBAAVA,WAAA,CAAYG,QAAQ,cAAAJ,oBAAA,cAAAA,oBAAA,GAAIF,IAAI,CAACM,QAAQ;EAClD,IAAIL,WAAW,EAAE,OAAOG,IAAI,CAACG,MAAM,GAAG,CAAC;EACvC,OAAO,CAAC,CAACH,IAAI;AACf,CAAC;AACD,IAAMI,WAAW,GAAG,SAAdA,WAAWA,CAAGR,IAAI,EAAI;EAAA,IAAAS,qBAAA,EAAAC,YAAA,EAAAC,YAAA;EAC1B,IAAI,CAACX,IAAI,EAAE,OAAO,EAAE;EACpB,IAAMM,QAAQ,IAAAG,qBAAA,IAAAC,YAAA,GAAGV,IAAI,CAACK,KAAK,cAAAK,YAAA,uBAAVA,YAAA,CAAYJ,QAAQ,cAAAG,qBAAA,c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7J,QAAQ,EAAE+G,WAAW,EAAEzF,IAAI,EAAEwH,mBAAmB,EAAE9F,aAAa,EAAEC,cAAc,CAAC;EACnI,IAAM6G,WAAW,GAAG9B,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIc,mBAAmB,CAACiB,kBAAkB;EACpE,OAAOD,WAAW,GAAG9K,aAAa,CAAC8K,WAAW,EAAEpB,eAAe,EAAElG,OAAO,CAAC,GAAGA,OAAO;AACrF","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _classCallCheck from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createClass.js\";import _inherits from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/inherits.js\";import _createSuper from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createSuper.js\";import Table from'@mui/material/Table';import TableBody from'@mui/material/TableBody';import TableHead from'@mui/material/TableHead';import TableRow from'@mui/material/TableRow';import Grid from'@mui/material/Unstable_Grid2';import React from'react';import fetchWrapper from'../../components/fetchWrapper';import{toReadableSize}from'../../components/utils';import{StyledTableCell,StyledTableRow}from'./style';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var NodeInfo=/*#__PURE__*/function(_React$Component){_inherits(NodeInfo,_React$Component);var _super=_createSuper(NodeInfo);function NodeInfo(props){var _this;_classCallCheck(this,NodeInfo);_this=_super.call(this,props);_this.nodeRole=props.nodeRole;_this.endpoint=props.endpoint;_this.state={version:{},info:[]};_this.t=props.t;return _this;}_createClass(NodeInfo,[{key:\"refreshInfo\",value:function refreshInfo(){var _this2=this;if(this.props.cookie.token===''||this.props.cookie.token===undefined||this.props.cookie.token!=='no_auth'&&!sessionStorage.getItem('token')){return;}fetchWrapper.get('/v1/cluster/info?detailed=true').then(function(data){var state=_this2.state;state['info']=data;_this2.setState(state);}).catch(function(error){console.error('Error:',error);if(error.response.status==403){_this2.props.handleGoBack();}});if(JSON.stringify(this.state.version)==='{}'){fetchWrapper.get('/v1/cluster/version').then(function(data){var state=_this2.state;state['version']={release:'v'+data['version'],commit:data['full-revisionid']};_this2.setState(state);}).catch(function(error){console.error('Error:',error);if(error.response.status==403){_this2.props.handleGoBack();}});}}},{key:\"componentDidMount\",value:function componentDidMount(){var _this3=this;this.interval=setInterval(function(){return _this3.refreshInfo();},5000);this.refreshInfo();}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){clearInterval(this.interval);}},{key:\"render\",value:function render(){var _this4=this;if(this.state===undefined||this.state['info']===[]){return/*#__PURE__*/_jsx(\"div\",{children:\"Loading\"});}if(this.nodeRole!=='Worker-Details'){var roleData=this.state['info'].filter(function(obj){return obj['node_type']===_this4.nodeRole;});var sum=function sum(arr){return arr.reduce(function(a,b){return a+b;},0);};var gatherResourceStats=function gatherResourceStats(prop){return sum(roleData.map(function(obj){return obj[prop];}));};var resourceStats={cpu_total:gatherResourceStats('cpu_count'),cpu_avail:gatherResourceStats('cpu_available'),memory_total:gatherResourceStats('mem_total'),memory_avail:gatherResourceStats('mem_available'),gpu_total:gatherResourceStats('gpu_count'),gpu_memory_total:gatherResourceStats('gpu_vram_total'),gpu_memory_avail:gatherResourceStats('gpu_vram_available')};//for all cases, we will at least have cpu information available.\nresourceStats.cpu_used=resourceStats.cpu_total-resourceStats.cpu_avail;resourceStats.memory_used=resourceStats.memory_total-resourceStats.memory_avail;var row_count=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.count')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:roleData.length})})})]});var CPU_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.cpuInfo')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[this.t('clusterInfo.usage'),' ',resourceStats.cpu_used.toFixed(2)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[this.t('clusterInfo.total'),' ',resourceStats.cpu_total.toFixed(2)]})]})})]});var CPU_Memory_Info_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.cpuMemoryInfo')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[this.t('clusterInfo.usage'),' ',toReadableSize(resourceStats.memory_used)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[this.t('clusterInfo.total'),' ',toReadableSize(resourceStats.memory_total)]})]})})]});var version_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.version')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[this.t('clusterInfo.release'),\" \",this.state.version.release]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[this.t('clusterInfo.commit'),\" \",this.state.version.commit]})]})})]});var table_bodies;//case that we do not have GPU presents.\nif(resourceStats.gpu_memory_total===0){table_bodies=[row_count,CPU_row,CPU_Memory_Info_row,version_row];}else{resourceStats.gpu_memory_used=resourceStats.gpu_memory_total-resourceStats.gpu_memory_avail;var GPU_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.gpuInfo')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsxs(Grid,{xs:12,children:[this.t('clusterInfo.total'),' ',resourceStats.gpu_total.toFixed(2)]})})})]});var GPU_Memory_Info_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.gpuMemoryInfo')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[this.t('clusterInfo.usage'),' ',toReadableSize(resourceStats.gpu_memory_used)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[this.t('clusterInfo.total'),' ',toReadableSize(resourceStats.gpu_memory_total)]})]})})]});table_bodies=[row_count,CPU_row,CPU_Memory_Info_row,GPU_row,GPU_Memory_Info_row,version_row];}if(this.nodeRole==='Supervisor'){var supervisor_addr_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:this.t('clusterInfo.address')}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:roleData[0]?roleData[0]['ip_address']:'-'})})})]});table_bodies.splice(1,0,supervisor_addr_row);}return/*#__PURE__*/_jsxs(Table,{size:\"small\",children:[/*#__PURE__*/_jsx(TableHead,{children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.item')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:this.t('clusterInfo.value')})})})]})}),/*#__PURE__*/_jsx(TableBody,{children:table_bodies})]});}else{var workerData=this.state['info'].filter(function(obj){return obj['node_type']==='Worker';});return/*#__PURE__*/_jsxs(Table,{size:\"small\",children:[/*#__PURE__*/_jsx(TableHead,{children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.nodeType')}),/*#__PURE__*/_jsxs(StyledTableCell,{style:{fontWeight:'bolder'},children:[\"Address\",this.t('clusterInfo.address')]}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.cpuUsage')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.cpuTotal')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.memUsage')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.memTotal')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.gpuCount')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.gpuMemUsage')}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:this.t('clusterInfo.gpuMemTotal')})]})}),/*#__PURE__*/_jsx(TableBody,{children:workerData.map(function(row){return/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:_this4.t('clusterInfo.worker')}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['ip_address']}),/*#__PURE__*/_jsx(StyledTableCell,{children:(row['cpu_count']-row['cpu_available']).toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['cpu_count'].toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['mem_total']-row['mem_available'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['mem_total'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['gpu_count'].toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['gpu_vram_total']-row['gpu_vram_available'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['gpu_vram_total'])})]});})})]});}}}]);return NodeInfo;}(React.Component);export default NodeInfo;","map":{"version":3,"names":["Table","TableBody","TableHead","TableRow","Grid","React","fetchWrapper","toReadableSize","StyledTableCell","StyledTableRow","jsx","_jsx","jsxs","_jsxs","NodeInfo","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","nodeRole","endpoint","state","version","info","t","_createClass","key","value","refreshInfo","_this2","cookie","token","undefined","sessionStorage","getItem","get","then","data","setState","catch","error","console","response","status","handleGoBack","JSON","stringify","release","commit","componentDidMount","_this3","interval","setInterval","componentWillUnmount","clearInterval","render","_this4","children","roleData","filter","obj","sum","arr","reduce","a","b","gatherResourceStats","prop","map","resourceStats","cpu_total","cpu_avail","memory_total","memory_avail","gpu_total","gpu_memory_total","gpu_memory_avail","cpu_used","memory_used","row_count","container","length","CPU_row","xs","toFixed","CPU_Memory_Info_row","version_row","table_bodies","gpu_memory_used","GPU_row","GPU_Memory_Info_row","supervisor_addr_row","splice","size","style","fontWeight","workerData","row","Component"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/cluster_info/nodeInfo.js"],"sourcesContent":["import Table from '@mui/material/Table'\nimport TableBody from '@mui/material/TableBody'\nimport TableHead from '@mui/material/TableHead'\nimport TableRow from '@mui/material/TableRow'\nimport Grid from '@mui/material/Unstable_Grid2'\nimport PropTypes from 'prop-types'\nimport React from 'react'\n\nimport fetchWrapper from '../../components/fetchWrapper'\nimport { toReadableSize } from '../../components/utils'\nimport { StyledTableCell, StyledTableRow } from './style'\n\nclass NodeInfo extends React.Component {\n constructor(props) {\n super(props)\n this.nodeRole = props.nodeRole\n this.endpoint = props.endpoint\n this.state = {\n version: {},\n info: [],\n }\n this.t = props.t\n }\n\n refreshInfo() {\n if (\n this.props.cookie.token === '' ||\n this.props.cookie.token === undefined ||\n (this.props.cookie.token !== 'no_auth' &&\n !sessionStorage.getItem('token'))\n ) {\n return\n }\n fetchWrapper\n .get('/v1/cluster/info?detailed=true')\n .then((data) => {\n const { state } = this\n state['info'] = data\n this.setState(state)\n })\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status == 403) {\n this.props.handleGoBack()\n }\n })\n\n if (JSON.stringify(this.state.version) === '{}') {\n fetchWrapper\n .get('/v1/cluster/version')\n .then((data) => {\n const { state } = this\n state['version'] = {\n release: 'v' + data['version'],\n commit: data['full-revisionid'],\n }\n this.setState(state)\n })\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status == 403) {\n this.props.handleGoBack()\n }\n })\n }\n }\n\n componentDidMount() {\n this.interval = setInterval(() => this.refreshInfo(), 5000)\n this.refreshInfo()\n }\n\n componentWillUnmount() {\n clearInterval(this.interval)\n }\n\n render() {\n if (this.state === undefined || this.state['info'] === []) {\n return <div>Loading</div>\n }\n\n if (this.nodeRole !== 'Worker-Details') {\n const roleData = this.state['info'].filter(\n (obj) => obj['node_type'] === this.nodeRole\n )\n\n const sum = (arr) => {\n return arr.reduce((a, b) => a + b, 0)\n }\n\n const gatherResourceStats = (prop) =>\n sum(roleData.map((obj) => obj[prop]))\n\n const resourceStats = {\n cpu_total: gatherResourceStats('cpu_count'),\n cpu_avail: gatherResourceStats('cpu_available'),\n memory_total: gatherResourceStats('mem_total'),\n memory_avail: gatherResourceStats('mem_available'),\n gpu_total: gatherResourceStats('gpu_count'),\n gpu_memory_total: gatherResourceStats('gpu_vram_total'),\n gpu_memory_avail: gatherResourceStats('gpu_vram_available'),\n }\n\n //for all cases, we will at least have cpu information available.\n resourceStats.cpu_used = resourceStats.cpu_total - resourceStats.cpu_avail\n resourceStats.memory_used =\n resourceStats.memory_total - resourceStats.memory_avail\n\n const row_count = (\n <StyledTableRow>\n <StyledTableCell>{this.t('clusterInfo.count')}</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid>{roleData.length}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const CPU_row = (\n <StyledTableRow>\n <StyledTableCell>{this.t('clusterInfo.cpuInfo')}</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n {this.t('clusterInfo.usage')}{' '}\n {resourceStats.cpu_used.toFixed(2)}\n </Grid>\n <Grid xs={8}>\n {this.t('clusterInfo.total')}{' '}\n {resourceStats.cpu_total.toFixed(2)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const CPU_Memory_Info_row = (\n <StyledTableRow>\n <StyledTableCell>\n {this.t('clusterInfo.cpuMemoryInfo')}\n </StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n {this.t('clusterInfo.usage')}{' '}\n {toReadableSize(resourceStats.memory_used)}\n </Grid>\n <Grid xs={8}>\n {this.t('clusterInfo.total')}{' '}\n {toReadableSize(resourceStats.memory_total)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const version_row = (\n <StyledTableRow>\n <StyledTableCell>{this.t('clusterInfo.version')}</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n {this.t('clusterInfo.release')} {this.state.version.release}\n </Grid>\n <Grid xs={8}>\n {this.t('clusterInfo.commit')} {this.state.version.commit}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n let table_bodies\n //case that we do not have GPU presents.\n if (resourceStats.gpu_memory_total === 0) {\n table_bodies = [row_count, CPU_row, CPU_Memory_Info_row, version_row]\n } else {\n resourceStats.gpu_memory_used =\n resourceStats.gpu_memory_total - resourceStats.gpu_memory_avail\n\n const GPU_row = (\n <StyledTableRow>\n <StyledTableCell>{this.t('clusterInfo.gpuInfo')}</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={12}>\n {this.t('clusterInfo.total')}{' '}\n {resourceStats.gpu_total.toFixed(2)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const GPU_Memory_Info_row = (\n <StyledTableRow>\n <StyledTableCell>\n {this.t('clusterInfo.gpuMemoryInfo')}\n </StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n {this.t('clusterInfo.usage')}{' '}\n {toReadableSize(resourceStats.gpu_memory_used)}\n </Grid>\n <Grid xs={8}>\n {this.t('clusterInfo.total')}{' '}\n {toReadableSize(resourceStats.gpu_memory_total)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n table_bodies = [\n row_count,\n CPU_row,\n CPU_Memory_Info_row,\n GPU_row,\n GPU_Memory_Info_row,\n version_row,\n ]\n }\n\n if (this.nodeRole === 'Supervisor') {\n const supervisor_addr_row = (\n <StyledTableRow>\n <StyledTableCell>{this.t('clusterInfo.address')}</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid>{roleData[0] ? roleData[0]['ip_address'] : '-'}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n table_bodies.splice(1, 0, supervisor_addr_row)\n }\n\n return (\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.item')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n <Grid container>\n <Grid>{this.t('clusterInfo.value')}</Grid>\n </Grid>\n </StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>{table_bodies}</TableBody>\n </Table>\n )\n } else {\n const workerData = this.state['info'].filter(\n (obj) => obj['node_type'] === 'Worker'\n )\n\n return (\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.nodeType')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Address{this.t('clusterInfo.address')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.cpuUsage')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.cpuTotal')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.memUsage')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.memTotal')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.gpuCount')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.gpuMemUsage')}\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n {this.t('clusterInfo.gpuMemTotal')}\n </StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {workerData.map((row) => (\n <StyledTableRow>\n <StyledTableCell>\n {this.t('clusterInfo.worker')}\n </StyledTableCell>\n <StyledTableCell>{row['ip_address']}</StyledTableCell>\n <StyledTableCell>\n {(row['cpu_count'] - row['cpu_available']).toFixed(2)}\n </StyledTableCell>\n <StyledTableCell>{row['cpu_count'].toFixed(2)}</StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['mem_total'] - row['mem_available'])}\n </StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['mem_total'])}\n </StyledTableCell>\n <StyledTableCell>{row['gpu_count'].toFixed(2)}</StyledTableCell>\n <StyledTableCell>\n {toReadableSize(\n row['gpu_vram_total'] - row['gpu_vram_available']\n )}\n </StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['gpu_vram_total'])}\n </StyledTableCell>\n </StyledTableRow>\n ))}\n </TableBody>\n </Table>\n )\n }\n }\n}\n\nNodeInfo.propTypes = {\n nodeRole: PropTypes.string,\n endpoint: PropTypes.string,\n}\n\nexport default NodeInfo\n"],"mappings":"oiBAAA,MAAO,CAAAA,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,QAAQ,KAAM,wBAAwB,CAC7C,MAAO,CAAAC,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jB,IAAA,CAACH,eAAe,EAAAqD,QAAA,CAAEwC,GAAG,CAAC,YAAY,CAAC,CAAkB,CAAC,cACtD1F,IAAA,CAACH,eAAe,EAAAqD,QAAA,CACb,CAACwC,GAAG,CAAC,WAAW,CAAC,CAAGA,GAAG,CAAC,eAAe,CAAC,EAAEb,OAAO,CAAC,CAAC,CAAC,CACtC,CAAC,cAClB7E,IAAA,CAACH,eAAe,EAAAqD,QAAA,CAAEwC,GAAG,CAAC,WAAW,CAAC,CAACb,OAAO,CAAC,CAAC,CAAC,CAAkB,CAAC,cAChE7E,IAAA,CAACH,eAAe,EAAAqD,QAAA,CACbtD,cAAc,CAAC8F,GAAG,CAAC,WAAW,CAAC,CAAGA,GAAG,CAAC,eAAe,CAAC,CAAC,CACzC,CAAC,cAClB1F,IAAA,CAACH,eAAe,EAAAqD,QAAA,CACbtD,cAAc,CAAC8F,GAAG,CAAC,WAAW,CAAC,CAAC,CAClB,CAAC,cAClB1F,IAAA,CAACH,eAAe,EAAAqD,QAAA,CAAEwC,GAAG,CAAC,WAAW,CAAC,CAACb,OAAO,CAAC,CAAC,CAAC,CAAkB,CAAC,cAChE7E,IAAA,CAACH,eAAe,EAAAqD,QAAA,CACbtD,cAAc,CACb8F,GAAG,CAAC,gBAAgB,CAAC,CAAGA,GAAG,CAAC,oBAAoB,CAClD,CAAC,CACc,CAAC,cAClB1F,IAAA,CAACH,eAAe,EAAAqD,QAAA,CACbtD,cAAc,CAAC8F,GAAG,CAAC,gBAAgB,CAAC,CAAC,CACvB,CAAC,EACJ,CAAC,EAClB,CAAC,CACO,CAAC,EACP,CAAC,CAEZ,CACF,CAAC,WAAAvF,QAAA,GA1ToBT,KAAK,CAACiG,SAAS,EAkUtC,cAAe,CAAAxF,QAAQ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _slicedToArray from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _objectSpread from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport { useState, useEffect, useContext, useRef, useCallback } from 'react';\nimport { getI18n, getDefaults, ReportNamespaces, I18nContext } from './context.js';\nimport { warnOnce, loadNamespaces, loadLanguages, hasLoadedNamespace, isString, isObject } from './utils.js';\nvar usePrevious = function usePrevious(value, ignore) {\n var ref = useRef();\n useEffect(function () {\n ref.current = ignore ? ref.current : value;\n }, [value, ignore]);\n return ref.current;\n};\nvar alwaysNewT = function alwaysNewT(i18n, language, namespace, keyPrefix) {\n return i18n.getFixedT(language, namespace, keyPrefix);\n};\nvar useMemoizedT = function useMemoizedT(i18n, language, namespace, keyPrefix) {\n return useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);\n};\nexport var useTranslation = function useTranslation(ns) {\n var _i18n$options$react, _i18n$options, _i18n$reportNamespace, _i18n$reportNamespace2;\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var i18nFromProps = props.i18n;\n var _ref = useContext(I18nContext) || {},\n i18nFromContext = _ref.i18n,\n defaultNSFromContext = _ref.defaultNS;\n var i18n = i18nFromProps || i18nFromContext || getI18n();\n if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');\n var notReadyT = function notReadyT(k, optsOrDefaultValue) {\n if (isString(optsOrDefaultValue)) return optsOrDefaultValue;\n if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;\n return Array.isArray(k) ? k[k.length - 1] : k;\n };\n var retNotReady = [notReadyT, {}, false];\n retNotReady.t = notReadyT;\n retNotReady.i18n = {};\n retNotReady.ready = false;\n return retNotReady;\n }\n if ((_i18n$options$react = i18n.options.react) !== null && _i18n$options$react !== void 0 && _i18n$options$react.wait) warnOnce(i18n, 'DEPRECATED_OPTION', 'useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');\n var i18nOptions = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), i18n.options.react), props);\n var useSuspense = i18nOptions.useSuspense,\n keyPrefix = i18nOptions.keyPrefix;\n var namespaces = ns || defaultNSFromContext || ((_i18n$options = i18n.options) === null || _i18n$options === void 0 ? void 0 : _i18n$options.defaultNS);\n namespaces = isString(namespaces) ? [namespaces] : namespaces || ['translation'];\n (_i18n$reportNamespace = (_i18n$reportNamespace2 = i18n.reportNamespaces).addUsedNamespaces) === null || _i18n$reportNamespace === void 0 ? void 0 : _i18n$reportNamespace.call(_i18n$reportNamespace2, namespaces);\n var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {\n return hasLoadedNamespace(n, i18n, i18nOptions);\n });\n var memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n var getT = function getT() {\n return memoGetT;\n };\n var getNewT = function getNewT() {\n return alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n };\n var _useState = useState(getT),\n _useState2 = _slicedToArray(_useState, 2),\n t = _useState2[0],\n setT = _useState2[1];\n var joinedNS = namespaces.join();\n if (props.lng) joinedNS = \"\".concat(props.lng).concat(joinedNS);\n var previousJoinedNS = usePrevious(joinedNS);\n var isMounted = useRef(true);\n useEffect(function () {\n var bindI18n = i18nOptions.bindI18n,\n bindI18nStore = i18nOptions.bindI18nStore;\n isMounted.current = true;\n if (!ready && !useSuspense) {\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, function () {\n if (isMounted.current) setT(getNewT);\n });\n } else {\n loadNamespaces(i18n, namespaces, function () {\n if (isMounted.current) setT(getNewT);\n });\n }\n }\n if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {\n setT(getNewT);\n }\n var boundReset = function boundReset() {\n if (isMounted.current) setT(getNewT);\n };\n if (bindI18n) i18n === null || i18n === void 0 ? void 0 : i18n.on(bindI18n, boundReset);\n if (bindI18nStore) i18n === null || i18n === void 0 ? void 0 : i18n.store.on(bindI18nStore, boundReset);\n return function () {\n isMounted.current = false;\n if (i18n) bindI18n === null || bindI18n === void 0 ? void 0 : bindI18n.split(' ').forEach(function (e) {\n return i18n.off(e, boundReset);\n });\n if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {\n return i18n.store.off(e, boundReset);\n });\n };\n }, [i18n, joinedNS]);\n useEffect(function () {\n if (isMounted.current && ready) {\n setT(getT);\n }\n }, [i18n, keyPrefix, ready]);\n var ret = [t, i18n, ready];\n ret.t = t;\n ret.i18n = i18n;\n ret.ready = ready;\n if (ready) return ret;\n if (!ready && !useSuspense) return ret;\n throw new Promise(function (resolve) {\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, function () {\n return resolve();\n });\n } else {\n loadNamespaces(i18n, namespaces, function () {\n return resolve();\n });\n }\n });\n};","map":{"version":3,"names":["useState","useEffect","useContext","useRef","useCallback","getI18n","getDefaults","ReportNamespaces","I18nContext","warnOnce","loadNamespaces","loadLanguages","hasLoadedNamespace","isString","isObject","usePrevious","value","ignore","ref","current","alwaysNewT","i18n","language","namespace","keyPrefix","getFixedT","useMemoizedT","useTranslation","ns","_i18n$options$react","_i18n$options","_i18n$reportNamespace","_i18n$reportNamespace2","props","arguments","length","undefined","i18nFromProps","_ref","i18nFromContext","defaultNSFromContext","defaultNS","reportNamespaces","notReadyT","k","optsOrDefaultValue","defaultValue","Array","isArray","retNotReady","t","ready","options","react","wait","i18nOptions","_objectSpread","useSuspense","namespaces","addUsedNamespaces","call","isInitialized","initializedStoreOnce","every","n","memoGetT","lng","nsMode","getT","getNewT","_useState","_useState2","_slicedToArray","setT","joinedNS","join","concat","previousJoinedNS","isMounted","bindI18n","bindI18nStore","boundReset","on","store","split","forEach","e","off","ret","Promise","resolve"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/useTranslation.js"],"sourcesContent":["import { useState, useEffect, useContext, useRef, useCallback } from 'react';\nimport { getI18n, getDefaults, ReportNamespaces, I18nContext } from './context.js';\nimport { warnOnce, loadNamespaces, loadLanguages, hasLoadedNamespace, isString, isObject } from './utils.js';\nconst usePrevious = (value, ignore) => {\n const ref = useRef();\n useEffect(() => {\n ref.current = ignore ? ref.current : value;\n }, [value, ignore]);\n return ref.current;\n};\nconst alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);\nconst useMemoizedT = (i18n, language, namespace, keyPrefix) => useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);\nexport const useTranslation = (ns, props = {}) => {\n const {\n i18n: i18nFromProps\n } = props;\n const {\n i18n: i18nFromContext,\n defaultNS: defaultNSFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');\n const notReadyT = (k, optsOrDefaultValue) => {\n if (isString(optsOrDefaultValue)) return optsOrDefaultValue;\n if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;\n return Array.isArray(k) ? k[k.length - 1] : k;\n };\n const retNotReady = [notReadyT, {}, false];\n retNotReady.t = notReadyT;\n retNotReady.i18n = {};\n retNotReady.ready = false;\n return retNotReady;\n }\n if (i18n.options.react?.wait) warnOnce(i18n, 'DEPRECATED_OPTION', 'useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');\n const i18nOptions = {\n ...getDefaults(),\n ...i18n.options.react,\n ...props\n };\n const {\n useSuspense,\n keyPrefix\n } = i18nOptions;\n let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;\n namespaces = isString(namespaces) ? [namespaces] : namespaces || ['translation'];\n i18n.reportNamespaces.addUsedNamespaces?.(namespaces);\n const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));\n const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n const getT = () => memoGetT;\n const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n const [t, setT] = useState(getT);\n let joinedNS = namespaces.join();\n if (props.lng) joinedNS = `${props.lng}${joinedNS}`;\n const previousJoinedNS = usePrevious(joinedNS);\n const isMounted = useRef(true);\n useEffect(() => {\n const {\n bindI18n,\n bindI18nStore\n } = i18nOptions;\n isMounted.current = true;\n if (!ready && !useSuspense) {\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, () => {\n if (isMounted.current) setT(getNewT);\n });\n } else {\n loadNamespaces(i18n, namespaces, () => {\n if (isMounted.current) setT(getNewT);\n });\n }\n }\n if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {\n setT(getNewT);\n }\n const boundReset = () => {\n if (isMounted.current) setT(getNewT);\n };\n if (bindI18n) i18n?.on(bindI18n, boundReset);\n if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);\n return () => {\n isMounted.current = false;\n if (i18n) bindI18n?.split(' ').forEach(e => i18n.off(e, boundReset));\n if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));\n };\n }, [i18n, joinedNS]);\n useEffect(() => {\n if (isMounted.current && ready) {\n setT(getT);\n }\n }, [i18n, keyPrefix, ready]);\n const ret = [t, i18n, ready];\n ret.t = t;\n ret.i18n = i18n;\n ret.ready = ready;\n if (ready) return ret;\n if (!ready && !useSuspense) return ret;\n throw new Promise(resolve => {\n if (props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,EAAEG,SAAS,EAAE2B,KAAK,CAAC,CAAC;EAC5B,IAAMqC,GAAG,GAAG,CAACtC,CAAC,EAAE7B,IAAI,EAAE8B,KAAK,CAAC;EAC5BqC,GAAG,CAACtC,CAAC,GAAGA,CAAC;EACTsC,GAAG,CAACnE,IAAI,GAAGA,IAAI;EACfmE,GAAG,CAACrC,KAAK,GAAGA,KAAK;EACjB,IAAIA,KAAK,EAAE,OAAOqC,GAAG;EACrB,IAAI,CAACrC,KAAK,IAAI,CAACM,WAAW,EAAE,OAAO+B,GAAG;EACtC,MAAM,IAAIC,OAAO,CAAC,UAAAC,OAAO,EAAI;IAC3B,IAAIzD,KAAK,CAACiC,GAAG,EAAE;MACbvD,aAAa,CAACU,IAAI,EAAEY,KAAK,CAACiC,GAAG,EAAER,UAAU,EAAE;QAAA,OAAMgC,OAAO,CAAC,CAAC;MAAA,EAAC;IAC7D,CAAC,MAAM;MACLhF,cAAc,CAACW,IAAI,EAAEqC,UAAU,EAAE;QAAA,OAAMgC,OAAO,CAAC,CAAC;MAAA,EAAC;IACnD;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _slicedToArray from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _objectWithoutProperties from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nvar _excluded = [\"ns\", \"children\"];\nimport { useTranslation } from './useTranslation.js';\nexport var Translation = function Translation(_ref) {\n var ns = _ref.ns,\n children = _ref.children,\n options = _objectWithoutProperties(_ref, _excluded);\n var _useTranslation = useTranslation(ns, options),\n _useTranslation2 = _slicedToArray(_useTranslation, 3),\n t = _useTranslation2[0],\n i18n = _useTranslation2[1],\n ready = _useTranslation2[2];\n return children(t, {\n i18n: i18n,\n lng: i18n.language\n }, ready);\n};","map":{"version":3,"names":["useTranslation","Translation","_ref","ns","children","options","_objectWithoutProperties","_excluded","_useTranslation","_useTranslation2","_slicedToArray","t","i18n","ready","lng","language"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/Translation.js"],"sourcesContent":["import { useTranslation } from './useTranslation.js';\nexport const Translation = ({\n ns,\n children,\n ...options\n}) => {\n const [t, i18n, ready] = useTranslation(ns, options);\n return children(t, {\n i18n,\n lng: i18n.language\n }, ready);\n};"],"mappings":";;;AAAA,SAASA,cAAc,QAAQ,qBAAqB;AACpD,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAIlB;EAAA,IAHJC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IACFC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACLC,OAAO,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAEV,IAAAC,eAAA,GAAyBR,cAAc,CAACG,EAAE,EAAEE,OAAO,CAAC;IAAAI,gBAAA,GAAAC,cAAA,CAAAF,eAAA;IAA7CG,CAAC,GAAAF,gBAAA;IAAEG,IAAI,GAAAH,gBAAA;IAAEI,KAAK,GAAAJ,gBAAA;EACrB,OAAOL,QAAQ,CAACO,CAAC,EAAE;IACjBC,IAAI,EAAJA,IAAI;IACJE,GAAG,EAAEF,IAAI,CAACG;EACZ,CAAC,EAAEF,KAAK,CAAC;AACX,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m12.87 15.07-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7 1.62-4.33L19.12 17h-3.24z\"\n}), 'Translate');\nexports.default = _default;","map":{"version":3,"names":["_interopRequireDefault","require","Object","defineProperty","exports","value","default","_createSvgIcon","_jsxRuntime","_default","jsx","d"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/@mui/icons-material/Translate.js"],"sourcesContent":["\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m12.87 15.07-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7 1.62-4.33L19.12 17h-3.24z\"\n}), 'Translate');\nexports.default = _default;"],"mappings":"AAAA,YAAY;AACZ,YAAY;;AAEZ,IAAIA,sBAAsB,GAAGC,OAAO,CAAC,8CAA8C,CAAC;AACpFC,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAC3CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACE,OAAO,GAAG,KAAK,CAAC;AACxB,IAAIC,cAAc,GAAGP,sBAAsB,CAACC,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC7E,IAAIO,WAAW,GAAGP,OAAO,CAAC,mBAAmB,CAAC;AAC9C,IAAIQ,QAAQ,GAAG,CAAC,CAAC,EAAEF,cAAc,CAACD,OAAO,GAAG,aAAa,CAAC,CAAC,EAAEE,WAAW,CAACE,GAAG,EAAE,MAAM,EAAE;EACpFC,CAAC,EAAE;AACL,CAAC,CAAC,EAAE,WAAW,CAAC;AAChBP,OAAO,CAACE,OAAO,GAAGG,QAAQ","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"export { Trans } from './Trans.js';\nexport { Trans as TransWithoutContext } from './TransWithoutContext.js';\nexport { useTranslation } from './useTranslation.js';\nexport { withTranslation } from './withTranslation.js';\nexport { Translation } from './Translation.js';\nexport { I18nextProvider } from './I18nextProvider.js';\nexport { withSSR } from './withSSR.js';\nexport { useSSR } from './useSSR.js';\nexport { initReactI18next } from './initReactI18next.js';\nexport { setDefaults, getDefaults } from './defaults.js';\nexport { setI18n, getI18n } from './i18nInstance.js';\nexport { I18nContext, composeInitialProps, getInitialProps } from './context.js';\nexport var date = function date() {\n return '';\n};\nexport var time = function time() {\n return '';\n};\nexport var number = function number() {\n return '';\n};\nexport var select = function select() {\n return '';\n};\nexport var plural = function plural() {\n return '';\n};\nexport var selectOrdinal = function selectOrdinal() {\n return '';\n};","map":{"version":3,"names":["Trans","TransWithoutContext","useTranslation","withTranslation","Translation","I18nextProvider","withSSR","useSSR","initReactI18next","setDefaults","getDefaults","setI18n","getI18n","I18nContext","composeInitialProps","getInitialProps","date","time","number","select","plural","selectOrdinal"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/index.js"],"sourcesContent":["export { Trans } from './Trans.js';\nexport { Trans as TransWithoutContext } from './TransWithoutContext.js';\nexport { useTranslation } from './useTranslation.js';\nexport { withTranslation } from './withTranslation.js';\nexport { Translation } from './Translation.js';\nexport { I18nextProvider } from './I18nextProvider.js';\nexport { withSSR } from './withSSR.js';\nexport { useSSR } from './useSSR.js';\nexport { initReactI18next } from './initReactI18next.js';\nexport { setDefaults, getDefaults } from './defaults.js';\nexport { setI18n, getI18n } from './i18nInstance.js';\nexport { I18nContext, composeInitialProps, getInitialProps } from './context.js';\nexport const date = () => '';\nexport const time = () => '';\nexport const number = () => '';\nexport const select = () => '';\nexport const plural = () => '';\nexport const selectOrdinal = () => '';"],"mappings":"AAAA,SAASA,KAAK,QAAQ,YAAY;AAClC,SAASA,KAAK,IAAIC,mBAAmB,QAAQ,0BAA0B;AACvE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,MAAM,QAAQ,aAAa;AACpC,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,WAAW,EAAEC,WAAW,QAAQ,eAAe;AACxD,SAASC,OAAO,EAAEC,OAAO,QAAQ,mBAAmB;AACpD,SAASC,WAAW,EAAEC,mBAAmB,EAAEC,eAAe,QAAQ,cAAc;AAChF,OAAO,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA;EAAA,OAAS,EAAE;AAAA;AAC5B,OAAO,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAA;EAAA,OAAS,EAAE;AAAA;AAC5B,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAS,EAAE;AAAA;AAC9B,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAS,EAAE;AAAA;AAC9B,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAS,EAAE;AAAA;AAC9B,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAA;EAAA,OAAS,EAAE;AAAA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _objectSpread from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport { unescape } from './unescape.js';\nvar defaultOptions = {\n bindI18n: 'languageChanged',\n bindI18nStore: '',\n transEmptyNodeValue: '',\n transSupportBasicHtmlNodes: true,\n transWrapTextNodes: '',\n transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],\n useSuspense: true,\n unescape: unescape\n};\nexport var setDefaults = function setDefaults() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n defaultOptions = _objectSpread(_objectSpread({}, defaultOptions), options);\n};\nexport var getDefaults = function getDefaults() {\n return defaultOptions;\n};","map":{"version":3,"names":["unescape","defaultOptions","bindI18n","bindI18nStore","transEmptyNodeValue","transSupportBasicHtmlNodes","transWrapTextNodes","transKeepBasicHtmlNodesFor","useSuspense","setDefaults","options","arguments","length","undefined","_objectSpread","getDefaults"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/defaults.js"],"sourcesContent":["import { unescape } from './unescape.js';\nlet defaultOptions = {\n bindI18n: 'languageChanged',\n bindI18nStore: '',\n transEmptyNodeValue: '',\n transSupportBasicHtmlNodes: true,\n transWrapTextNodes: '',\n transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],\n useSuspense: true,\n unescape\n};\nexport const setDefaults = (options = {}) => {\n defaultOptions = {\n ...defaultOptions,\n ...options\n };\n};\nexport const getDefaults = () => defaultOptions;"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,eAAe;AACxC,IAAIC,cAAc,GAAG;EACnBC,QAAQ,EAAE,iBAAiB;EAC3BC,aAAa,EAAE,EAAE;EACjBC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,kBAAkB,EAAE,EAAE;EACtBC,0BAA0B,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC;EACtDC,WAAW,EAAE,IAAI;EACjBR,QAAQ,EAARA;AACF,CAAC;AACD,OAAO,IAAMS,WAAW,GAAG,SAAdA,WAAWA,CAAA,EAAqB;EAAA,IAAjBC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACtCV,cAAc,GAAAa,aAAA,CAAAA,aAAA,KACTb,cAAc,GACdS,OAAO,CACX;AACH,CAAC;AACD,OAAO,IAAMK,WAAW,GAAG,SAAdA,WAAWA,CAAA;EAAA,OAASd,cAAc;AAAA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box}from'@mui/material';import Paper from'@mui/material/Paper';import Grid from'@mui/material/Unstable_Grid2';import React,{useContext,useEffect}from'react';import{useCookies}from'react-cookie';import{useTranslation}from'react-i18next';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import TableTitle from'../../components/tableTitle';import Title from'../../components/Title';import{isValidBearerToken}from'../../components/utils';import NodeInfo from'./nodeInfo';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var ClusterInfo=function ClusterInfo(){var endPoint=useContext(ApiContext).endPoint;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var _useTranslation=useTranslation(),t=_useTranslation.t;useEffect(function(){if(sessionStorage.getItem('auth')==='true'&&!isValidBearerToken(sessionStorage.getItem('token'))&&!isValidBearerToken(cookie.token)){navigate('/login',{replace:true});}},[cookie.token]);var handleGoBack=function handleGoBack(){var lastUrl=sessionStorage.getItem('lastActiveUrl');if(lastUrl==='launch_model'){navigate(sessionStorage.getItem('modelType'));}else if(lastUrl==='running_models'){navigate(sessionStorage.getItem('runningModelType'));}else if(lastUrl==='register_model'){navigate(sessionStorage.getItem('registerModelType'));}else{navigate('/launch_model/llm');}};return/*#__PURE__*/_jsxs(Box,{sx:{height:'100%',width:'100%',padding:'20px 20px 0 20px'},children:[/*#__PURE__*/_jsx(Title,{title:t('menu.clusterInfo')}),/*#__PURE__*/_jsxs(Grid,{container:true,spacing:3,style:{width:'100%'},children:[/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(Paper,{sx:{padding:2,display:'flex',overflow:'auto',flexDirection:'column'},children:[/*#__PURE__*/_jsx(TableTitle,{children:t('clusterInfo.supervisor')}),/*#__PURE__*/_jsx(NodeInfo,{nodeRole:\"Supervisor\",endpoint:endPoint,cookie:cookie,handleGoBack:handleGoBack,t:t})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(Paper,{sx:{padding:2,display:'flex',overflow:'auto',flexDirection:'column'},children:[/*#__PURE__*/_jsx(TableTitle,{children:t('clusterInfo.workers')}),/*#__PURE__*/_jsx(NodeInfo,{nodeRole:\"Worker\",endpoint:endPoint,cookie:cookie,handleGoBack:handleGoBack,t:t})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(Paper,{sx:{padding:2,display:'flex',overflow:'auto',flexDirection:'column'},children:[/*#__PURE__*/_jsx(TableTitle,{children:t('clusterInfo.workerDetails')}),/*#__PURE__*/_jsx(NodeInfo,{nodeRole:\"Worker-Details\",endpoint:endPoint,cookie:cookie,handleGoBack:handleGoBack,t:t})]})})]})]});};export default ClusterInfo;","map":{"version":3,"names":["Box","Paper","Grid","React","useContext","useEffect","useCookies","useTranslation","useNavigate","ApiContext","TableTitle","Title","isValidBearerToken","NodeInfo","jsx","_jsx","jsxs","_jsxs","ClusterInfo","endPoint","_useCookies","_useCookies2","_slicedToArray","cookie","navigate","_useTranslation","t","sessionStorage","getItem","token","replace","handleGoBack","lastUrl","sx","height","width","padding","children","title","container","spacing","style","item","xs","display","overflow","flexDirection","nodeRole","endpoint"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/cluster_info/index.js"],"sourcesContent":["import { Box } from '@mui/material'\nimport Paper from '@mui/material/Paper'\nimport Grid from '@mui/material/Unstable_Grid2'\nimport React, { useContext, useEffect } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useTranslation } from 'react-i18next'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport TableTitle from '../../components/tableTitle'\nimport Title from '../../components/Title'\nimport { isValidBearerToken } from '../../components/utils'\nimport NodeInfo from './nodeInfo'\n\nconst ClusterInfo = () => {\n const endPoint = useContext(ApiContext).endPoint\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n const { t } = useTranslation()\n\n useEffect(() => {\n if (\n sessionStorage.getItem('auth') === 'true' &&\n !isValidBearerToken(sessionStorage.getItem('token')) &&\n !isValidBearerToken(cookie.token)\n ) {\n navigate('/login', { replace: true })\n }\n }, [cookie.token])\n\n const handleGoBack = () => {\n const lastUrl = sessionStorage.getItem('lastActiveUrl')\n if (lastUrl === 'launch_model') {\n navigate(sessionStorage.getItem('modelType'))\n } else if (lastUrl === 'running_models') {\n navigate(sessionStorage.getItem('runningModelType'))\n } else if (lastUrl === 'register_model') {\n navigate(sessionStorage.getItem('registerModelType'))\n } else {\n navigate('/launch_model/llm')\n }\n }\n\n return (\n <Box\n sx={{\n height: '100%',\n width: '100%',\n padding: '20px 20px 0 20px',\n }}\n >\n <Title title={t('menu.clusterInfo')} />\n <Grid container spacing={3} style={{ width: '100%' }}>\n <Grid item xs={12}>\n <Paper\n sx={{\n padding: 2,\n display: 'flex',\n overflow: 'auto',\n flexDirection: 'column',\n }}\n >\n <TableTitle>{t('clusterInfo.supervisor')}</TableTitle>\n <NodeInfo\n nodeRole=\"Supervisor\"\n endpoint={endPoint}\n cookie={cookie}\n handleGoBack={handleGoBack}\n t={t}\n />\n </Paper>\n </Grid>\n <Grid item xs={12}>\n <Paper\n sx={{\n padding: 2,\n display: 'flex',\n overflow: 'auto',\n flexDirection: 'column',\n }}\n >\n <TableTitle>{t('clusterInfo.workers')}</TableTitle>\n <NodeInfo\n nodeRole=\"Worker\"\n endpoint={endPoint}\n cookie={cookie}\n handleGoBack={handleGoBack}\n t={t}\n />\n </Paper>\n </Grid>\n <Grid item xs={12}>\n <Paper\n sx={{\n padding: 2,\n display: 'flex',\n overflow: 'auto',\n flexDirection: 'column',\n }}\n >\n <TableTitle>{t('clusterInfo.workerDetails')}</TableTitle>\n <NodeInfo\n nodeRole=\"Worker-Details\"\n endpoint={endPoint}\n cookie={cookie}\n handleGoBack={handleGoBack}\n t={t}\n />\n </Paper>\n </Grid>\n </Grid>\n </Box>\n )\n}\n\nexport default ClusterInfo\n"],"mappings":"6IAAA,OAASA,GAAG,KAAQ,eAAe,CACnC,MAAO,CAAAC,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,IAAI,KAAM,8BAA8B,CAC/C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,KAAQ,OAAO,CACpD,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,cAAc,KAAQ,eAAe,CAC9C,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,UAAU,KAAM,6BAA6B,CACpD,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,OAASC,kBAAkB,KAAQ,wBAAwB,CAC3D,MAAO,CAAAC,QAAQ,KAAM,YAAY,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEjC,GAAM,CAAAC,WAAW,CAAG,QAAd,CAAAA,WAAWA,CAAA,CAAS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AAQ,CAAC,QAAQ,CACjBC,QAAQ,CAAE7B,QAAS,CACnBI,MAAM,CAAEA,MAAO,CACfQ,YAAY,CAAEA,YAAa,CAC3BL,CAAC,CAAEA,CAAE,CACN,CAAC,EACG,CAAC,CACJ,CAAC,cACPX,IAAA,CAACb,IAAI,EAACwC,IAAI,MAACC,EAAE,CAAE,EAAG,CAAAN,QAAA,cAChBpB,KAAA,CAAChB,KAAK,EACJgC,EAAE,CAAE,CACFG,OAAO,CAAE,CAAC,CACVQ,OAAO,CAAE,MAAM,CACfC,QAAQ,CAAE,MAAM,CAChBC,aAAa,CAAE,QACjB,CAAE,CAAAT,QAAA,eAEFtB,IAAA,CAACL,UAAU,EAAA2B,QAAA,CAAEX,CAAC,CAAC,2BAA2B,CAAC,CAAa,CAAC,cACzDX,IAAA,CAACF,QAAQ,EACPkC,QAAQ,CAAC,gBAAgB,CACzBC,QAAQ,CAAE7B,QAAS,CACnBI,MAAM,CAAEA,MAAO,CACfQ,YAAY,CAAEA,YAAa,CAC3BL,CAAC,CAAEA,CAAE,CACN,CAAC,EACG,CAAC,CACJ,CAAC,EACH,CAAC,EACJ,CAAC,CAEV,CAAC,CAED,cAAe,CAAAR,WAAW","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import { createElement, useMemo } from 'react';\nimport { I18nContext } from './context.js';\nexport function I18nextProvider(_ref) {\n var i18n = _ref.i18n,\n defaultNS = _ref.defaultNS,\n children = _ref.children;\n var value = useMemo(function () {\n return {\n i18n: i18n,\n defaultNS: defaultNS\n };\n }, [i18n, defaultNS]);\n return createElement(I18nContext.Provider, {\n value: value\n }, children);\n}","map":{"version":3,"names":["createElement","useMemo","I18nContext","I18nextProvider","_ref","i18n","defaultNS","children","value","Provider"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/I18nextProvider.js"],"sourcesContent":["import { createElement, useMemo } from 'react';\nimport { I18nContext } from './context.js';\nexport function I18nextProvider({\n i18n,\n defaultNS,\n children\n}) {\n const value = useMemo(() => ({\n i18n,\n defaultNS\n }), [i18n, defaultNS]);\n return createElement(I18nContext.Provider, {\n value\n }, children);\n}"],"mappings":"AAAA,SAASA,aAAa,EAAEC,OAAO,QAAQ,OAAO;AAC9C,SAASC,WAAW,QAAQ,cAAc;AAC1C,OAAO,SAASC,eAAeA,CAAAC,IAAA,EAI5B;EAAA,IAHDC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;EAER,IAAMC,KAAK,GAAGP,OAAO,CAAC;IAAA,OAAO;MAC3BI,IAAI,EAAJA,IAAI;MACJC,SAAS,EAATA;IACF,CAAC;EAAA,CAAC,EAAE,CAACD,IAAI,EAAEC,SAAS,CAAC,CAAC;EACtB,OAAON,aAAa,CAACE,WAAW,CAACO,QAAQ,EAAE;IACzCD,KAAK,EAALA;EACF,CAAC,EAAED,QAAQ,CAAC;AACd","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z\"\n}), 'DarkMode');\nexports.default = _default;","map":{"version":3,"names":["_interopRequireDefault","require","Object","defineProperty","exports","value","default","_createSvgIcon","_jsxRuntime","_default","jsx","d"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/@mui/icons-material/DarkMode.js"],"sourcesContent":["\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z\"\n}), 'DarkMode');\nexports.default = _default;"],"mappings":"AAAA,YAAY;AACZ,YAAY;;AAEZ,IAAIA,sBAAsB,GAAGC,OAAO,CAAC,8CAA8C,CAAC;AACpFC,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAC3CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACE,OAAO,GAAG,KAAK,CAAC;AACxB,IAAIC,cAAc,GAAGP,sBAAsB,CAACC,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC7E,IAAIO,WAAW,GAAGP,OAAO,CAAC,mBAAmB,CAAC;AAC9C,IAAIQ,QAAQ,GAAG,CAAC,CAAC,EAAEF,cAAc,CAACD,OAAO,GAAG,aAAa,CAAC,CAAC,EAAEE,WAAW,CAACE,GAAG,EAAE,MAAM,EAAE;EACpFC,CAAC,EAAE;AACL,CAAC,CAAC,EAAE,UAAU,CAAC;AACfP,OAAO,CAACE,OAAO,GAAGG,QAAQ","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,FormControl,Tab}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useTranslation}from'react-i18next';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetchWrapper from'../../components/fetchWrapper';import HotkeyFocusTextField from'../../components/hotkeyFocusTextField';import ModelCard from'./modelCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var customType=['llm','embedding','rerank','image','audio','flexible'];var LaunchCustom=function LaunchCustom(_ref){var gpuAvailable=_ref.gpuAvailable;var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;// States used for filtering\nvar _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(sessionStorage.getItem('subType')),_useState6=_slicedToArray(_useState5,2),value=_useState6[0],setValue=_useState6[1];var _useTranslation=useTranslation(),t=_useTranslation.t;var navigate=useNavigate();var handleTabChange=function handleTabChange(_,newValue){var type=newValue.split('/')[3]==='llm'?'LLM':newValue.split('/')[3];getData(type);setValue(newValue);navigate(newValue);sessionStorage.setItem('subType',newValue);};var handleSearchChange=function handleSearchChange(event){setSearchTerm(event.target.value);};var filter=function filter(registration){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';return modelName.includes(searchTerm.toLowerCase());};useEffect(function(){var type=sessionStorage.getItem('subType').split('/')[3];getData(type==='llm'?'LLM':type);},[]);var getData=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(type){var data,customRegistrations,newData;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context2.next=2;break;}return _context2.abrupt(\"return\");case 2:_context2.prev=2;setIsCallingApi(true);_context2.next=6;return fetchWrapper.get(\"/v1/model_registrations/\".concat(type));case 6:data=_context2.sent;customRegistrations=data.filter(function(data){return!data.is_builtin;});_context2.next=10;return Promise.all(customRegistrations.map(/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetchWrapper.get(\"/v1/model_registrations/\".concat(type,\"/\").concat(registration.model_name));case 2:desc=_context.sent;return _context.abrupt(\"return\",_objectSpread(_objectSpread({},desc),{},{is_builtin:registration.is_builtin}));case 4:case\"end\":return _context.stop();}},_callee);}));return function(_x2){return _ref3.apply(this,arguments);};}()));case 10:newData=_context2.sent;setRegistrationData(newData);_context2.next=17;break;case 14:_context2.prev=14;_context2.t0=_context2[\"catch\"](2);console.error('Error:',_context2.t0);case 17:_context2.prev=17;setIsCallingApi(false);return _context2.finish(17);case 20:case\"end\":return _context2.stop();}},_callee2,null,[[2,14,17,20]]);}));return function getData(_x){return _ref2.apply(this,arguments);};}();var handlecustomDelete=function handlecustomDelete(model_name){setRegistrationData(registrationData.filter(function(item){return item.model_name!==model_name;}));};var style={display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',paddingBottom:'2rem',gridGap:'2rem 0rem'};return/*#__PURE__*/_jsx(Box,{m:\"20px\",children:/*#__PURE__*/_jsxs(TabContext,{value:value,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:value,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:t('model.languageModels'),value:\"/launch_model/custom/llm\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.embeddingModels'),value:\"/launch_model/custom/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.rerankModels'),value:\"/launch_model/custom/rerank\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.imageModels'),value:\"/launch_model/custom/image\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.audioModels'),value:\"/launch_model/custom/audio\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.flexibleModels'),value:\"/launch_model/custom/flexible\"})]})}),customType.map(function(item){return/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/\".concat(item),sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:t('launchModel.search'),value:searchTerm,onChange:handleSearchChange,size:\"small\",hotkey:\"Enter\",t:t})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,is_custom:true,modelType:item==='llm'?'LLM':item,onHandlecustomDelete:handlecustomDelete},filteredRegistration.model_name);})})]},item);})]})});};export default LaunchCustom;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","FormControl","Tab","React","useContext","useEffect","useState","useTranslation","useNavigate","ApiContext","fetchWrapper","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","customType","LaunchCustom","_ref","gpuAvailable","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","sessionStorage","getItem","_useState6","value","setValue","_useTranslation","t","navigate","handleTabChange","_","newValue","type","split","getData","setItem","handleSearchChange","event","target","filter","registration","modelName","model_name","toLowerCase","includes","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee2","data","customRegistrations","newData","wrap","_callee2$","_context2","prev","next","abrupt","get","concat","sent","is_builtin","Promise","all","map","_ref3","_callee","desc","_callee$","_context","_objectSpread","stop","_x2","apply","arguments","t0","console","error","finish","_x","handlecustomDelete","item","style","display","gridTemplateColumns","paddingLeft","paddingBottom","gridGap","m","children","sx","borderBottom","borderColor","onChange","label","padding","margin","variant","id","size","hotkey","filteredRegistration","url","modelData","is_custom","modelType","onHandlecustomDelete"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchCustom.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, FormControl, Tab } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetchWrapper from '../../components/fetchWrapper'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\n\nconst customType = ['llm', 'embedding', 'rerank', 'image', 'audio', 'flexible']\n\nconst LaunchCustom = ({ gpuAvailable }) => {\n let endPoint = useContext(ApiContext).endPoint\n const [registrationData, setRegistrationData] = useState([])\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState('')\n const [value, setValue] = useState(sessionStorage.getItem('subType'))\n const { t } = useTranslation()\n\n const navigate = useNavigate()\n const handleTabChange = (_, newValue) => {\n const type =\n newValue.split('/')[3] === 'llm' ? 'LLM' : newValue.split('/')[3]\n getData(type)\n setValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('subType', newValue)\n }\n\n const handleSearchChange = (event) => {\n setSearchTerm(event.target.value)\n }\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n return modelName.includes(searchTerm.toLowerCase())\n }\n\n useEffect(() => {\n const type = sessionStorage.getItem('subType').split('/')[3]\n getData(type === 'llm' ? 'LLM' : type)\n }, [])\n\n const getData = async (type) => {\n if (isCallingApi || isUpdatingModel) return\n try {\n setIsCallingApi(true)\n\n const data = await fetchWrapper.get(`/v1/model_registrations/${type}`)\n const customRegistrations = data.filter((data) => !data.is_builtin)\n\n const newData = await Promise.all(\n customRegistrations.map(async (registration) => {\n const desc = await fetchWrapper.get(\n `/v1/model_registrations/${type}/${registration.model_name}`\n )\n\n return {\n ...desc,\n is_builtin: registration.is_builtin,\n }\n })\n )\n setRegistrationData(newData)\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n const handlecustomDelete = (model_name) => {\n setRegistrationData(\n registrationData.filter((item) => {\n return item.model_name !== model_name\n })\n )\n }\n\n const style = {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n paddingBottom: '2rem',\n gridGap: '2rem 0rem',\n }\n\n return (\n <Box m=\"20px\">\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab\n label={t('model.languageModels')}\n value=\"/launch_model/custom/llm\"\n />\n <Tab\n label={t('model.embeddingModels')}\n value=\"/launch_model/custom/embedding\"\n />\n <Tab\n label={t('model.rerankModels')}\n value=\"/launch_model/custom/rerank\"\n />\n <Tab\n label={t('model.imageModels')}\n value=\"/launch_model/custom/image\"\n />\n <Tab\n label={t('model.audioModels')}\n value=\"/launch_model/custom/audio\"\n />\n <Tab\n label={t('model.flexibleModels')}\n value=\"/launch_model/custom/flexible\"\n />\n </TabList>\n </Box>\n {customType.map((item) => (\n <TabPanel\n key={item}\n value={`/launch_model/custom/${item}`}\n sx={{ padding: 0 }}\n >\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label={t('launchModel.search')}\n value={searchTerm}\n onChange={handleSearchChange}\n size=\"small\"\n hotkey=\"Enter\"\n t={t}\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n is_custom={true}\n modelType={item === 'llm' ? 'LLM' : item}\n onHandlecustomDelete={handlecustomDelete}\n />\n ))}\n </div>\n </TabPanel>\n ))}\n </TabContext>\n </Box>\n )\n}\n\nexport default LaunchCustom\n"],"mappings":"mkBAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,WAAW,CAAEC,GAAG,KAAQ,eAAe,CACrD,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,cAAc,KAAQ,eAAe,CAC9C,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,YAAY,KAAM,+BAA+B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,u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C5F,IAAA,CAACH,oBAAoB,EACnBwG,EAAE,CAAC,QAAQ,CACXnE,IAAI,CAAC,QAAQ,CACb+D,KAAK,CAAEpE,CAAC,CAAC,oBAAoB,CAAE,CAC/BH,KAAK,CAAEN,UAAW,CAClB4E,QAAQ,CAAE1D,kBAAmB,CAC7BgE,IAAI,CAAC,OAAO,CACZC,MAAM,CAAC,OAAO,CACd1E,CAAC,CAAEA,CAAE,CACN,CAAC,CACS,CAAC,CACX,CAAC,cACN7B,IAAA,QAAKqF,KAAK,CAAEA,KAAM,CAAAO,QAAA,CACfjF,gBAAgB,CACd8B,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9CyB,GAAG,CAAC,SAACqC,oBAAoB,qBACxBxG,IAAA,CAACF,SAAS,EAER2G,GAAG,CAAElG,QAAS,CACdmG,SAAS,CAAEF,oBAAqB,CAChClG,YAAY,CAAEA,YAAa,CAC3BqG,SAAS,CAAE,IAAK,CAChBC,SAAS,CAAExB,IAAI,GAAK,KAAK,CAAG,KAAK,CAAGA,IAAK,CACzCyB,oBAAoB,CAAE1B,kBAAmB,EANpCqB,oBAAoB,CAAC5D,UAO3B,CAAC,EACH,CAAC,CACD,CAAC,GAtCDwC,IAuCG,CAAC,EACZ,CAAC,EACQ,CAAC,CACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAhF,YAAY","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import DarkModeIcon from'@mui/icons-material/DarkMode';import LightModeIcon from'@mui/icons-material/LightMode';import{Box,IconButton}from'@mui/material';import React from'react';import{useThemeContext}from'./themeContext';import{jsx as _jsx}from\"react/jsx-runtime\";var ThemeButton=function ThemeButton(_ref){var sx=_ref.sx;var _useThemeContext=useThemeContext(),themeMode=_useThemeContext.themeMode,toggleTheme=_useThemeContext.toggleTheme;return/*#__PURE__*/_jsx(Box,{sx:sx,children:/*#__PURE__*/_jsx(IconButton,{size:\"large\",onClick:toggleTheme,children:themeMode==='light'?/*#__PURE__*/_jsx(LightModeIcon,{}):/*#__PURE__*/_jsx(DarkModeIcon,{})})});};export default ThemeButton;","map":{"version":3,"names":["DarkModeIcon","LightModeIcon","Box","IconButton","React","useThemeContext","jsx","_jsx","ThemeButton","_ref","sx","_useThemeContext","themeMode","toggleTheme","children","size","onClick"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/themeButton.js"],"sourcesContent":["import DarkModeIcon from '@mui/icons-material/DarkMode'\nimport LightModeIcon from '@mui/icons-material/LightMode'\nimport { Box, IconButton } from '@mui/material'\nimport React from 'react'\n\nimport { useThemeContext } from './themeContext'\n\nconst ThemeButton = ({ sx }) => {\n const { themeMode, toggleTheme } = useThemeContext()\n\n return (\n <Box sx={sx}>\n <IconButton size=\"large\" onClick={toggleTheme}>\n {themeMode === 'light' ? <LightModeIcon /> : <DarkModeIcon />}\n </IconButton>\n </Box>\n )\n}\n\nexport default ThemeButton\n"],"mappings":"AAAA,MAAO,CAAAA,YAAY,KAAM,8BAA8B,CACvD,MAAO,CAAAC,aAAa,KAAM,+BAA+B,CACzD,OAASC,GAAG,CAAEC,UAAU,KAAQ,eAAe,CAC/C,MAAO,CAAAC,KAAK,KAAM,OAAO,CAEzB,OAASC,eAAe,KAAQ,gBAAgB,QAAAC,GAAA,IAAAC,IAAA,yBAEhD,GAAM,CAAAC,WAAW,CAAG,QAAd,CAAAA,WAAWA,CAAAC,IAAA,CAAe,IAAT,CAAAC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACvB,IAAAC,gBAAA,CAAmCN,eAAe,CAAC,CAAC,CAA5CO,SAAS,CAAAD,gBAAA,CAATC,SAAS,CAAEC,WAAW,CAAAF,gBAAA,CAAXE,WAAW,CAE9B,mBACEN,IAAA,CAACL,GAAG,EAACQ,EAAE,CAAEA,EAAG,CAAAI,QAAA,cACVP,IAAA,CAACJ,UAAU,EAACY,IAAI,CAAC,OAAO,CAACC,OAAO,CAAEH,WAAY,CAAAC,QAAA,CAC3CF,SAAS,GAAK,OAAO,cAAGL,IAAA,CAACN,aAAa,GAAE,CAAC,cAAGM,IAAA,CAACP,YAAY,GAAE,CAAC,CACnD,CAAC,CACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAQ,WAAW","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}