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.
- xinference/_compat.py +2 -0
- xinference/_version.py +3 -3
- xinference/api/restful_api.py +77 -71
- xinference/core/chat_interface.py +6 -1
- xinference/core/model.py +79 -19
- xinference/core/supervisor.py +172 -10
- xinference/core/utils.py +12 -8
- xinference/core/worker.py +102 -4
- xinference/deploy/cmdline.py +3 -1
- xinference/deploy/test/test_cmdline.py +56 -0
- xinference/isolation.py +24 -0
- xinference/model/audio/core.py +16 -0
- xinference/model/audio/cosyvoice.py +39 -6
- xinference/model/audio/f5tts.py +200 -0
- xinference/model/audio/f5tts_mlx.py +260 -0
- xinference/model/audio/fish_speech.py +36 -111
- xinference/model/audio/melotts.py +110 -0
- xinference/model/audio/model_spec.json +99 -3
- xinference/model/audio/model_spec_modelscope.json +27 -0
- xinference/model/audio/utils.py +32 -0
- xinference/model/audio/whisper.py +35 -10
- xinference/model/embedding/core.py +203 -142
- xinference/model/embedding/model_spec.json +7 -0
- xinference/model/embedding/model_spec_modelscope.json +8 -0
- xinference/model/image/core.py +69 -1
- xinference/model/image/model_spec.json +145 -4
- xinference/model/image/model_spec_modelscope.json +150 -4
- xinference/model/image/stable_diffusion/core.py +45 -13
- xinference/model/llm/__init__.py +4 -2
- xinference/model/llm/llm_family.json +536 -53
- xinference/model/llm/llm_family.py +15 -36
- xinference/model/llm/llm_family_modelscope.json +454 -20
- xinference/model/llm/memory.py +1 -1
- xinference/model/llm/mlx/core.py +248 -52
- xinference/model/llm/sglang/core.py +1 -0
- xinference/model/llm/transformers/chatglm.py +9 -5
- xinference/model/llm/transformers/cogagent.py +272 -0
- xinference/model/llm/transformers/core.py +2 -0
- xinference/model/llm/transformers/qwen2_vl.py +12 -1
- xinference/model/llm/transformers/utils.py +16 -8
- xinference/model/llm/utils.py +36 -4
- xinference/model/llm/vllm/core.py +53 -10
- xinference/model/llm/vllm/xavier/__init__.py +13 -0
- xinference/model/llm/vllm/xavier/allocator.py +74 -0
- xinference/model/llm/vllm/xavier/block.py +111 -0
- xinference/model/llm/vllm/xavier/block_manager.py +71 -0
- xinference/model/llm/vllm/xavier/block_tracker.py +129 -0
- xinference/model/llm/vllm/xavier/collective.py +74 -0
- xinference/model/llm/vllm/xavier/collective_manager.py +147 -0
- xinference/model/llm/vllm/xavier/engine.py +247 -0
- xinference/model/llm/vllm/xavier/executor.py +134 -0
- xinference/model/llm/vllm/xavier/scheduler.py +438 -0
- xinference/model/llm/vllm/xavier/test/__init__.py +13 -0
- xinference/model/llm/vllm/xavier/test/test_xavier.py +147 -0
- xinference/model/llm/vllm/xavier/transfer.py +319 -0
- xinference/model/video/diffusers.py +14 -0
- xinference/model/video/model_spec.json +15 -0
- xinference/model/video/model_spec_modelscope.json +16 -0
- xinference/thirdparty/cosyvoice/bin/average_model.py +92 -0
- xinference/thirdparty/cosyvoice/bin/export_jit.py +12 -2
- xinference/thirdparty/cosyvoice/bin/export_onnx.py +112 -0
- xinference/thirdparty/cosyvoice/bin/export_trt.sh +9 -0
- xinference/thirdparty/cosyvoice/bin/inference.py +5 -7
- xinference/thirdparty/cosyvoice/bin/spk2info.pt +0 -0
- xinference/thirdparty/cosyvoice/bin/train.py +42 -8
- xinference/thirdparty/cosyvoice/cli/cosyvoice.py +96 -25
- xinference/thirdparty/cosyvoice/cli/frontend.py +77 -30
- xinference/thirdparty/cosyvoice/cli/model.py +330 -80
- xinference/thirdparty/cosyvoice/dataset/dataset.py +6 -2
- xinference/thirdparty/cosyvoice/dataset/processor.py +76 -14
- xinference/thirdparty/cosyvoice/flow/decoder.py +92 -13
- xinference/thirdparty/cosyvoice/flow/flow.py +99 -9
- xinference/thirdparty/cosyvoice/flow/flow_matching.py +110 -13
- xinference/thirdparty/cosyvoice/flow/length_regulator.py +5 -4
- xinference/thirdparty/cosyvoice/hifigan/discriminator.py +140 -0
- xinference/thirdparty/cosyvoice/hifigan/generator.py +58 -42
- xinference/thirdparty/cosyvoice/hifigan/hifigan.py +67 -0
- xinference/thirdparty/cosyvoice/llm/llm.py +139 -6
- xinference/thirdparty/cosyvoice/tokenizer/assets/multilingual_zh_ja_yue_char_del.tiktoken +58836 -0
- xinference/thirdparty/cosyvoice/tokenizer/tokenizer.py +279 -0
- xinference/thirdparty/cosyvoice/transformer/embedding.py +2 -2
- xinference/thirdparty/cosyvoice/transformer/encoder_layer.py +7 -7
- xinference/thirdparty/cosyvoice/transformer/upsample_encoder.py +318 -0
- xinference/thirdparty/cosyvoice/utils/common.py +28 -1
- xinference/thirdparty/cosyvoice/utils/executor.py +69 -7
- xinference/thirdparty/cosyvoice/utils/file_utils.py +2 -12
- xinference/thirdparty/cosyvoice/utils/frontend_utils.py +9 -5
- xinference/thirdparty/cosyvoice/utils/losses.py +20 -0
- xinference/thirdparty/cosyvoice/utils/scheduler.py +1 -2
- xinference/thirdparty/cosyvoice/utils/train_utils.py +101 -45
- xinference/thirdparty/f5_tts/api.py +166 -0
- xinference/thirdparty/f5_tts/configs/E2TTS_Base_train.yaml +44 -0
- xinference/thirdparty/f5_tts/configs/E2TTS_Small_train.yaml +44 -0
- xinference/thirdparty/f5_tts/configs/F5TTS_Base_train.yaml +46 -0
- xinference/thirdparty/f5_tts/configs/F5TTS_Small_train.yaml +46 -0
- xinference/thirdparty/f5_tts/eval/README.md +49 -0
- xinference/thirdparty/f5_tts/eval/ecapa_tdnn.py +330 -0
- xinference/thirdparty/f5_tts/eval/eval_infer_batch.py +207 -0
- xinference/thirdparty/f5_tts/eval/eval_infer_batch.sh +13 -0
- xinference/thirdparty/f5_tts/eval/eval_librispeech_test_clean.py +84 -0
- xinference/thirdparty/f5_tts/eval/eval_seedtts_testset.py +84 -0
- xinference/thirdparty/f5_tts/eval/utils_eval.py +405 -0
- xinference/thirdparty/f5_tts/infer/README.md +191 -0
- xinference/thirdparty/f5_tts/infer/SHARED.md +74 -0
- xinference/thirdparty/f5_tts/infer/examples/basic/basic.toml +11 -0
- xinference/thirdparty/f5_tts/infer/examples/basic/basic_ref_en.wav +0 -0
- xinference/thirdparty/f5_tts/infer/examples/basic/basic_ref_zh.wav +0 -0
- xinference/thirdparty/f5_tts/infer/examples/multi/country.flac +0 -0
- xinference/thirdparty/f5_tts/infer/examples/multi/main.flac +0 -0
- xinference/thirdparty/f5_tts/infer/examples/multi/story.toml +19 -0
- xinference/thirdparty/f5_tts/infer/examples/multi/story.txt +1 -0
- xinference/thirdparty/f5_tts/infer/examples/multi/town.flac +0 -0
- xinference/thirdparty/f5_tts/infer/examples/vocab.txt +2545 -0
- xinference/thirdparty/f5_tts/infer/infer_cli.py +226 -0
- xinference/thirdparty/f5_tts/infer/infer_gradio.py +851 -0
- xinference/thirdparty/f5_tts/infer/speech_edit.py +193 -0
- xinference/thirdparty/f5_tts/infer/utils_infer.py +538 -0
- xinference/thirdparty/f5_tts/model/__init__.py +10 -0
- xinference/thirdparty/f5_tts/model/backbones/README.md +20 -0
- xinference/thirdparty/f5_tts/model/backbones/dit.py +163 -0
- xinference/thirdparty/f5_tts/model/backbones/mmdit.py +146 -0
- xinference/thirdparty/f5_tts/model/backbones/unett.py +219 -0
- xinference/thirdparty/f5_tts/model/cfm.py +285 -0
- xinference/thirdparty/f5_tts/model/dataset.py +319 -0
- xinference/thirdparty/f5_tts/model/modules.py +658 -0
- xinference/thirdparty/f5_tts/model/trainer.py +366 -0
- xinference/thirdparty/f5_tts/model/utils.py +185 -0
- xinference/thirdparty/f5_tts/scripts/count_max_epoch.py +33 -0
- xinference/thirdparty/f5_tts/scripts/count_params_gflops.py +39 -0
- xinference/thirdparty/f5_tts/socket_server.py +159 -0
- xinference/thirdparty/f5_tts/train/README.md +77 -0
- xinference/thirdparty/f5_tts/train/datasets/prepare_csv_wavs.py +139 -0
- xinference/thirdparty/f5_tts/train/datasets/prepare_emilia.py +230 -0
- xinference/thirdparty/f5_tts/train/datasets/prepare_libritts.py +92 -0
- xinference/thirdparty/f5_tts/train/datasets/prepare_ljspeech.py +65 -0
- xinference/thirdparty/f5_tts/train/datasets/prepare_wenetspeech4tts.py +125 -0
- xinference/thirdparty/f5_tts/train/finetune_cli.py +174 -0
- xinference/thirdparty/f5_tts/train/finetune_gradio.py +1846 -0
- xinference/thirdparty/f5_tts/train/train.py +75 -0
- xinference/thirdparty/fish_speech/fish_speech/conversation.py +94 -83
- xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/llama.py +63 -20
- xinference/thirdparty/fish_speech/fish_speech/text/clean.py +1 -26
- xinference/thirdparty/fish_speech/fish_speech/text/spliter.py +1 -1
- xinference/thirdparty/fish_speech/fish_speech/tokenizer.py +152 -0
- xinference/thirdparty/fish_speech/fish_speech/train.py +2 -2
- xinference/thirdparty/fish_speech/fish_speech/webui/manage.py +1 -1
- xinference/thirdparty/fish_speech/tools/{post_api.py → api_client.py} +7 -13
- xinference/thirdparty/fish_speech/tools/api_server.py +98 -0
- xinference/thirdparty/fish_speech/tools/download_models.py +5 -5
- xinference/thirdparty/fish_speech/tools/fish_e2e.py +2 -2
- xinference/thirdparty/fish_speech/tools/inference_engine/__init__.py +192 -0
- xinference/thirdparty/fish_speech/tools/inference_engine/reference_loader.py +125 -0
- xinference/thirdparty/fish_speech/tools/inference_engine/utils.py +39 -0
- xinference/thirdparty/fish_speech/tools/inference_engine/vq_manager.py +57 -0
- xinference/thirdparty/fish_speech/tools/llama/eval_in_context.py +2 -2
- xinference/thirdparty/fish_speech/tools/llama/generate.py +117 -89
- xinference/thirdparty/fish_speech/tools/run_webui.py +104 -0
- xinference/thirdparty/fish_speech/tools/schema.py +11 -28
- xinference/thirdparty/fish_speech/tools/server/agent/__init__.py +57 -0
- xinference/thirdparty/fish_speech/tools/server/agent/generate.py +119 -0
- xinference/thirdparty/fish_speech/tools/server/agent/generation_utils.py +122 -0
- xinference/thirdparty/fish_speech/tools/server/agent/pre_generation_utils.py +72 -0
- xinference/thirdparty/fish_speech/tools/server/api_utils.py +75 -0
- xinference/thirdparty/fish_speech/tools/server/exception_handler.py +27 -0
- xinference/thirdparty/fish_speech/tools/server/inference.py +45 -0
- xinference/thirdparty/fish_speech/tools/server/model_manager.py +122 -0
- xinference/thirdparty/fish_speech/tools/server/model_utils.py +129 -0
- xinference/thirdparty/fish_speech/tools/server/views.py +246 -0
- xinference/thirdparty/fish_speech/tools/webui/__init__.py +173 -0
- xinference/thirdparty/fish_speech/tools/webui/inference.py +91 -0
- xinference/thirdparty/fish_speech/tools/webui/variables.py +14 -0
- xinference/thirdparty/matcha/utils/utils.py +2 -2
- xinference/thirdparty/melo/api.py +135 -0
- xinference/thirdparty/melo/app.py +61 -0
- xinference/thirdparty/melo/attentions.py +459 -0
- xinference/thirdparty/melo/commons.py +160 -0
- xinference/thirdparty/melo/configs/config.json +94 -0
- xinference/thirdparty/melo/data/example/metadata.list +20 -0
- xinference/thirdparty/melo/data_utils.py +413 -0
- xinference/thirdparty/melo/download_utils.py +67 -0
- xinference/thirdparty/melo/infer.py +25 -0
- xinference/thirdparty/melo/init_downloads.py +14 -0
- xinference/thirdparty/melo/losses.py +58 -0
- xinference/thirdparty/melo/main.py +36 -0
- xinference/thirdparty/melo/mel_processing.py +174 -0
- xinference/thirdparty/melo/models.py +1030 -0
- xinference/thirdparty/melo/modules.py +598 -0
- xinference/thirdparty/melo/monotonic_align/__init__.py +16 -0
- xinference/thirdparty/melo/monotonic_align/core.py +46 -0
- xinference/thirdparty/melo/preprocess_text.py +135 -0
- xinference/thirdparty/melo/split_utils.py +174 -0
- xinference/thirdparty/melo/text/__init__.py +35 -0
- xinference/thirdparty/melo/text/chinese.py +199 -0
- xinference/thirdparty/melo/text/chinese_bert.py +107 -0
- xinference/thirdparty/melo/text/chinese_mix.py +253 -0
- xinference/thirdparty/melo/text/cleaner.py +36 -0
- xinference/thirdparty/melo/text/cleaner_multiling.py +110 -0
- xinference/thirdparty/melo/text/cmudict.rep +129530 -0
- xinference/thirdparty/melo/text/cmudict_cache.pickle +0 -0
- xinference/thirdparty/melo/text/english.py +284 -0
- xinference/thirdparty/melo/text/english_bert.py +39 -0
- xinference/thirdparty/melo/text/english_utils/abbreviations.py +35 -0
- xinference/thirdparty/melo/text/english_utils/number_norm.py +97 -0
- xinference/thirdparty/melo/text/english_utils/time_norm.py +47 -0
- xinference/thirdparty/melo/text/es_phonemizer/base.py +140 -0
- xinference/thirdparty/melo/text/es_phonemizer/cleaner.py +109 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_symbols.json +79 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_symbols.txt +1 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_symbols_v2.json +83 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_to_ipa.py +12 -0
- xinference/thirdparty/melo/text/es_phonemizer/example_ipa.txt +400 -0
- xinference/thirdparty/melo/text/es_phonemizer/gruut_wrapper.py +253 -0
- xinference/thirdparty/melo/text/es_phonemizer/punctuation.py +174 -0
- xinference/thirdparty/melo/text/es_phonemizer/spanish_symbols.txt +1 -0
- xinference/thirdparty/melo/text/es_phonemizer/test.ipynb +124 -0
- xinference/thirdparty/melo/text/fr_phonemizer/base.py +140 -0
- xinference/thirdparty/melo/text/fr_phonemizer/cleaner.py +122 -0
- xinference/thirdparty/melo/text/fr_phonemizer/en_symbols.json +78 -0
- xinference/thirdparty/melo/text/fr_phonemizer/example_ipa.txt +1 -0
- xinference/thirdparty/melo/text/fr_phonemizer/fr_symbols.json +89 -0
- xinference/thirdparty/melo/text/fr_phonemizer/fr_to_ipa.py +30 -0
- xinference/thirdparty/melo/text/fr_phonemizer/french_abbreviations.py +48 -0
- xinference/thirdparty/melo/text/fr_phonemizer/french_symbols.txt +1 -0
- xinference/thirdparty/melo/text/fr_phonemizer/gruut_wrapper.py +258 -0
- xinference/thirdparty/melo/text/fr_phonemizer/punctuation.py +172 -0
- xinference/thirdparty/melo/text/french.py +94 -0
- xinference/thirdparty/melo/text/french_bert.py +39 -0
- xinference/thirdparty/melo/text/japanese.py +647 -0
- xinference/thirdparty/melo/text/japanese_bert.py +49 -0
- xinference/thirdparty/melo/text/ko_dictionary.py +44 -0
- xinference/thirdparty/melo/text/korean.py +192 -0
- xinference/thirdparty/melo/text/opencpop-strict.txt +429 -0
- xinference/thirdparty/melo/text/spanish.py +122 -0
- xinference/thirdparty/melo/text/spanish_bert.py +39 -0
- xinference/thirdparty/melo/text/symbols.py +290 -0
- xinference/thirdparty/melo/text/tone_sandhi.py +769 -0
- xinference/thirdparty/melo/train.py +635 -0
- xinference/thirdparty/melo/train.sh +19 -0
- xinference/thirdparty/melo/transforms.py +209 -0
- xinference/thirdparty/melo/utils.py +424 -0
- xinference/types.py +15 -0
- xinference/web/ui/build/asset-manifest.json +6 -6
- xinference/web/ui/build/index.html +1 -1
- xinference/web/ui/build/static/css/main.51a587ff.css +2 -0
- xinference/web/ui/build/static/css/main.51a587ff.css.map +1 -0
- xinference/web/ui/build/static/js/main.b0936c54.js +3 -0
- xinference/web/ui/build/static/js/main.b0936c54.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/03c4052f1b91f6ba0c5389bdcf49c43319b4076c08e4b8585dab312538ae290a.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/1786b83003b8e9605a0f5f855a185d4d16e38fc893dfb326a2a9cca206b4240a.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/17cbc181dd674b9150b80c73ed6a82656de0082d857f6e5f66d9716129ac0b38.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/185ceb8872d562e032b47e79df6a45670e06345b8ed70aad1a131e0476783c5c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/26b8c9f34b0bed789b3a833767672e39302d1e0c09b4276f4d58d1df7b6bd93b.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/2b484da66c724d0d56a40849c109327408796a668b1381511b6e9e03baa48658.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/2cbbbce9b84df73330d4c42b82436ed881b3847628f2fbc346aa62e2859fd88c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/2ec9b14431ed33ce6901bf9f27007be4e6e472709c99d6e22b50ce528e4b78ee.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/3b966db018f96be4a055d6ca205f0990d4d0b370e2980c17d8bca2c9a021819c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/3eefb411b24c2b3ce053570ef50daccf154022f0e168be5ed0fec21394baf9f4.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/522b229e3cac219123f0d69673f5570e191c2d2a505dc65b312d336eae2279c0.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/52e45f17ba300580ea3fcc9f9228ccba194bb092b76f25e9255af311f8b05aab.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/5a0bc4631f936459afc1a3b1d3ec2420118b1f00e11f60ccac3e08088f3f27a8.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/611fa2c6c53b66039991d06dfb0473b5ab37fc63b4564e0f6e1718523768a045.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/6329bc76c406fe5eb305412383fbde5950f847bb5e43261f73f37622c365acb4.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/63c8e07687ea53a4f8a910ee5e42e0eb26cd1acbfbe820f3e3248a786ee51401.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/69b2d5001684174ec9da57e07914eed3eac4960018bceb6cbfa801d861301d7c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/710c1acda69e561e30a933b98c6a56d50197868b15c21e2aad55ab6d46649eb6.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/720deca1fce5a1dc5056048fa8258fd138a82ea855f350b6613f104a73fb761f.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/76a23b92d26a499c57e61eea2b895fbc9771bd0849a72e66f8e633192017978b.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/858063f23b34dfe600254eb5afd85518b0002ec4b30b7386616c45600826e3b2.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/920b82c1c89124cf217109eeedbfcd3aae3b917be50c9dfb6bbb4ce26bdfd2e7.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/94d8b7aeb0076f2ce07db598cea0e87b13bc8d5614eb530b8d6e696c2daf6f88.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/9e917fe7022d01b2ccbe5cc0ce73d70bb72bee584ff293bad71bdff6695dee28.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/9f28fdb8399f1d0474f0aca86f1658dc94f5bf0c90f6146352de150692de8862.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/a0dfafa06b2bb7cba8cad41c482503f61944f759f4318139362602ef5cc47ccb.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/a3ff866acddf34917a7ee399e0e571a4dfd8ba66d5057db885f243e16a6eb17d.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/afb8084f539534cd594755ea2205ecd5bd1f62dddcfdf75a2eace59a28131278.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/b57b1438b77294c1f3f6cfce12ac487d8106c6f016975ba0aec94d98997e2e1e.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/b9917b0bf8e4d55ccbac1c334aa04d6ff3c5b6ed9e5d38b9ea2c687fa7d3f5a9.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/bbcc94b0149963d1d6f267ee1f4f03d3925b758392ce2f516c3fe8af0e0169fc.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/bdee44abeadc4abc17d41c52eb49c6e19a4b1a267b6e16876ce91bdeeebfc52d.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/beb112b70f4a56db95920a9e20efb6c97c37b68450716730217a9ee1a9ae92be.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/c88db97be0cdf440193b3995996e83510a04cb00048135485fc0e26d197e80b5.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/d49e5314d34310a62d01a03067ce1bec5da00abce84c5196aa9c6842fa79a430.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/d7664d18c4ddbad9c3a6a31b91f7c00fb0dde804608674a9860ee50f33e54708.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/d9072c318b819b7c90a0f7e9cc0b6413b4dbeb8e9859898e53d75ea882fcde99.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/db16a983bc08a05f0439cc61ca0840e49e1d8400eef678909f16c032a418a3d6.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/dc249829767b8abcbc3677e0b07b6d3ecbfdfe6d08cfe23a665eb33373a9aa9d.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/e242c583c2dbc2784f0fcf513523975f7d5df447e106c1c17e49e8578a6fc3ed.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/eac5f1296513e69e4b96f750ddccd4d0264e2bae4e4c449144e83274a48698d9.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/ed57202cb79649bb716400436590245547df241988fc7c8e1d85d132299542d2.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/f125bf72e773a14cdaebd0c343e80adb909d12e317ee5c00cd4a57442fbe2c62.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/f91af913d7f91c410719ab13136aaed3aaf0f8dda06652f25c42cb5231587398.json +1 -0
- xinference/web/ui/node_modules/.package-lock.json +67 -3
- xinference/web/ui/node_modules/@babel/runtime/package.json +592 -538
- xinference/web/ui/node_modules/html-parse-stringify/package.json +50 -0
- xinference/web/ui/node_modules/i18next/dist/esm/package.json +1 -0
- xinference/web/ui/node_modules/i18next/package.json +129 -0
- xinference/web/ui/node_modules/react-i18next/.eslintrc.json +74 -0
- xinference/web/ui/node_modules/react-i18next/dist/es/package.json +1 -0
- xinference/web/ui/node_modules/react-i18next/package.json +162 -0
- xinference/web/ui/node_modules/void-elements/package.json +34 -0
- xinference/web/ui/package-lock.json +69 -3
- xinference/web/ui/package.json +2 -0
- xinference/web/ui/src/locales/en.json +186 -0
- xinference/web/ui/src/locales/zh.json +186 -0
- {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/METADATA +68 -32
- {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/RECORD +316 -122
- xinference/thirdparty/cosyvoice/bin/export_trt.py +0 -8
- xinference/thirdparty/fish_speech/tools/api.py +0 -943
- xinference/thirdparty/fish_speech/tools/msgpack_api.py +0 -95
- xinference/thirdparty/fish_speech/tools/webui.py +0 -548
- xinference/web/ui/build/static/css/main.5061c4c3.css +0 -2
- xinference/web/ui/build/static/css/main.5061c4c3.css.map +0 -1
- xinference/web/ui/build/static/js/main.2f269bb3.js +0 -3
- xinference/web/ui/build/static/js/main.2f269bb3.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/07ce9e632e6aff24d7aa3ad8e48224433bbfeb0d633fca723453f1fcae0c9f1c.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/1130403f9e46f5738a23b45ac59b57de8f360c908c713e2c0670c2cce9bd367a.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/131091b25d26b17cdca187d7542a21475c211138d900cf667682260e76ef9463.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/1f269fb2a368363c1cb2237825f1dba093b6bdd8c44cc05954fd19ec2c1fff03.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/331312668fa8bd3d7401818f4a25fa98135d7f61371cd6bfff78b18cf4fbdd92.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/40f17338fc75ae095de7d2b4d8eae0d5ca0193a7e2bcece4ee745b22a7a2f4b7.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/4de9a6942c5f1749d6cbfdd54279699975f16016b182848bc253886f52ec2ec3.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/822586ed1077201b64b954f12f25e3f9b45678c1acbabe53d8af3ca82ca71f33.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/8d33354bd2100c8602afc3341f131a88cc36aaeecd5a4b365ed038514708e350.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/9375a35b05d56989b2755bf72161fa707c92f28569d33765a75f91a568fda6e9.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/a158a9ffa0c9b169aee53dd4a0c44501a596755b4e4f6ede7746d65a72e2a71f.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/bd6ad8159341315a1764c397621a560809f7eb7219ab5174c801fca7e969d943.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/c7bf40bab396765f67d0fed627ed3665890608b2d0edaa3e8cb7cfc96310db45.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/d6c643278a0b28320e6f33a60f5fb64c053997cbdc39a60e53ccc574688ade9e.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/e42b72d4cc1ea412ebecbb8d040dc6c6bfee462c33903c2f1f3facb602ad742e.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/e64b7e8cedcf43d4c95deba60ec1341855c887705805bb62431693118b870c69.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/f5039ddbeb815c51491a1989532006b96fc3ae49c6c60e3c097f875b4ae915ae.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/f72f011744c4649fabddca6f7a9327861ac0a315a89b1a2e62a39774e7863845.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/feabb04b4aa507102da0a64398a40818e878fd1df9b75dda8461b3e1e7ff3f11.json +0 -1
- /xinference/thirdparty/{cosyvoice/bin → f5_tts}/__init__.py +0 -0
- /xinference/thirdparty/{cosyvoice/flow → melo}/__init__.py +0 -0
- /xinference/thirdparty/{cosyvoice/hifigan → melo/text/english_utils}/__init__.py +0 -0
- /xinference/thirdparty/{cosyvoice/llm → melo/text/es_phonemizer}/__init__.py +0 -0
- /xinference/thirdparty/{fish_speech/tools → melo/text/fr_phonemizer}/__init__.py +0 -0
- /xinference/web/ui/build/static/js/{main.2f269bb3.js.LICENSE.txt → main.b0936c54.js.LICENSE.txt} +0 -0
- {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/LICENSE +0 -0
- {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/WHEEL +0 -0
- {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/entry_points.txt +0 -0
- {xinference-1.0.1.dist-info → xinference-1.2.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;\nvar htmlEntities = {\n '&': '&',\n '&': '&',\n '<': '<',\n '<': '<',\n '>': '>',\n '>': '>',\n ''': \"'\",\n ''': \"'\",\n '"': '\"',\n '"': '\"',\n ' ': ' ',\n ' ': ' ',\n '©': '©',\n '©': '©',\n '®': '®',\n '®': '®',\n '…': '…',\n '…': '…',\n '/': '/',\n '/': '/'\n};\nvar unescapeHtmlEntity = function unescapeHtmlEntity(m) {\n return htmlEntities[m];\n};\nexport var unescape = function unescape(text) {\n return text.replace(matchHtmlEntity, unescapeHtmlEntity);\n};","map":{"version":3,"names":["matchHtmlEntity","htmlEntities","unescapeHtmlEntity","m","unescape","text","replace"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/unescape.js"],"sourcesContent":["const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;\nconst htmlEntities = {\n '&': '&',\n '&': '&',\n '<': '<',\n '<': '<',\n '>': '>',\n '>': '>',\n ''': \"'\",\n ''': \"'\",\n '"': '\"',\n '"': '\"',\n ' ': ' ',\n ' ': ' ',\n '©': '©',\n '©': '©',\n '®': '®',\n '®': '®',\n '…': '…',\n '…': '…',\n '/': '/',\n '/': '/'\n};\nconst unescapeHtmlEntity = m => htmlEntities[m];\nexport const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);"],"mappings":"AAAA,IAAMA,eAAe,GAAG,mGAAmG;AAC3H,IAAMC,YAAY,GAAG;EACnB,OAAO,EAAE,GAAG;EACZ,OAAO,EAAE,GAAG;EACZ,MAAM,EAAE,GAAG;EACX,OAAO,EAAE,GAAG;EACZ,MAAM,EAAE,GAAG;EACX,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,GAAG;EACb,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,GAAG;EACb,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,GAAG;EACb,QAAQ,EAAE,GAAG;EACb,QAAQ,EAAE,GAAG;EACb,QAAQ,EAAE,GAAG;EACb,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,GAAG;EACb,UAAU,EAAE,GAAG;EACf,SAAS,EAAE,GAAG;EACd,QAAQ,EAAE,GAAG;EACb,OAAO,EAAE;AACX,CAAC;AACD,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,CAAC;EAAA,OAAIF,YAAY,CAACE,CAAC,CAAC;AAAA;AAC/C,OAAO,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,IAAI;EAAA,OAAIA,IAAI,CAACC,OAAO,CAACN,eAAe,EAAEE,kBAAkB,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{CssBaseline}from'@mui/material';import Snackbar from'@mui/material/Snackbar';import React,{useEffect,useState}from'react';import{useCookies}from'react-cookie';import{HashRouter}from'react-router-dom';import{Alert}from'./components/alertComponent';import{ApiContextProvider}from'./components/apiContext';import AuthAlertDialog from'./components/authAlertDialog';import{ThemeProvider}from'./components/themeContext';import{getEndpoint}from'./components/utils';import WraperRoutes from'./router/index';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";function App(){var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,3),cookie=_useCookies2[0],setCookie=_useCookies2[1],removeCookie=_useCookies2[2];var _useState=useState(''),_useState2=_slicedToArray(_useState,2),msg=_useState2[0],setMsg=_useState2[1];var endPoint=getEndpoint();useEffect(function(){// token possible value: no_auth / need_auth / <real bearer token>\nfetch(endPoint+'/v1/cluster/auth',{method:'GET',headers:{'Content-Type':'application/json'}}).then(function(res){if(!res.ok){res.json().then(function(errorData){setMsg(\"Server error: \".concat(res.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{res.json().then(function(data){if(!data.auth){setCookie('token','no_auth',{path:'/'});sessionStorage.setItem('token','no_auth');}else if(data.auth&&sessionStorage.getItem('token')==='no_auth'){removeCookie('token',{path:'/'});sessionStorage.removeItem('token');}sessionStorage.setItem('auth',String(data.auth));// sessionStorage only can set string value\n});}});},[cookie]);var handleClose=function handleClose(event,reason){if(reason==='clickaway'){return;}setMsg('');};return/*#__PURE__*/_jsx(\"div\",{className:\"app\",children:/*#__PURE__*/_jsxs(ThemeProvider,{children:[/*#__PURE__*/_jsx(Snackbar,{open:msg!=='',autoHideDuration:10000,anchorOrigin:{vertical:'top',horizontal:'center'},onClose:handleClose,children:/*#__PURE__*/_jsx(Alert,{severity:\"error\",onClose:handleClose,sx:{width:'100%'},children:msg})}),/*#__PURE__*/_jsx(HashRouter,{children:/*#__PURE__*/_jsxs(ApiContextProvider,{children:[/*#__PURE__*/_jsx(CssBaseline,{}),/*#__PURE__*/_jsx(AuthAlertDialog,{}),/*#__PURE__*/_jsx(WraperRoutes,{})]})})]})});}export default App;","map":{"version":3,"names":["CssBaseline","Snackbar","React","useEffect","useState","useCookies","HashRouter","Alert","ApiContextProvider","AuthAlertDialog","ThemeProvider","getEndpoint","WraperRoutes","jsx","_jsx","jsxs","_jsxs","App","_useCookies","_useCookies2","_slicedToArray","cookie","setCookie","removeCookie","_useState","_useState2","msg","setMsg","endPoint","fetch","method","headers","then","res","ok","json","errorData","concat","status","detail","data","auth","path","sessionStorage","setItem","getItem","removeItem","String","handleClose","event","reason","className","children","open","autoHideDuration","anchorOrigin","vertical","horizontal","onClose","severity","sx","width"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/App.js"],"sourcesContent":["import { CssBaseline } from '@mui/material'\nimport Snackbar from '@mui/material/Snackbar'\nimport React, { useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { HashRouter } from 'react-router-dom'\n\nimport { Alert } from './components/alertComponent'\nimport { ApiContextProvider } from './components/apiContext'\nimport AuthAlertDialog from './components/authAlertDialog'\nimport { ThemeProvider } from './components/themeContext'\nimport { getEndpoint } from './components/utils'\nimport WraperRoutes from './router/index'\n\nfunction App() {\n const [cookie, setCookie, removeCookie] = useCookies(['token'])\n const [msg, setMsg] = useState('')\n\n const endPoint = getEndpoint()\n\n useEffect(() => {\n // token possible value: no_auth / need_auth / <real bearer token>\n fetch(endPoint + '/v1/cluster/auth', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((res) => {\n if (!res.ok) {\n res.json().then((errorData) => {\n setMsg(\n `Server error: ${res.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n res.json().then((data) => {\n if (!data.auth) {\n setCookie('token', 'no_auth', { path: '/' })\n sessionStorage.setItem('token', 'no_auth')\n } else if (\n data.auth &&\n sessionStorage.getItem('token') === 'no_auth'\n ) {\n removeCookie('token', { path: '/' })\n sessionStorage.removeItem('token')\n }\n sessionStorage.setItem('auth', String(data.auth)) // sessionStorage only can set string value\n })\n }\n })\n }, [cookie])\n\n const handleClose = (event, reason) => {\n if (reason === 'clickaway') {\n return\n }\n setMsg('')\n }\n\n return (\n <div className=\"app\">\n <ThemeProvider>\n <Snackbar\n open={msg !== ''}\n autoHideDuration={10000}\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n onClose={handleClose}\n >\n <Alert severity=\"error\" onClose={handleClose} sx={{ width: '100%' }}>\n {msg}\n </Alert>\n </Snackbar>\n <HashRouter>\n <ApiContextProvider>\n <CssBaseline />\n <AuthAlertDialog />\n <WraperRoutes />\n </ApiContextProvider>\n </HashRouter>\n </ThemeProvider>\n </div>\n )\n}\n\nexport default App\n"],"mappings":"6IAAA,OAASA,WAAW,KAAQ,eAAe,CAC3C,MAAO,CAAAC,QAAQ,KAAM,wBAAwB,CAC7C,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAClD,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,UAAU,KAAQ,kBAAkB,CAE7C,OAASC,KAAK,KAAQ,6BAA6B,CACnD,OAASC,kBAAkB,KAAQ,yBAAyB,CAC5D,MAAO,CAAAC,eAAe,KAAM,8BAA8B,CAC1D,OAASC,aAAa,KAAQ,2BAA2B,CACzD,OAASC,WAAW,KAAQ,oBAAoB,CAChD,MAAO,CAAAC,YAAY,KAAM,gBAAgB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEzC,QAAS,CAAAC,GAAGA,CAAA,CAAG,CACb,IAAAC,WAAA,CAA0Cb,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAAc,YAAA,CAAAC,cAAA,CAAAF,WAAA,IAAxDG,MAAM,CAAAF,YAAA,IAAEG,SAAS,CAAAH,YAAA,IAAEI,YAAY,CAAAJ,YAAA,IACtC,IAAAK,SAAA,CAAsBpB,QAAQ,CAAC,EAAE,CAAC,CAAAqB,UAAA,CAAAL,cAAA,CAAAI,SAAA,IAA3BE,GAAG,CAAAD,UAAA,IAAEE,MAAM,CAAAF,UAAA,IAElB,GAAM,CAAAG,QAAQ,CAAGjB,WAAW,CAAC,CAAC,CA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W,CAAE,CAC1B,OACF,CACAvB,MAAM,CAAC,EAAE,CAAC,CACZ,CAAC,CAED,mBACEb,IAAA,QAAKqC,SAAS,CAAC,KAAK,CAAAC,QAAA,cAClBpC,KAAA,CAACN,aAAa,EAAA0C,QAAA,eACZtC,IAAA,CAACb,QAAQ,EACPoD,IAAI,CAAE3B,GAAG,GAAK,EAAG,CACjB4B,gBAAgB,CAAE,KAAM,CACxBC,YAAY,CAAE,CAAEC,QAAQ,CAAE,KAAK,CAAEC,UAAU,CAAE,QAAS,CAAE,CACxDC,OAAO,CAAEV,WAAY,CAAAI,QAAA,cAErBtC,IAAA,CAACP,KAAK,EAACoD,QAAQ,CAAC,OAAO,CAACD,OAAO,CAAEV,WAAY,CAACY,EAAE,CAAE,CAAEC,KAAK,CAAE,MAAO,CAAE,CAAAT,QAAA,CACjE1B,GAAG,CACC,CAAC,CACA,CAAC,cACXZ,IAAA,CAACR,UAAU,EAAA8C,QAAA,cACTpC,KAAA,CAACR,kBAAkB,EAAA4C,QAAA,eACjBtC,IAAA,CAACd,WAAW,GAAE,CAAC,cACfc,IAAA,CAACL,eAAe,GAAE,CAAC,cACnBK,IAAA,CAACF,YAAY,GAAE,CAAC,EACE,CAAC,CACX,CAAC,EACA,CAAC,CACb,CAAC,CAEV,CAEA,cAAe,CAAAK,GAAG","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import AddIcon from'@mui/icons-material/Add';import DeleteIcon from'@mui/icons-material/Delete';import{Alert,Button,TextField}from'@mui/material';import React 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 regex=/^-?[0-9]\\d*$/;var AddStop=function AddStop(_ref){var label=_ref.label,onGetData=_ref.onGetData,arrItemType=_ref.arrItemType,formData=_ref.formData,onGetError=_ref.onGetError,helperText=_ref.helperText;var _useTranslation=useTranslation(),t=_useTranslation.t;var handleChange=function handleChange(value,index){var arr=_toConsumableArray(formData);arr[index]=value;if(arrItemType==='number'){var newDataArr=arr.map(function(item){if(item&®ex.test(item)){arr.push('true');return Number(item);}if(item&&!regex.test(item))arr.push('false');return item;});onGetError(arr);onGetData(newDataArr);}else{onGetData(_toConsumableArray(arr));}};var handleAdd=function handleAdd(){if(formData[formData.length-1]){onGetData([].concat(_toConsumableArray(formData),['']));}};var handleDelete=function handleDelete(index){onGetData(formData.filter(function(_,subIndex){return index!==subIndex;}));};var handleShowAlert=function handleShowAlert(item){return item!==''&&!regex.test(item)&&arrItemType==='number';};return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'flex',alignItems:'center',marginBottom:10},children:[/*#__PURE__*/_jsx(\"label\",{style:{width:'100px'},children:label}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",size:\"small\",endIcon:/*#__PURE__*/_jsx(AddIcon,{}),className:\"addBtn\",onClick:handleAdd,children:t('registerModel.more')})]}),/*#__PURE__*/_jsx(\"div\",{style:{display:'flex',flexDirection:'column',gap:10,marginInline:50,padding:20,borderRadius:10},children:(formData!==null&&formData!==void 0&&formData.length?formData:['']).map(function(item,index){return/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'flex',alignItems:'center',gap:5},children:[/*#__PURE__*/_jsx(TextField,{value:item,onChange:function onChange(e){return handleChange(e.target.value,index);},label:helperText,size:\"small\",style:{width:'100%'}}),(formData===null||formData===void 0?void 0:formData.length)>1&&/*#__PURE__*/_jsx(DeleteIcon,{onClick:function onClick(){return handleDelete(index);},style:{cursor:'pointer',color:'#1976d2'}})]}),handleShowAlert(item)&&/*#__PURE__*/_jsx(Alert,{severity:\"error\",children:t('registerModel.enterInteger')})]},index);})})]})});};export default AddStop;","map":{"version":3,"names":["AddIcon","DeleteIcon","Alert","Button","TextField","React","useTranslation","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","regex","AddStop","_ref","label","onGetData","arrItemType","formData","onGetError","helperText","_useTranslation","t","handleChange","value","index","arr","_toConsumableArray","newDataArr","map","item","test","push","Number","handleAdd","length","concat","handleDelete","filter","_","subIndex","handleShowAlert","children","style","display","alignItems","marginBottom","width","variant","size","endIcon","className","onClick","flexDirection","gap","marginInline","padding","borderRadius","onChange","e","target","cursor","color","severity"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/components/addStop.js"],"sourcesContent":["import AddIcon from '@mui/icons-material/Add'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport { Alert, Button, TextField } from '@mui/material'\nimport React from 'react'\nimport { useTranslation } from 'react-i18next'\n\nconst regex = /^-?[0-9]\\d*$/\n\nconst AddStop = ({\n label,\n onGetData,\n arrItemType,\n formData,\n onGetError,\n helperText,\n}) => {\n const { t } = useTranslation()\n const handleChange = (value, index) => {\n const arr = [...formData]\n arr[index] = value\n if (arrItemType === 'number') {\n const newDataArr = arr.map((item) => {\n if (item && regex.test(item)) {\n arr.push('true')\n return Number(item)\n }\n if (item && !regex.test(item)) arr.push('false')\n return item\n })\n onGetError(arr)\n onGetData(newDataArr)\n } else {\n onGetData([...arr])\n }\n }\n\n const handleAdd = () => {\n if (formData[formData.length - 1]) {\n onGetData([...formData, ''])\n }\n }\n\n const handleDelete = (index) => {\n onGetData(formData.filter((_, subIndex) => index !== subIndex))\n }\n\n const handleShowAlert = (item) => {\n return item !== '' && !regex.test(item) && arrItemType === 'number'\n }\n\n return (\n <>\n <div>\n <div\n style={{ display: 'flex', alignItems: 'center', marginBottom: 10 }}\n >\n <label style={{ width: '100px' }}>{label}</label>\n <Button\n variant=\"contained\"\n size=\"small\"\n endIcon={<AddIcon />}\n className=\"addBtn\"\n onClick={handleAdd}\n >\n {t('registerModel.more')}\n </Button>\n </div>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: 10,\n marginInline: 50,\n padding: 20,\n borderRadius: 10,\n }}\n >\n {(formData?.length ? formData : ['']).map((item, index) => (\n <div key={index}>\n <div style={{ display: 'flex', alignItems: 'center', gap: 5 }}>\n <TextField\n value={item}\n onChange={(e) => handleChange(e.target.value, index)}\n label={helperText}\n size=\"small\"\n style={{ width: '100%' }}\n />\n {formData?.length > 1 && (\n <DeleteIcon\n onClick={() => handleDelete(index)}\n style={{ cursor: 'pointer', color: '#1976d2' }}\n />\n )}\n </div>\n\n {handleShowAlert(item) && (\n <Alert severity=\"error\">\n {t('registerModel.enterInteger')}\n </Alert>\n )}\n </div>\n ))}\n </div>\n </div>\n </>\n )\n}\n\nexport default AddStop\n"],"mappings":"qJAAA,MAAO,CAAAA,OAAO,KAAM,yBAAyB,CAC7C,MAAO,CAAAC,UAAU,KAAM,4BAA4B,CACnD,OAASC,KAAK,CAAEC,MAAM,CAAEC,SAAS,KAAQ,eAAe,CACxD,MAAO,CAAAC,KAAK,KAAM,OAAO,CACzB,OAASC,cAAc,KAAQ,eAAe,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,gCAAAC,QAAA,IAAAC,SAAA,yBAE9C,GAAM,CAAAC,KAAK,CAAG,cAAc,CAE5B,GAAM,CAAAC,OAAO,CAAG,QAAV,CAAAA,OAAOA,CAAAC,IAAA,CAOP,IANJ,CAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,WAAW,CAAAH,IAAA,CAAXG,WAAW,CACXC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CACRC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CAEV,IAAAC,eAAA,CAAchB,cAAc,CAAC,CAAC,CAAtBiB,CAAC,CAAAD,eA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E,CAAE,CAAE,CAAAZ,QAAA,eAC5DnC,IAAA,CAACJ,SAAS,EACRqB,KAAK,CAAEM,IAAK,CACZ4B,QAAQ,CAAE,SAAAA,SAACC,CAAC,QAAK,CAAApC,YAAY,CAACoC,CAAC,CAACC,MAAM,CAACpC,KAAK,CAAEC,KAAK,CAAC,EAAC,CACrDV,KAAK,CAAEK,UAAW,CAClB6B,IAAI,CAAC,OAAO,CACZN,KAAK,CAAE,CAAEI,KAAK,CAAE,MAAO,CAAE,CAC1B,CAAC,CACD,CAAA7B,QAAQ,SAARA,QAAQ,iBAARA,QAAQ,CAAEiB,MAAM,EAAG,CAAC,eACnB5B,IAAA,CAACP,UAAU,EACToD,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAAf,YAAY,CAACZ,KAAK,CAAC,EAAC,CACnCkB,KAAK,CAAE,CAAEkB,MAAM,CAAE,SAAS,CAAEC,KAAK,CAAE,SAAU,CAAE,CAChD,CACF,EACE,CAAC,CAELrB,eAAe,CAACX,IAAI,CAAC,eACpBvB,IAAA,CAACN,KAAK,EAAC8D,QAAQ,CAAC,OAAO,CAAArB,QAAA,CACpBpB,CAAC,CAAC,4BAA4B,CAAC,CAC3B,CACR,GArBOG,KAsBL,CAAC,EACP,CAAC,CACC,CAAC,EACH,CAAC,CACN,CAAC,CAEP,CAAC,CAED,cAAe,CAAAZ,OAAO","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Chip,FormControl,InputLabel,MenuItem,Select}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useTranslation}from'react-i18next';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 modelAbilityArr=['generate','chat','vision'];var LaunchLLM=function LaunchLLM(_ref){var gpuAvailable=_ref.gpuAvailable;var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi,endPoint=_useContext.endPoint;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];// States used for filtering\nvar _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(''),_useState6=_slicedToArray(_useState5,2),modelAbility=_useState6[0],setModelAbility=_useState6[1];var _useState7=useState(''),_useState8=_slicedToArray(_useState7,2),status=_useState8[0],setStatus=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),statusArr=_useState10[0],setStatusArr=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),completeDeleteArr=_useState12[0],setCompleteDeleteArr=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),collectionArr=_useState14[0],setCollectionArr=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),filterArr=_useState16[0],setFilterArr=_useState16[1];var _useTranslation=useTranslation(),t=_useTranslation.t;var filter=function filter(registration){if(searchTerm!==''){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';var modelDescription=registration.model_description?registration.model_description.toLowerCase():'';if(!modelName.includes(searchTerm.toLowerCase())&&!modelDescription.includes(searchTerm.toLowerCase())){return false;}}if(modelAbility&®istration.model_ability.indexOf(modelAbility)<0)return false;if(completeDeleteArr.includes(registration.model_name)){registration.model_specs.forEach(function(item){item.cache_status=Array.isArray(item)?[false]:false;});}if(statusArr.length===1){if(statusArr[0]==='cached'){var judge=registration.model_specs.some(function(spec){return filterCache(spec);});return judge&&!completeDeleteArr.includes(registration.model_name);}else{return collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name);}}else if(statusArr.length>1){var _judge=registration.model_specs.some(function(spec){return filterCache(spec);});return _judge&&!completeDeleteArr.includes(registration.model_name)&&(collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name));}return true;};var filterCache=function filterCache(spec){if(Array.isArray(spec.cache_status)){return spec.cache_status.some(function(cs){return cs;});}else{return spec.cache_status===true;}};var handleCompleteDelete=function handleCompleteDelete(model_name){setCompleteDeleteArr([].concat(_toConsumableArray(completeDeleteArr),[model_name]));};var update=function update(){if(isCallingApi||isUpdatingModel||cookie.token!=='no_auth'&&!sessionStorage.getItem('token'))return;try{setIsCallingApi(true);fetchWrapper.get('/v1/model_registrations/LLM?detailed=true').then(function(data){var builtinRegistrations=data.filter(function(v){return v.is_builtin;});setRegistrationData(builtinRegistrations);var collectionData=JSON.parse(localStorage.getItem('collectionArr'));setCollectionArr(collectionData);}).catch(function(error){console.error('Error:',error);if(error.response.status!==403&&error.response.status!==401){setErrorMsg(error.message);}});}catch(error){console.error('Error:',error);}finally{setIsCallingApi(false);}};useEffect(function(){update();},[cookie.token]);var getCollectionArr=function getCollectionArr(data){setCollectionArr(data);};var handleChangeFilter=function handleChangeFilter(type,value){if(type==='modelAbility'){setModelAbility(value);setFilterArr([].concat(_toConsumableArray(filterArr.filter(function(item){return!modelAbilityArr.includes(item);})),[value]));}else{setStatus(value);var arr=[].concat(_toConsumableArray(filterArr.filter(function(item){return item!==value;})),[value]);setFilterArr(arr);setStatusArr(arr.filter(function(item){return!modelAbilityArr.includes(item);}));}};var handleDeleteChip=function handleDeleteChip(item){setFilterArr(filterArr.filter(function(subItem){return subItem!==item;}));if(item===modelAbility){setModelAbility('');}else{setStatusArr(statusArr.filter(function(subItem){return subItem!==item;}));if(item===status)setStatus('');}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'grid',gridTemplateColumns:'150px 150px 1fr',columnGap:'20px',margin:'30px 2rem'},children:[/*#__PURE__*/_jsxs(FormControl,{sx:{marginTop:2,minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"ability-select-label\",children:t('launchModel.modelAbility')}),/*#__PURE__*/_jsxs(Select,{id:\"ability\",labelId:\"ability-select-label\",label:\"Model Ability\",onChange:function onChange(e){return handleChangeFilter('modelAbility',e.target.value);},value:modelAbility,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"generate\",children:t('launchModel.generate')}),/*#__PURE__*/_jsx(MenuItem,{value:\"chat\",children:t('launchModel.chat')}),/*#__PURE__*/_jsx(MenuItem,{value:\"vision\",children:t('launchModel.vision')})]})]}),/*#__PURE__*/_jsxs(FormControl,{sx:{marginTop:2,minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"select-status\",children:t('launchModel.status')}),/*#__PURE__*/_jsxs(Select,{id:\"status\",labelId:\"select-status\",label:t('launchModel.status'),onChange:function onChange(e){return handleChangeFilter('status',e.target.value);},value:status,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"cached\",children:t('launchModel.cached')}),/*#__PURE__*/_jsx(MenuItem,{value:\"favorite\",children:t('launchModel.favorite')})]})]}),/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:t('launchModel.search'),value:searchTerm,onChange:function onChange(e){return setSearchTerm(e.target.value);},size:\"small\",hotkey:\"Enter\",t:t})})]}),/*#__PURE__*/_jsx(\"div\",{style:{margin:'0 0 30px 30px'},children:filterArr.map(function(item,index){return/*#__PURE__*/_jsx(Chip,{label:t(\"launchModel.\".concat(item)),variant:\"outlined\",size:\"small\",color:\"primary\",style:{marginRight:10},onDelete:function onDelete(){return handleDeleteChip(item);}},index);})}),/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',gridGap:'2rem 0rem'},children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,modelType:'LLM',onHandleCompleteDelete:handleCompleteDelete,onGetCollectionArr:getCollectionArr},filteredRegistration.model_name);})})]});};export default LaunchLLM;","map":{"version":3,"names":["Box","Chip","FormControl","InputLabel","MenuItem","Select","React","useContext","useEffect","useState","useCookies","useTranslation","ApiContext","fetchWrapper","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","modelAbilityArr","LaunchLLM","_ref","gpuAvailable","_useContext","isCallingApi","setIsCallingApi","endPoint","_useContext2","isUpdatingModel","_useContext3","setErrorMsg","_useCookies","_useCookies2","_slicedToArray","cookie","_useState","_useState2","registrationData","setRegistrationData","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","_useState6","modelAbility","setModelAbility","_useState7","_useState8","status","setStatus","_useState9","_useState10","statusArr","setStatusArr","_useState11","_useState12","completeDeleteArr","setCompleteDeleteArr","_useState13","_useState14","collectionArr","setCollectionArr","_useState15","_useState16","filterArr","setFilterArr","_useTranslation","t","filter","registration","modelName","model_name","toLowerCase","modelDescription","model_description","includes","model_ability","indexOf","model_specs","forEach","item","cache_status","Array","isArray","length","judge","some","spec","filterCache","cs","handleCompleteDelete","concat","_toConsumableArray","update","token","sessionStorage","getItem","get","then","data","builtinRegistrations","v","is_builtin","collectionData","JSON","parse","localStorage","catch","error","console","response","message","getCollectionArr","handleChangeFilter","type","value","arr","handleDeleteChip","subItem","m","children","style","display","gridTemplateColumns","columnGap","margin","sx","marginTop","minWidth","size","id","labelId","label","onChange","e","target","width","variant","hotkey","map","index","color","marginRight","onDelete","paddingLeft","gridGap","filteredRegistration","url","modelData","modelType","onHandleCompleteDelete","onGetCollectionArr"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchLLM.js"],"sourcesContent":["import {\n Box,\n Chip,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n} from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useTranslation } from 'react-i18next'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetchWrapper from '../../components/fetchWrapper'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\n\nconst modelAbilityArr = ['generate', 'chat', 'vision']\n\nconst LaunchLLM = ({ gpuAvailable }) => {\n const { isCallingApi, setIsCallingApi, endPoint } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n\n const [registrationData, setRegistrationData] = useState([])\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState('')\n const [modelAbility, setModelAbility] = useState('')\n const [status, setStatus] = useState('')\n const [statusArr, setStatusArr] = useState([])\n const [completeDeleteArr, setCompleteDeleteArr] = useState([])\n const [collectionArr, setCollectionArr] = useState([])\n const [filterArr, setFilterArr] = useState([])\n const { t } = useTranslation()\n\n const filter = (registration) => {\n if (searchTerm !== '') {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n const modelDescription = registration.model_description\n ? registration.model_description.toLowerCase()\n : ''\n\n if (\n !modelName.includes(searchTerm.toLowerCase()) &&\n !modelDescription.includes(searchTerm.toLowerCase())\n ) {\n return false\n }\n }\n\n if (modelAbility && registration.model_ability.indexOf(modelAbility) < 0)\n return false\n\n if (completeDeleteArr.includes(registration.model_name)) {\n registration.model_specs.forEach((item) => {\n item.cache_status = Array.isArray(item) ? [false] : false\n })\n }\n\n if (statusArr.length === 1) {\n if (statusArr[0] === 'cached') {\n const judge = registration.model_specs.some((spec) => filterCache(spec))\n return judge && !completeDeleteArr.includes(registration.model_name)\n } else {\n return collectionArr?.includes(registration.model_name)\n }\n } else if (statusArr.length > 1) {\n const judge = registration.model_specs.some((spec) => filterCache(spec))\n return (\n judge &&\n !completeDeleteArr.includes(registration.model_name) &&\n collectionArr?.includes(registration.model_name)\n )\n }\n\n return true\n }\n\n const filterCache = (spec) => {\n if (Array.isArray(spec.cache_status)) {\n return spec.cache_status.some((cs) => cs)\n } else {\n return spec.cache_status === true\n }\n }\n\n const handleCompleteDelete = (model_name) => {\n setCompleteDeleteArr([...completeDeleteArr, model_name])\n }\n\n const update = () => {\n if (\n isCallingApi ||\n isUpdatingModel ||\n (cookie.token !== 'no_auth' && !sessionStorage.getItem('token'))\n )\n return\n\n try {\n setIsCallingApi(true)\n\n fetchWrapper\n .get('/v1/model_registrations/LLM?detailed=true')\n .then((data) => {\n const builtinRegistrations = data.filter((v) => v.is_builtin)\n setRegistrationData(builtinRegistrations)\n const collectionData = JSON.parse(\n localStorage.getItem('collectionArr')\n )\n setCollectionArr(collectionData)\n })\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status !== 403 && error.response.status !== 401) {\n setErrorMsg(error.message)\n }\n })\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [cookie.token])\n\n const getCollectionArr = (data) => {\n setCollectionArr(data)\n }\n\n const handleChangeFilter = (type, value) => {\n if (type === 'modelAbility') {\n setModelAbility(value)\n setFilterArr([\n ...filterArr.filter((item) => {\n return !modelAbilityArr.includes(item)\n }),\n value,\n ])\n } else {\n setStatus(value)\n const arr = [\n ...filterArr.filter((item) => {\n return item !== value\n }),\n value,\n ]\n setFilterArr(arr)\n setStatusArr(\n arr.filter((item) => {\n return !modelAbilityArr.includes(item)\n })\n )\n }\n }\n\n const handleDeleteChip = (item) => {\n setFilterArr(\n filterArr.filter((subItem) => {\n return subItem !== item\n })\n )\n if (item === modelAbility) {\n setModelAbility('')\n } else {\n setStatusArr(\n statusArr.filter((subItem) => {\n return subItem !== item\n })\n )\n if (item === status) setStatus('')\n }\n }\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '150px 150px 1fr',\n columnGap: '20px',\n margin: '30px 2rem',\n }}\n >\n <FormControl sx={{ marginTop: 2, minWidth: 120 }} size=\"small\">\n <InputLabel id=\"ability-select-label\">\n {t('launchModel.modelAbility')}\n </InputLabel>\n <Select\n id=\"ability\"\n labelId=\"ability-select-label\"\n label=\"Model Ability\"\n onChange={(e) => handleChangeFilter('modelAbility', e.target.value)}\n value={modelAbility}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"generate\">{t('launchModel.generate')}</MenuItem>\n <MenuItem value=\"chat\">{t('launchModel.chat')}</MenuItem>\n <MenuItem value=\"vision\">{t('launchModel.vision')}</MenuItem>\n </Select>\n </FormControl>\n <FormControl sx={{ marginTop: 2, minWidth: 120 }} size=\"small\">\n <InputLabel id=\"select-status\">{t('launchModel.status')}</InputLabel>\n <Select\n id=\"status\"\n labelId=\"select-status\"\n label={t('launchModel.status')}\n onChange={(e) => handleChangeFilter('status', e.target.value)}\n value={status}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"cached\">{t('launchModel.cached')}</MenuItem>\n <MenuItem value=\"favorite\">{t('launchModel.favorite')}</MenuItem>\n </Select>\n </FormControl>\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={(e) => setSearchTerm(e.target.value)}\n size=\"small\"\n hotkey=\"Enter\"\n t={t}\n />\n </FormControl>\n </div>\n <div style={{ margin: '0 0 30px 30px' }}>\n {filterArr.map((item, index) => (\n <Chip\n key={index}\n label={t(`launchModel.${item}`)}\n variant=\"outlined\"\n size=\"small\"\n color=\"primary\"\n style={{ marginRight: 10 }}\n onDelete={() => handleDeleteChip(item)}\n />\n ))}\n </div>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n gridGap: '2rem 0rem',\n }}\n >\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 modelType={'LLM'}\n onHandleCompleteDelete={handleCompleteDelete}\n onGetCollectionArr={getCollectionArr}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchLLM\n"],"mappings":"kSAAA,OACEA,GAAG,CACHC,IAAI,CACJC,WAAW,CACXC,UAAU,CACVC,QAAQ,CACRC,MAAM,KACD,eAAe,CACtB,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,cAAc,KAAQ,eAAe,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,YAAY,KAAM,+BAA+B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,SAAS,KAAM,aAAa,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEnC,GAAM,CAAAC,eAAe,CAAG,CAAC,UAAU,CAAE,MAAM,CAAE,QAAQ,CAAC,CAEtD,GAAM,CAAAC,SAAS,CAAG,QAAZ,CAAAA,SAASA,CAAAC,IAAA,CAAyB,IAAnB,CAAAC,YAAY,CAAAD,IAAA,CAAZC,YAAY,CAC/B,IAAAC,WAAA,CAAoDjB,UAAU,CAACK,UAAU,CAAC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AAAzB,QAAA,CAEDpF,gBAAgB,CACdgC,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9CsE,GAAG,CAAC,SAACO,oBAAoB,qBACxBnI,IAAA,CAACF,SAAS,EAERsI,GAAG,CAAE1H,QAAS,CACd2H,SAAS,CAAEF,oBAAqB,CAChC7H,YAAY,CAAEA,YAAa,CAC3BgI,SAAS,CAAE,KAAM,CACjBC,sBAAsB,CAAE5D,oBAAqB,CAC7C6D,kBAAkB,CAAEvC,gBAAiB,EANhCkC,oBAAoB,CAAC3E,UAO3B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAApD,SAAS","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{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Tab}from'@mui/material';import React,{useEffect}from'react';import{useCookies}from'react-cookie';import{useTranslation}from'react-i18next';import{useNavigate}from'react-router-dom';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import Title from'../../components/Title';import{isValidBearerToken}from'../../components/utils';import RegisterModelComponent from'./registerModel';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var RegisterModel=function RegisterModel(){var _React$useState=React.useState(sessionStorage.getItem('registerModelType')?sessionStorage.getItem('registerModelType'):'/register_model/llm'),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];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 handleTabChange=function handleTabChange(_,newValue){setTabValue(newValue);navigate(newValue);sessionStorage.setItem('registerModelType',newValue);};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",style:{overflow:'hidden'},children:[/*#__PURE__*/_jsx(Title,{title:t('menu.registerModel')}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:tabValue,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:t('model.languageModels'),value:\"/register_model/llm\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.embeddingModels'),value:\"/register_model/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.rerankModels'),value:\"/register_model/rerank\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.imageModels'),value:\"/register_model/image\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.audioModels'),value:\"/register_model/audio\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.flexibleModels'),value:\"/register_model/flexible\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"LLM\",customData:{version:1,model_name:'custom-llm',model_description:'This is a custom model description.',context_length:2048,model_lang:['en'],model_ability:['generate'],model_specs:[{model_uri:'/path/to/llama-1',model_size_in_billions:7,model_format:'pytorch',quantizations:['none']}],model_family:'your_custom_model'}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/embedding\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"embedding\",customData:{model_name:'custom-embedding',dimensions:768,max_tokens:512,model_uri:'/path/to/embedding-model',language:['en']}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"rerank\",customData:{model_name:'custom-rerank',model_uri:'/path/to/rerank-model',language:['en']}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/image\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"image\",customData:{model_name:'custom-image',model_uri:'/path/to/image-model',model_family:'stable_diffusion',controlnet:[]}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/audio\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"audio\",customData:{model_name:'custom-audio',model_uri:'/path/to/audio-model',multilingual:false,model_family:'whisper'}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/flexible\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"flexible\",customData:{model_name:'flexible-model',model_description:'This is a model description.',model_uri:'/path/to/model',launcher:'xinference.model.flexible.launchers.transformers',launcher_args:'{}'}})})]})]});};export default RegisterModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","useEffect","useCookies","useTranslation","useNavigate","ErrorMessageSnackBar","Title","isValidBearerToken","RegisterModelComponent","jsx","_jsx","jsxs","_jsxs","RegisterModel","_React$useState","useState","sessionStorage","getItem","_React$useState2","_slicedToArray","tabValue","setTabValue","_useCookies","_useCookies2","cookie","navigate","_useTranslation","t","token","replace","handleTabChange","_","newValue","setItem","m","style","overflow","children","title","value","sx","borderBottom","borderColor","onChange","label","padding","modelType","customData","version","model_name","model_description","context_length","model_lang","model_ability","model_specs","model_uri","model_size_in_billions","model_format","quantizations","model_family","dimensions","max_tokens","language","controlnet","multilingual","launcher","launcher_args"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Tab } from '@mui/material'\nimport React, { useEffect } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useTranslation } from 'react-i18next'\nimport { useNavigate } from 'react-router-dom'\n\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport Title from '../../components/Title'\nimport { isValidBearerToken } from '../../components/utils'\nimport RegisterModelComponent from './registerModel'\n\nconst RegisterModel = () => {\n const [tabValue, setTabValue] = React.useState(\n sessionStorage.getItem('registerModelType')\n ? sessionStorage.getItem('registerModelType')\n : '/register_model/llm'\n )\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 handleTabChange = (_, newValue) => {\n setTabValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('registerModelType', newValue)\n }\n\n return (\n <Box m=\"20px\" style={{ overflow: 'hidden' }}>\n <Title title={t('menu.registerModel')} />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={handleTabChange}\n aria-label=\"tabs\"\n >\n <Tab\n label={t('model.languageModels')}\n value=\"/register_model/llm\"\n />\n <Tab\n label={t('model.embeddingModels')}\n value=\"/register_model/embedding\"\n />\n <Tab\n label={t('model.rerankModels')}\n value=\"/register_model/rerank\"\n />\n <Tab label={t('model.imageModels')} value=\"/register_model/image\" />\n <Tab label={t('model.audioModels')} value=\"/register_model/audio\" />\n <Tab\n label={t('model.flexibleModels')}\n value=\"/register_model/flexible\"\n />\n </TabList>\n </Box>\n <TabPanel value=\"/register_model/llm\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"LLM\"\n customData={{\n version: 1,\n model_name: 'custom-llm',\n model_description: 'This is a custom model description.',\n context_length: 2048,\n model_lang: ['en'],\n model_ability: ['generate'],\n model_specs: [\n {\n model_uri: '/path/to/llama-1',\n model_size_in_billions: 7,\n model_format: 'pytorch',\n quantizations: ['none'],\n },\n ],\n model_family: 'your_custom_model',\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/embedding\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"embedding\"\n customData={{\n model_name: 'custom-embedding',\n dimensions: 768,\n max_tokens: 512,\n model_uri: '/path/to/embedding-model',\n language: ['en'],\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/rerank\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"rerank\"\n customData={{\n model_name: 'custom-rerank',\n model_uri: '/path/to/rerank-model',\n language: ['en'],\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/image\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"image\"\n customData={{\n model_name: 'custom-image',\n model_uri: '/path/to/image-model',\n model_family: 'stable_diffusion',\n controlnet: [],\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/audio\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"audio\"\n customData={{\n model_name: 'custom-audio',\n model_uri: '/path/to/audio-model',\n multilingual: false,\n model_family: 'whisper',\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/flexible\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"flexible\"\n customData={{\n model_name: 'flexible-model',\n model_description: 'This is a model description.',\n model_uri: '/path/to/model',\n launcher: 'xinference.model.flexible.launchers.transformers',\n launcher_args: '{}',\n }}\n />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RegisterModel\n"],"mappings":"6IAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,GAAG,KAAQ,eAAe,CACxC,MAAO,CAAAC,KAAK,EAAIC,SAAS,KAAQ,OAAO,CACxC,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,cAAc,KAAQ,eAAe,CAC9C,OAASC,WAAW,KAA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ACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAArD,aAAa","ignoreList":[]},"metadata":{},"sourceType":"module","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\";\nimport _objectSpread from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport _asyncToGenerator from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport _classCallCheck from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";\nimport _createClass from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createClass.js\";\nimport { createContext } from 'react';\nimport { getDefaults, setDefaults } from './defaults.js';\nimport { getI18n, setI18n } from './i18nInstance.js';\nimport { initReactI18next } from './initReactI18next.js';\nexport { getDefaults, setDefaults, getI18n, setI18n, initReactI18next };\nexport var I18nContext = createContext();\nexport var ReportNamespaces = /*#__PURE__*/function () {\n function ReportNamespaces() {\n _classCallCheck(this, ReportNamespaces);\n this.usedNamespaces = {};\n }\n _createClass(ReportNamespaces, [{\n key: \"addUsedNamespaces\",\n value: function addUsedNamespaces(namespaces) {\n var _this = this;\n namespaces.forEach(function (ns) {\n if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;\n });\n }\n }, {\n key: \"getUsedNamespaces\",\n value: function getUsedNamespaces() {\n return Object.keys(this.usedNamespaces);\n }\n }]);\n return ReportNamespaces;\n}();\nexport var composeInitialProps = function composeInitialProps(ForComponent) {\n return /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ctx) {\n var _yield$ForComponent$g, _ForComponent$getInit;\n var componentsInitialProps, i18nInitialProps;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return (_ForComponent$getInit = ForComponent.getInitialProps) === null || _ForComponent$getInit === void 0 ? void 0 : _ForComponent$getInit.call(ForComponent, ctx);\n case 2:\n _context.t1 = _yield$ForComponent$g = _context.sent;\n _context.t0 = _context.t1 !== null;\n if (!_context.t0) {\n _context.next = 6;\n break;\n }\n _context.t0 = _yield$ForComponent$g !== void 0;\n case 6:\n if (!_context.t0) {\n _context.next = 10;\n break;\n }\n _context.t2 = _yield$ForComponent$g;\n _context.next = 11;\n break;\n case 10:\n _context.t2 = {};\n case 11:\n componentsInitialProps = _context.t2;\n i18nInitialProps = getInitialProps();\n return _context.abrupt(\"return\", _objectSpread(_objectSpread({}, componentsInitialProps), i18nInitialProps));\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n};\nexport var getInitialProps = function getInitialProps() {\n var _i18n$reportNamespace, _i18n$reportNamespace2;\n var i18n = getI18n();\n var namespaces = (_i18n$reportNamespace = (_i18n$reportNamespace2 = i18n.reportNamespaces) === null || _i18n$reportNamespace2 === void 0 ? void 0 : _i18n$reportNamespace2.getUsedNamespaces()) !== null && _i18n$reportNamespace !== void 0 ? _i18n$reportNamespace : [];\n var ret = {};\n var initialI18nStore = {};\n i18n.languages.forEach(function (l) {\n initialI18nStore[l] = {};\n namespaces.forEach(function (ns) {\n initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};\n });\n });\n ret.initialI18nStore = initialI18nStore;\n ret.initialLanguage = i18n.language;\n return ret;\n};","map":{"version":3,"names":["createContext","getDefaults","setDefaults","getI18n","setI18n","initReactI18next","I18nContext","ReportNamespaces","_classCallCheck","usedNamespaces","_createClass","key","value","addUsedNamespaces","namespaces","_this","forEach","ns","getUsedNamespaces","Object","keys","composeInitialProps","ForComponent","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","ctx","_yield$ForComponent$g","_ForComponent$getInit","componentsInitialProps","i18nInitialProps","wrap","_callee$","_context","prev","next","getInitialProps","call","t1","sent","t0","t2","abrupt","_objectSpread","stop","_x","apply","arguments","_i18n$reportNamespace","_i18n$reportNamespace2","i18n","reportNamespaces","ret","initialI18nStore","languages","l","getResourceBundle","initialLanguage","language"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/context.js"],"sourcesContent":["import { createContext } from 'react';\nimport { getDefaults, setDefaults } from './defaults.js';\nimport { getI18n, setI18n } from './i18nInstance.js';\nimport { initReactI18next } from './initReactI18next.js';\nexport { getDefaults, setDefaults, getI18n, setI18n, initReactI18next };\nexport const I18nContext = createContext();\nexport class ReportNamespaces {\n constructor() {\n this.usedNamespaces = {};\n }\n addUsedNamespaces(namespaces) {\n namespaces.forEach(ns => {\n if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;\n });\n }\n getUsedNamespaces() {\n return Object.keys(this.usedNamespaces);\n }\n}\nexport const composeInitialProps = ForComponent => async ctx => {\n const componentsInitialProps = (await ForComponent.getInitialProps?.(ctx)) ?? {};\n const i18nInitialProps = getInitialProps();\n return {\n ...componentsInitialProps,\n ...i18nInitialProps\n };\n};\nexport const getInitialProps = () => {\n const i18n = getI18n();\n const namespaces = i18n.reportNamespaces?.getUsedNamespaces() ?? [];\n const ret = {};\n const initialI18nStore = {};\n i18n.languages.forEach(l => {\n initialI18nStore[l] = {};\n namespaces.forEach(ns => {\n initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};\n });\n });\n ret.initialI18nStore = initialI18nStore;\n ret.initialLanguage = i18n.language;\n return ret;\n};"],"mappings":";;;;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,SAASC,WAAW,EAAEC,WAAW,QAAQ,eAAe;AACxD,SAASC,OAAO,EAAEC,OAAO,QAAQ,mBAAmB;AACpD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASJ,WAAW,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AACE,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB3C,UAAU,CAACE,OAAO,CAAC,UAAAC,EAAE,EAAI;MACvBsC,gBAAgB,CAACE,CAAC,CAAC,CAACxC,EAAE,CAAC,GAAGmC,IAAI,CAACM,iBAAiB,CAACD,CAAC,EAAExC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC,CAAC;EACFqC,GAAG,CAACC,gBAAgB,GAAGA,gBAAgB;EACvCD,GAAG,CAACK,eAAe,GAAGP,IAAI,CAACQ,QAAQ;EACnC,OAAON,GAAG;AACZ,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import { setDefaults } from './defaults.js';\nimport { setI18n } from './i18nInstance.js';\nexport var initReactI18next = {\n type: '3rdParty',\n init: function init(instance) {\n setDefaults(instance.options.react);\n setI18n(instance);\n }\n};","map":{"version":3,"names":["setDefaults","setI18n","initReactI18next","type","init","instance","options","react"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/initReactI18next.js"],"sourcesContent":["import { setDefaults } from './defaults.js';\nimport { setI18n } from './i18nInstance.js';\nexport const initReactI18next = {\n type: '3rdParty',\n init(instance) {\n setDefaults(instance.options.react);\n setI18n(instance);\n }\n};"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,OAAO,IAAMC,gBAAgB,GAAG;EAC9BC,IAAI,EAAE,UAAU;EAChBC,IAAI,WAAAA,KAACC,QAAQ,EAAE;IACbL,WAAW,CAACK,QAAQ,CAACC,OAAO,CAACC,KAAK,CAAC;IACnCN,OAAO,CAACI,QAAQ,CAAC;EACnB;AACF,CAAC","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\";\nexport var warn = function warn(i18n, code, msg, rest) {\n var _i18n$services, _i18n$services2, _console;\n var args = [msg, _objectSpread({\n code: code\n }, rest || {})];\n if (i18n !== null && i18n !== void 0 && (_i18n$services = i18n.services) !== null && _i18n$services !== void 0 && (_i18n$services = _i18n$services.logger) !== null && _i18n$services !== void 0 && _i18n$services.forward) {\n return i18n.services.logger.forward(args, 'warn', 'react-i18next::', true);\n }\n if (isString(args[0])) args[0] = \"react-i18next:: \".concat(args[0]);\n if (i18n !== null && i18n !== void 0 && (_i18n$services2 = i18n.services) !== null && _i18n$services2 !== void 0 && (_i18n$services2 = _i18n$services2.logger) !== null && _i18n$services2 !== void 0 && _i18n$services2.warn) {\n var _i18n$services$logger;\n (_i18n$services$logger = i18n.services.logger).warn.apply(_i18n$services$logger, args);\n } else if ((_console = console) !== null && _console !== void 0 && _console.warn) {\n var _console2;\n (_console2 = console).warn.apply(_console2, args);\n }\n};\nvar alreadyWarned = {};\nexport var warnOnce = function warnOnce(i18n, code, msg, rest) {\n if (isString(msg) && alreadyWarned[msg]) return;\n if (isString(msg)) alreadyWarned[msg] = new Date();\n warn(i18n, code, msg, rest);\n};\nvar loadedClb = function loadedClb(i18n, cb) {\n return function () {\n if (i18n.isInitialized) {\n cb();\n } else {\n var initialized = function initialized() {\n setTimeout(function () {\n i18n.off('initialized', initialized);\n }, 0);\n cb();\n };\n i18n.on('initialized', initialized);\n }\n };\n};\nexport var loadNamespaces = function loadNamespaces(i18n, ns, cb) {\n i18n.loadNamespaces(ns, loadedClb(i18n, cb));\n};\nexport var loadLanguages = function loadLanguages(i18n, lng, ns, cb) {\n if (isString(ns)) ns = [ns];\n if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);\n ns.forEach(function (n) {\n if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);\n });\n i18n.loadLanguages(lng, loadedClb(i18n, cb));\n};\nexport var hasLoadedNamespace = function hasLoadedNamespace(ns, i18n) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!i18n.languages || !i18n.languages.length) {\n warnOnce(i18n, 'NO_LANGUAGES', 'i18n.languages were undefined or empty', {\n languages: i18n.languages\n });\n return true;\n }\n return i18n.hasLoadedNamespace(ns, {\n lng: options.lng,\n precheck: function precheck(i18nInstance, loadNotPending) {\n var _options$bindI18n;\n if (((_options$bindI18n = options.bindI18n) === null || _options$bindI18n === void 0 ? void 0 : _options$bindI18n.indexOf('languageChanging')) > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;\n }\n });\n};\nexport var getDisplayName = function getDisplayName(Component) {\n return Component.displayName || Component.name || (isString(Component) && Component.length > 0 ? Component : 'Unknown');\n};\nexport var isString = function isString(obj) {\n return typeof obj === 'string';\n};\nexport var isObject = function isObject(obj) {\n return typeof obj === 'object' && obj !== null;\n};","map":{"version":3,"names":["warn","i18n","code","msg","rest","_i18n$services","_i18n$services2","_console","args","_objectSpread","services","logger","forward","isString","concat","_i18n$services$logger","apply","console","_console2","alreadyWarned","warnOnce","Date","loadedClb","cb","isInitialized","initialized","setTimeout","off","on","loadNamespaces","ns","loadLanguages","lng","options","preload","indexOf","forEach","n","push","hasLoadedNamespace","arguments","length","undefined","languages","precheck","i18nInstance","loadNotPending","_options$bindI18n","bindI18n","backendConnector","backend","isLanguageChangingTo","getDisplayName","Component","displayName","name","obj","isObject"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/utils.js"],"sourcesContent":["export const warn = (i18n, code, msg, rest) => {\n const args = [msg, {\n code,\n ...(rest || {})\n }];\n if (i18n?.services?.logger?.forward) {\n return i18n.services.logger.forward(args, 'warn', 'react-i18next::', true);\n }\n if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;\n if (i18n?.services?.logger?.warn) {\n i18n.services.logger.warn(...args);\n } else if (console?.warn) {\n console.warn(...args);\n }\n};\nconst alreadyWarned = {};\nexport const warnOnce = (i18n, code, msg, rest) => {\n if (isString(msg) && alreadyWarned[msg]) return;\n if (isString(msg)) alreadyWarned[msg] = new Date();\n warn(i18n, code, msg, rest);\n};\nconst loadedClb = (i18n, cb) => () => {\n if (i18n.isInitialized) {\n cb();\n } else {\n const initialized = () => {\n setTimeout(() => {\n i18n.off('initialized', initialized);\n }, 0);\n cb();\n };\n i18n.on('initialized', initialized);\n }\n};\nexport const loadNamespaces = (i18n, ns, cb) => {\n i18n.loadNamespaces(ns, loadedClb(i18n, cb));\n};\nexport const loadLanguages = (i18n, lng, ns, cb) => {\n if (isString(ns)) ns = [ns];\n if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);\n ns.forEach(n => {\n if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);\n });\n i18n.loadLanguages(lng, loadedClb(i18n, cb));\n};\nexport const hasLoadedNamespace = (ns, i18n, options = {}) => {\n if (!i18n.languages || !i18n.languages.length) {\n warnOnce(i18n, 'NO_LANGUAGES', 'i18n.languages were undefined or empty', {\n languages: i18n.languages\n });\n return true;\n }\n return i18n.hasLoadedNamespace(ns, {\n lng: options.lng,\n precheck: (i18nInstance, loadNotPending) => {\n if (options.bindI18n?.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;\n }\n });\n};\nexport const getDisplayName = Component => Component.displayName || Component.name || (isString(Component) && Component.length > 0 ? Component : 'Unknown');\nexport const isString = obj => typeof obj === 'string';\nexport const isObject = obj => typeof obj === 'object' && obj !== null;"],"mappings":";AAAA,OAAO,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAIC,IAAI,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAK;EAAA,IAAAC,cAAA,EAA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,oBAAoB,IAAI,CAACL,cAAc,CAACD,YAAY,CAACM,oBAAoB,EAAErB,EAAE,CAAC,EAAE,OAAO,KAAK;IACvN;EACF,CAAC,CAAC;AACJ,CAAC;AACD,OAAO,IAAMsB,cAAc,GAAG,SAAjBA,cAAcA,CAAGC,SAAS;EAAA,OAAIA,SAAS,CAACC,WAAW,IAAID,SAAS,CAACE,IAAI,KAAK1C,QAAQ,CAACwC,SAAS,CAAC,IAAIA,SAAS,CAACZ,MAAM,GAAG,CAAC,GAAGY,SAAS,GAAG,SAAS,CAAC;AAAA;AAC3J,OAAO,IAAMxC,QAAQ,GAAG,SAAXA,QAAQA,CAAG2C,GAAG;EAAA,OAAI,OAAOA,GAAG,KAAK,QAAQ;AAAA;AACtD,OAAO,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAGD,GAAG;EAAA,OAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIA,GAAG,KAAK,IAAI;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 _objectWithoutProperties from \"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nvar _excluded = [\"initialI18nStore\", \"initialLanguage\"];\nimport { createElement } from 'react';\nimport { useSSR } from './useSSR.js';\nimport { composeInitialProps } from './context.js';\nimport { getDisplayName } from './utils.js';\nexport var withSSR = function withSSR() {\n return function Extend(WrappedComponent) {\n function I18nextWithSSR(_ref) {\n var initialI18nStore = _ref.initialI18nStore,\n initialLanguage = _ref.initialLanguage,\n rest = _objectWithoutProperties(_ref, _excluded);\n useSSR(initialI18nStore, initialLanguage);\n return createElement(WrappedComponent, _objectSpread({}, rest));\n }\n I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);\n I18nextWithSSR.displayName = \"withI18nextSSR(\".concat(getDisplayName(WrappedComponent), \")\");\n I18nextWithSSR.WrappedComponent = WrappedComponent;\n return I18nextWithSSR;\n };\n};","map":{"version":3,"names":["createElement","useSSR","composeInitialProps","getDisplayName","withSSR","Extend","WrappedComponent","I18nextWithSSR","_ref","initialI18nStore","initialLanguage","rest","_objectWithoutProperties","_excluded","_objectSpread","getInitialProps","displayName","concat"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/withSSR.js"],"sourcesContent":["import { createElement } from 'react';\nimport { useSSR } from './useSSR.js';\nimport { composeInitialProps } from './context.js';\nimport { getDisplayName } from './utils.js';\nexport const withSSR = () => function Extend(WrappedComponent) {\n function I18nextWithSSR({\n initialI18nStore,\n initialLanguage,\n ...rest\n }) {\n useSSR(initialI18nStore, initialLanguage);\n return createElement(WrappedComponent, {\n ...rest\n });\n }\n I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);\n I18nextWithSSR.displayName = `withI18nextSSR(${getDisplayName(WrappedComponent)})`;\n I18nextWithSSR.WrappedComponent = WrappedComponent;\n return I18nextWithSSR;\n};"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,SAASC,MAAM,QAAQ,aAAa;AACpC,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,cAAc,QAAQ,YAAY;AAC3C,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAA;EAAA,OAAS,SAASC,MAAMA,CAACC,gBAAgB,EAAE;IAC7D,SAASC,cAAcA,CAAAC,IAAA,EAIpB;MAAA,IAHDC,gBAAgB,GAAAD,IAAA,CAAhBC,gBAAgB;QAChBC,eAAe,GAAAF,IAAA,CAAfE,eAAe;QACZC,IAAI,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;MAEPZ,MAAM,CAACQ,gBAAgB,EAAEC,eAAe,CAAC;MACzC,OAAOV,aAAa,CAACM,gBAAgB,EAAAQ,aAAA,KAChCH,IAAI,CACR,CAAC;IACJ;IACAJ,cAAc,CAACQ,eAAe,GAAGb,mBAAmB,CAACI,gBAAgB,CAAC;IACtEC,cAAc,CAACS,WAAW,qBAAAC,MAAA,CAAqBd,cAAc,CAACG,gBAAgB,CAAC,MAAG;IAClFC,cAAc,CAACD,gBAAgB,GAAGA,gBAAgB;IAClD,OAAOC,cAAc;EACvB,CAAC;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\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import DeleteOutlineOutlinedIcon from'@mui/icons-material/DeleteOutlineOutlined';import OpenInBrowserOutlinedIcon from'@mui/icons-material/OpenInBrowserOutlined';import{TabContext,TabList,TabPanel}from'@mui/lab';import{Badge,Box,Stack,Tab}from'@mui/material';import{DataGrid}from'@mui/x-data-grid';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useTranslation}from'react-i18next';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetcher from'../../components/fetcher';import fetchWrapper from'../../components/fetchWrapper';import Title from'../../components/Title';import{isValidBearerToken}from'../../components/utils';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var tabArr=[{label:'model.languageModels',value:'/running_models/LLM',showPrompt:false},{label:'model.embeddingModels',value:'/running_models/embedding',showPrompt:false},{label:'model.rerankModels',value:'/running_models/rerank',showPrompt:false},{label:'model.imageModels',value:'/running_models/image',showPrompt:false},{label:'model.audioModels',value:'/running_models/audio',showPrompt:false},{label:'model.videoModels',value:'/running_models/video',showPrompt:false},{label:'model.flexibleModels',value:'/running_models/flexible',showPrompt:false}];var RunningModels=function RunningModels(){var _React$useState=React.useState(sessionStorage.getItem('runningModelType')),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var _useState=useState(tabArr),_useState2=_slicedToArray(_useState,2),tabList=_useState2[0],setTabList=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),llmData=_useState4[0],setLlmData=_useState4[1];var _useState5=useState([]),_useState6=_slicedToArray(_useState5,2),embeddingModelData=_useState6[0],setEmbeddingModelData=_useState6[1];var _useState7=useState([]),_useState8=_slicedToArray(_useState7,2),imageModelData=_useState8[0],setImageModelData=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),audioModelData=_useState10[0],setAudioModelData=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),videoModelData=_useState12[0],setVideoModelData=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),rerankModelData=_useState14[0],setRerankModelData=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),flexibleModelData=_useState16[0],setFlexibleModelData=_useState16[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel,setIsUpdatingModel=_useContext2.setIsUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var endPoint=useContext(ApiContext).endPoint;var _useTranslation=useTranslation(),t=_useTranslation.t;var handleTabChange=function handleTabChange(event,newValue){setTabValue(newValue);navigate(newValue);sessionStorage.setItem('runningModelType',newValue);};var update=function update(isCallingApi){if(sessionStorage.getItem('auth')==='true'&&!isValidBearerToken(sessionStorage.getItem('token'))&&!isValidBearerToken(cookie.token)){navigate('/login',{replace:true});return;}if(isCallingApi){setLlmData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setEmbeddingModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setAudioModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setVideoModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setImageModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setRerankModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setFlexibleModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);}else{setIsUpdatingModel(true);fetchWrapper.get('/v1/models').then(function(response){var newLlmData=[];var newEmbeddingModelData=[];var newImageModelData=[];var newAudioModelData=[];var newVideoModelData=[];var newRerankModelData=[];var newFlexibleModelData=[];response.data.forEach(function(model){var newValue=_objectSpread(_objectSpread({},model),{},{id:model.id,url:model.id});if(newValue.model_type==='LLM'){newLlmData.push(newValue);}else if(newValue.model_type==='embedding'){newEmbeddingModelData.push(newValue);}else if(newValue.model_type==='audio'){newAudioModelData.push(newValue);}else if(newValue.model_type==='video'){newVideoModelData.push(newValue);}else if(newValue.model_type==='image'){newImageModelData.push(newValue);}else if(newValue.model_type==='rerank'){newRerankModelData.push(newValue);}else if(newValue.model_type==='flexible'){newFlexibleModelData.push(newValue);}});setLlmData(newLlmData);setEmbeddingModelData(newEmbeddingModelData);setAudioModelData(newAudioModelData);setVideoModelData(newVideoModelData);setImageModelData(newImageModelData);setRerankModelData(newRerankModelData);setFlexibleModelData(newFlexibleModelData);setIsUpdatingModel(false);}).catch(function(error){console.error('Error:',error);setIsUpdatingModel(false);if(error.response.status!==403&&error.response.status!==401){setErrorMsg(error.message);}});}};useEffect(function(){update(isCallingApi);// eslint-disable-next-line\n},[isCallingApi,cookie.token]);var llmColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:t('runningModels.name'),flex:1},{field:'address',headerName:t('runningModels.address'),flex:1},{field:'accelerators',headerName:t('runningModels.gpuIndexes'),flex:1},{field:'model_size_in_billions',headerName:t('runningModels.size'),flex:1},{field:'quantization',headerName:t('runningModels.quantization'),flex:1},{field:'replica',headerName:t('runningModels.replica'),flex:1},{field:'url',headerName:t('runningModels.actions'),flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref){var row=_ref.row;var url=row.url;var openUrl=\"\".concat(endPoint,\"/\")+url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;var gradioUrl=\"\".concat(endPoint,\"/v1/ui/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsxs(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch Web UI\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){// Make sure no ongoing call\nreturn;}setIsCallingApi(true);fetcher(openUrl,{method:'HEAD'}).then(function(response){if(response.status===404){// If web UI doesn't exist (404 Not Found)\nconsole.log('UI does not exist, creating new...');return fetcher(gradioUrl,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model_type:row.model_type,model_name:row.model_family,model_size_in_billions:row.model_size_in_billions,model_format:row.model_format,quantization:row.quantization,context_length:row.context_length,model_ability:row.model_ability,model_description:row.model_description,model_lang:row.model_lang})}).then(function(response){return response.json();}).then(function(){return window.open(openUrl,'_blank','noopener noreferrer');}).finally(function(){return setIsCallingApi(false);});}else if(response.ok){// If web UI does exist\nconsole.log('UI exists, opening...');window.open(openUrl,'_blank','noopener noreferrer');setIsCallingApi(false);}else{// Other HTTP errors\nconsole.error(\"Unexpected response status: \".concat(response.status));setIsCallingApi(false);}}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(OpenInBrowserOutlinedIcon,{})})}),/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})]});}}];var embeddingModelColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:t('runningModels.name'),flex:1},{field:'address',headerName:t('runningModels.address'),flex:1},{field:'accelerators',headerName:t('runningModels.gpuIndexes'),flex:1},{field:'replica',headerName:t('runningModels.replica'),flex:1},{field:'url',headerName:t('runningModels.actions'),flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref2){var row=_ref2.row;var url=row.url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsx(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})});}}];var imageModelColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:t('runningModels.name'),flex:1},{field:'address',headerName:t('runningModels.address'),flex:1},{field:'accelerators',headerName:t('runningModels.gpuIndexes'),flex:1},{field:'url',headerName:t('runningModels.actions'),flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref3){var row=_ref3.row;//这个url指的是model_uid\nvar url=row.url;console.log('url: '+url);var openUrl=\"\".concat(endPoint,\"/\")+url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;var gradioUrl=\"\".concat(endPoint,\"/v1/ui/images/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsxs(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch Web UI\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){// Make sure no ongoing call\nreturn;}setIsCallingApi(true);fetcher(openUrl,{method:'HEAD'}).then(function(response){if(response.status===404){// If web UI doesn't exist (404 Not Found)\nconsole.log('UI does not exist, creating new...');return fetcher(gradioUrl,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model_type:row.model_type,model_family:row.model_family,model_id:row.id,controlnet:row.controlnet,model_revision:row.model_revision,model_name:row.model_name,model_ability:row.model_ability})}).then(function(response){return response.json();}).then(function(){return window.open(openUrl,'_blank','noopener noreferrer');}).finally(function(){return setIsCallingApi(false);});}else if(response.ok){// If web UI does exist\nconsole.log('UI exists, opening...');window.open(openUrl,'_blank','noopener noreferrer');setIsCallingApi(false);}else{// Other HTTP errors\nconsole.error(\"Unexpected response status: \".concat(response.status));setIsCallingApi(false);}}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(OpenInBrowserOutlinedIcon,{})})}),/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})]});}}];var audioModelColumns=embeddingModelColumns;var videoModelColumns=embeddingModelColumns;var rerankModelColumns=embeddingModelColumns;var flexibleModelColumns=embeddingModelColumns;var dataGridStyle={'& .MuiDataGrid-cell':{borderBottom:'none'},'& .MuiDataGrid-columnHeaders':{borderBottom:'none'},'& .MuiDataGrid-columnHeaderTitle':{fontWeight:'bold'},'& .MuiDataGrid-virtualScroller':{overflowX:'visible !important',overflow:'visible'},'& .MuiDataGrid-footerContainer':{borderTop:'none'},'border-width':'0px'};var noRowsOverlay=function noRowsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:t('runningModels.noRunningModels')});};var noResultsOverlay=function noResultsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:t('runningModels.noRunningModelsMatches')});};useEffect(function(){var dataMap={'Language Models':llmData,'Embedding Models':embeddingModelData,'Rerank Models':rerankModelData,'Image Models':imageModelData,'Audio Models':audioModelData,'Video Models':videoModelData,'Flexible Models':flexibleModelData};setTabList(tabList.map(function(item){var _dataMap$item$label;if((_dataMap$item$label=dataMap[item.label])!==null&&_dataMap$item$label!==void 0&&_dataMap$item$label.length&&dataMap[item.label][0].model_type){return _objectSpread(_objectSpread({},item),{},{showPrompt:true});}return _objectSpread(_objectSpread({},item),{},{showPrompt:false});}));},[llmData,embeddingModelData,rerankModelData,imageModelData,audioModelData,videoModelData,flexibleModelData]);return/*#__PURE__*/_jsxs(Box,{sx:{height:'100%',width:'100%',padding:'20px 20px 0 20px'},children:[/*#__PURE__*/_jsx(Title,{title:t('menu.runningModels')}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsx(TabList,{value:tabValue,onChange:handleTabChange,\"aria-label\":\"tabs\",children:tabList.map(function(item){return/*#__PURE__*/_jsx(Tab,{label:/*#__PURE__*/_jsx(Badge,{color:\"secondary\",variant:\"dot\",invisible:!item.showPrompt,children:t(item.label)}),value:item.value},item.value);})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/LLM\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:llmData,columns:llmColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/embedding\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:embeddingModelData,columns:embeddingModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:rerankModelData,columns:rerankModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/image\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:imageModelData,columns:imageModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/audio\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:audioModelData,columns:audioModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/video\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:videoModelData,columns:videoModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/running_models/flexible\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:flexibleModelData,columns:flexibleModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})})]})]});};export default RunningModels;","map":{"version":3,"names":["DeleteOutlineOutlinedIcon","OpenInBrowserOutlinedIcon","TabContext","TabList","TabPanel","Badge","Box","Stack","Tab","DataGrid","React","useContext","useEffect","useState","useCookies","useTranslation","useNavigate","ApiContext","ErrorMessageSnackBar","fetcher","fetchWrapper","Title","isValidBearerToken","jsx","_jsx","jsxs","_jsxs","tabArr","label","value","showPrompt","RunningModels","_React$useState","sessionStorage","getItem","_React$useState2","_slicedToArray","tabValue","setTabValue","_useState","_useState2","tabList","setTabList","_useState3","_useState4","llmData","setLlmData","_useState5","_useState6","embeddingModelData","setEmbeddingModelData","_useState7","_useState8","imageModelData","setImageModelData","_useState9","_useState10","audioModelData","setAudioModelData","_useState11","_useState12","videoModelData","setVideoModelData","_useState13","_useState14","rerankModelData","setRerankModelData","_useState15","_useState16","flexibleModelData","setFlexibleModelData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","setIsUpdatingModel","_useContext3","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","endPoint","_useTranslation","t","handleTabChange","event","newValue","setItem","update","token","replace","id","url","get","then","response","newLlmData","newEmbeddingModelData","newImageModelData","newAudioModelData","newVideoModelData","newRerankModelData","newFlexibleModelData","data","forEach","model","_objectSpread","model_type","push","catch","error","console","status","message","llmColumns","field","headerName","flex","minWidth","sortable","filterable","disableColumnMenu","renderCell","_ref","row","openUrl","concat","closeUrl","gradioUrl","style","width","display","justifyContent","alignItems","children","title","borderWidth","backgroundColor","paddingLeft","paddingRight","onClick","method","log","headers","body","JSON","stringify","model_name","model_family","model_size_in_billions","model_format","quantization","context_length","model_ability","model_description","model_lang","json","window","open","finally","ok","m","p","borderRadius","border","borderColor","embeddingModelColumns","_ref2","imageModelColumns","_ref3","model_id","controlnet","model_revision","audioModelColumns","videoModelColumns","rerankModelColumns","flexibleModelColumns","dataGridStyle","borderBottom","fontWeight","overflowX","overflow","borderTop","noRowsOverlay","height","noResultsOverlay","dataMap","map","item","_dataMap$item$label","length","sx","padding","onChange","color","variant","invisible","rows","columns","autoHeight","slots"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/running_models/index.js"],"sourcesContent":["import DeleteOutlineOutlinedIcon from '@mui/icons-material/DeleteOutlineOutlined'\nimport OpenInBrowserOutlinedIcon from '@mui/icons-material/OpenInBrowserOutlined'\nimport { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Badge, Box, Stack, Tab } from '@mui/material'\nimport { DataGrid } from '@mui/x-data-grid'\nimport React, { useContext, useEffect, useState } 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 ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetcher from '../../components/fetcher'\nimport fetchWrapper from '../../components/fetchWrapper'\nimport Title from '../../components/Title'\nimport { isValidBearerToken } from '../../components/utils'\n\nconst tabArr = [\n {\n label: 'model.languageModels',\n value: '/running_models/LLM',\n showPrompt: false,\n },\n {\n label: 'model.embeddingModels',\n value: '/running_models/embedding',\n showPrompt: false,\n },\n {\n label: 'model.rerankModels',\n value: '/running_models/rerank',\n showPrompt: false,\n },\n {\n label: 'model.imageModels',\n value: '/running_models/image',\n showPrompt: false,\n },\n {\n label: 'model.audioModels',\n value: '/running_models/audio',\n showPrompt: false,\n },\n {\n label: 'model.videoModels',\n value: '/running_models/video',\n showPrompt: false,\n },\n {\n label: 'model.flexibleModels',\n value: '/running_models/flexible',\n showPrompt: false,\n },\n]\n\nconst RunningModels = () => {\n const [tabValue, setTabValue] = React.useState(\n sessionStorage.getItem('runningModelType')\n )\n const [tabList, setTabList] = useState(tabArr)\n const [llmData, setLlmData] = useState([])\n const [embeddingModelData, setEmbeddingModelData] = useState([])\n const [imageModelData, setImageModelData] = useState([])\n const [audioModelData, setAudioModelData] = useState([])\n const [videoModelData, setVideoModelData] = useState([])\n const [rerankModelData, setRerankModelData] = useState([])\n const [flexibleModelData, setFlexibleModelData] = useState([])\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel, setIsUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n const endPoint = useContext(ApiContext).endPoint\n const { t } = useTranslation()\n\n const handleTabChange = (event, newValue) => {\n setTabValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('runningModelType', newValue)\n }\n\n const update = (isCallingApi) => {\n if (\n sessionStorage.getItem('auth') === 'true' &&\n !isValidBearerToken(sessionStorage.getItem('token')) &&\n !isValidBearerToken(cookie.token)\n ) {\n navigate('/login', { replace: true })\n return\n }\n if (isCallingApi) {\n setLlmData([{ id: 'Loading, do not refresh page...', url: 'IS_LOADING' }])\n setEmbeddingModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setAudioModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setVideoModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setImageModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setRerankModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setFlexibleModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n } else {\n setIsUpdatingModel(true)\n\n fetchWrapper\n .get('/v1/models')\n .then((response) => {\n const newLlmData = []\n const newEmbeddingModelData = []\n const newImageModelData = []\n const newAudioModelData = []\n const newVideoModelData = []\n const newRerankModelData = []\n const newFlexibleModelData = []\n response.data.forEach((model) => {\n let newValue = {\n ...model,\n id: model.id,\n url: model.id,\n }\n if (newValue.model_type === 'LLM') {\n newLlmData.push(newValue)\n } else if (newValue.model_type === 'embedding') {\n newEmbeddingModelData.push(newValue)\n } else if (newValue.model_type === 'audio') {\n newAudioModelData.push(newValue)\n } else if (newValue.model_type === 'video') {\n newVideoModelData.push(newValue)\n } else if (newValue.model_type === 'image') {\n newImageModelData.push(newValue)\n } else if (newValue.model_type === 'rerank') {\n newRerankModelData.push(newValue)\n } else if (newValue.model_type === 'flexible') {\n newFlexibleModelData.push(newValue)\n }\n })\n setLlmData(newLlmData)\n setEmbeddingModelData(newEmbeddingModelData)\n setAudioModelData(newAudioModelData)\n setVideoModelData(newVideoModelData)\n setImageModelData(newImageModelData)\n setRerankModelData(newRerankModelData)\n setFlexibleModelData(newFlexibleModelData)\n setIsUpdatingModel(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsUpdatingModel(false)\n if (error.response.status !== 403 && error.response.status !== 401) {\n setErrorMsg(error.message)\n }\n })\n }\n }\n\n useEffect(() => {\n update(isCallingApi)\n // eslint-disable-next-line\n }, [isCallingApi, cookie.token])\n\n const llmColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: t('runningModels.name'),\n flex: 1,\n },\n {\n field: 'address',\n headerName: t('runningModels.address'),\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: t('runningModels.gpuIndexes'),\n flex: 1,\n },\n {\n field: 'model_size_in_billions',\n headerName: t('runningModels.size'),\n flex: 1,\n },\n {\n field: 'quantization',\n headerName: t('runningModels.quantization'),\n flex: 1,\n },\n {\n field: 'replica',\n headerName: t('runningModels.replica'),\n flex: 1,\n },\n {\n field: 'url',\n headerName: t('runningModels.actions'),\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url\n const openUrl = `${endPoint}/` + url\n const closeUrl = `${endPoint}/v1/models/` + url\n const gradioUrl = `${endPoint}/v1/ui/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Launch Web UI\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n // Make sure no ongoing call\n return\n }\n\n setIsCallingApi(true)\n\n fetcher(openUrl, {\n method: 'HEAD',\n })\n .then((response) => {\n if (response.status === 404) {\n // If web UI doesn't exist (404 Not Found)\n console.log('UI does not exist, creating new...')\n return fetcher(gradioUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model_type: row.model_type,\n model_name: row.model_family,\n model_size_in_billions: row.model_size_in_billions,\n model_format: row.model_format,\n quantization: row.quantization,\n context_length: row.context_length,\n model_ability: row.model_ability,\n model_description: row.model_description,\n model_lang: row.model_lang,\n }),\n })\n .then((response) => response.json())\n .then(() =>\n window.open(openUrl, '_blank', 'noopener noreferrer')\n )\n .finally(() => setIsCallingApi(false))\n } else if (response.ok) {\n // If web UI does exist\n console.log('UI exists, opening...')\n window.open(openUrl, '_blank', 'noopener noreferrer')\n setIsCallingApi(false)\n } else {\n // Other HTTP errors\n console.error(\n `Unexpected response status: ${response.status}`\n )\n setIsCallingApi(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <OpenInBrowserOutlinedIcon />\n </Box>\n </button>\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n const embeddingModelColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: t('runningModels.name'),\n flex: 1,\n },\n {\n field: 'address',\n headerName: t('runningModels.address'),\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: t('runningModels.gpuIndexes'),\n flex: 1,\n },\n {\n field: 'replica',\n headerName: t('runningModels.replica'),\n flex: 1,\n },\n {\n field: 'url',\n headerName: t('runningModels.actions'),\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url\n const closeUrl = `${endPoint}/v1/models/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n const imageModelColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: t('runningModels.name'),\n flex: 1,\n },\n {\n field: 'address',\n headerName: t('runningModels.address'),\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: t('runningModels.gpuIndexes'),\n flex: 1,\n },\n {\n field: 'url',\n headerName: t('runningModels.actions'),\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n //这个url指的是model_uid\n const url = row.url\n console.log('url: ' + url)\n const openUrl = `${endPoint}/` + url\n const closeUrl = `${endPoint}/v1/models/` + url\n const gradioUrl = `${endPoint}/v1/ui/images/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Launch Web UI\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n // Make sure no ongoing call\n return\n }\n\n setIsCallingApi(true)\n\n fetcher(openUrl, {\n method: 'HEAD',\n })\n .then((response) => {\n if (response.status === 404) {\n // If web UI doesn't exist (404 Not Found)\n console.log('UI does not exist, creating new...')\n return fetcher(gradioUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model_type: row.model_type,\n model_family: row.model_family,\n model_id: row.id,\n controlnet: row.controlnet,\n model_revision: row.model_revision,\n model_name: row.model_name,\n model_ability: row.model_ability,\n }),\n })\n .then((response) => response.json())\n .then(() =>\n window.open(openUrl, '_blank', 'noopener noreferrer')\n )\n .finally(() => setIsCallingApi(false))\n } else if (response.ok) {\n // If web UI does exist\n console.log('UI exists, opening...')\n window.open(openUrl, '_blank', 'noopener noreferrer')\n setIsCallingApi(false)\n } else {\n // Other HTTP errors\n console.error(\n `Unexpected response status: ${response.status}`\n )\n setIsCallingApi(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <OpenInBrowserOutlinedIcon />\n </Box>\n </button>\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n const audioModelColumns = embeddingModelColumns\n const videoModelColumns = embeddingModelColumns\n const rerankModelColumns = embeddingModelColumns\n const flexibleModelColumns = embeddingModelColumns\n\n const dataGridStyle = {\n '& .MuiDataGrid-cell': {\n borderBottom: 'none',\n },\n '& .MuiDataGrid-columnHeaders': {\n borderBottom: 'none',\n },\n '& .MuiDataGrid-columnHeaderTitle': {\n fontWeight: 'bold',\n },\n '& .MuiDataGrid-virtualScroller': {\n overflowX: 'visible !important',\n overflow: 'visible',\n },\n '& .MuiDataGrid-footerContainer': {\n borderTop: 'none',\n },\n 'border-width': '0px',\n }\n\n const noRowsOverlay = () => {\n return (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n {t('runningModels.noRunningModels')}\n </Stack>\n )\n }\n\n const noResultsOverlay = () => {\n return (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n {t('runningModels.noRunningModelsMatches')}\n </Stack>\n )\n }\n\n useEffect(() => {\n const dataMap = {\n 'Language Models': llmData,\n 'Embedding Models': embeddingModelData,\n 'Rerank Models': rerankModelData,\n 'Image Models': imageModelData,\n 'Audio Models': audioModelData,\n 'Video Models': videoModelData,\n 'Flexible Models': flexibleModelData,\n }\n\n setTabList(\n tabList.map((item) => {\n if (dataMap[item.label]?.length && dataMap[item.label][0].model_type) {\n return {\n ...item,\n showPrompt: true,\n }\n }\n return {\n ...item,\n showPrompt: false,\n }\n })\n )\n }, [\n llmData,\n embeddingModelData,\n rerankModelData,\n imageModelData,\n audioModelData,\n videoModelData,\n flexibleModelData,\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.runningModels')} />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={handleTabChange}\n aria-label=\"tabs\"\n >\n {tabList.map((item) => (\n <Tab\n key={item.value}\n label={\n <Badge\n color=\"secondary\"\n variant=\"dot\"\n invisible={!item.showPrompt}\n >\n {t(item.label)}\n </Badge>\n }\n value={item.value}\n />\n ))}\n </TabList>\n </Box>\n <TabPanel value=\"/running_models/LLM\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={llmData}\n columns={llmColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"/running_models/embedding\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={embeddingModelData}\n columns={embeddingModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"/running_models/rerank\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={rerankModelData}\n columns={rerankModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"/running_models/image\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={imageModelData}\n columns={imageModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"/running_models/audio\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={audioModelData}\n columns={audioModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"/running_models/video\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={videoModelData}\n columns={videoModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"/running_models/flexible\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={flexibleModelData}\n columns={flexibleModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\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AAC2L,EAAE,CAAE,CAAEP,MAAM,CAAE,MAAM,CAAEtD,KAAK,CAAE,MAAO,CAAE,CAAAI,QAAA,cACzChH,IAAA,CAACf,QAAQ,EACP8L,IAAI,CAAE1I,cAAe,CACrB2I,OAAO,CAAExB,iBAAkB,CAC3ByB,UAAU,CAAE,IAAK,CACjBR,EAAE,CAAEd,aAAc,CAClBuB,KAAK,CAAE,CACLjB,aAAa,CAAEA,aAAa,CAC5BE,gBAAgB,CAAEA,gBACpB,CAAE,CACH,CAAC,CACC,CAAC,CACE,CAAC,cACXnK,IAAA,CAACpB,QAAQ,EAACyB,KAAK,CAAC,0BAA0B,CAACoK,EAAE,CAAE,CAAEC,OAAO,CAAE,CAAE,CAAE,CAAA1D,QAAA,cAC5DhH,IAAA,CAAClB,GAAG,EAAC2L,EAAE,CAAE,CAAEP,MAAM,CAAE,MAAM,CAAEtD,KAAK,CAAE,MAAO,CAAE,CAAAI,QAAA,cACzChH,IAAA,CAACf,QAAQ,EACP8L,IAAI,CAAElI,iBAAkB,CACxBmI,OAAO,CAAEtB,oBAAqB,CAC9BuB,UAAU,CAAE,IAAK,CACjBR,EAAE,CAAEd,aAAc,CAClBuB,KAAK,CAAE,CACLjB,aAAa,CAAEA,aAAa,CAC5BE,gBAAgB,CAAEA,gBACpB,CAAE,CACH,CAAC,CACC,CAAC,CACE,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAA5J,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 _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 = [\"forwardedRef\"];\nimport { createElement, forwardRef as forwardRefReact } from 'react';\nimport { useTranslation } from './useTranslation.js';\nimport { getDisplayName } from './utils.js';\nexport var withTranslation = function withTranslation(ns) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function Extend(WrappedComponent) {\n function I18nextWithTranslation(_ref) {\n var forwardedRef = _ref.forwardedRef,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _useTranslation = useTranslation(ns, _objectSpread(_objectSpread({}, rest), {}, {\n keyPrefix: options.keyPrefix\n })),\n _useTranslation2 = _slicedToArray(_useTranslation, 3),\n t = _useTranslation2[0],\n i18n = _useTranslation2[1],\n ready = _useTranslation2[2];\n var passDownProps = _objectSpread(_objectSpread({}, rest), {}, {\n t: t,\n i18n: i18n,\n tReady: ready\n });\n if (options.withRef && forwardedRef) {\n passDownProps.ref = forwardedRef;\n } else if (!options.withRef && forwardedRef) {\n passDownProps.forwardedRef = forwardedRef;\n }\n return createElement(WrappedComponent, passDownProps);\n }\n I18nextWithTranslation.displayName = \"withI18nextTranslation(\".concat(getDisplayName(WrappedComponent), \")\");\n I18nextWithTranslation.WrappedComponent = WrappedComponent;\n var forwardRef = function forwardRef(props, ref) {\n return createElement(I18nextWithTranslation, Object.assign({}, props, {\n forwardedRef: ref\n }));\n };\n return options.withRef ? forwardRefReact(forwardRef) : I18nextWithTranslation;\n };\n};","map":{"version":3,"names":["createElement","forwardRef","forwardRefReact","useTranslation","getDisplayName","withTranslation","ns","options","arguments","length","undefined","Extend","WrappedComponent","I18nextWithTranslation","_ref","forwardedRef","rest","_objectWithoutProperties","_excluded","_useTranslation","_objectSpread","keyPrefix","_useTranslation2","_slicedToArray","t","i18n","ready","passDownProps","tReady","withRef","ref","displayName","concat","props","Object","assign"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/withTranslation.js"],"sourcesContent":["import { createElement, forwardRef as forwardRefReact } from 'react';\nimport { useTranslation } from './useTranslation.js';\nimport { getDisplayName } from './utils.js';\nexport const withTranslation = (ns, options = {}) => function Extend(WrappedComponent) {\n function I18nextWithTranslation({\n forwardedRef,\n ...rest\n }) {\n const [t, i18n, ready] = useTranslation(ns, {\n ...rest,\n keyPrefix: options.keyPrefix\n });\n const passDownProps = {\n ...rest,\n t,\n i18n,\n tReady: ready\n };\n if (options.withRef && forwardedRef) {\n passDownProps.ref = forwardedRef;\n } else if (!options.withRef && forwardedRef) {\n passDownProps.forwardedRef = forwardedRef;\n }\n return createElement(WrappedComponent, passDownProps);\n }\n I18nextWithTranslation.displayName = `withI18nextTranslation(${getDisplayName(WrappedComponent)})`;\n I18nextWithTranslation.WrappedComponent = WrappedComponent;\n const forwardRef = (props, ref) => createElement(I18nextWithTranslation, Object.assign({}, props, {\n forwardedRef: ref\n }));\n return options.withRef ? forwardRefReact(forwardRef) : I18nextWithTranslation;\n};"],"mappings":";;;;AAAA,SAASA,aAAa,EAAEC,UAAU,IAAIC,eAAe,QAAQ,OAAO;AACpE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,cAAc,QAAQ,YAAY;AAC3C,OAAO,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,EAAE;EAAA,IAAEC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAAK,SAASG,MAAMA,CAACC,gBAAgB,EAAE;IACrF,SAASC,sBAAsBA,CAAAC,IAAA,EAG5B;MAAA,IAFDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;QACTC,IAAI,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;MAEP,IAAAC,eAAA,GAAyBhB,cAAc,CAACG,EAAE,EAAAc,aAAA,CAAAA,aAAA,KACrCJ,IAAI;UACPK,SAAS,EAAEd,OAAO,CAACc;QAAS,EAC7B,CAAC;QAAAC,gBAAA,GAAAC,cAAA,CAAAJ,eAAA;QAHKK,CAAC,GAAAF,gBAAA;QAAEG,IAAI,GAAAH,gBAAA;QAAEI,KAAK,GAAAJ,gBAAA;MAIrB,IAAMK,aAAa,GAAAP,aAAA,CAAAA,aAAA,KACdJ,IAAI;QACPQ,CAAC,EAADA,CAAC;QACDC,IAAI,EAAJA,IAAI;QACJG,MAAM,EAAEF;MAAK,EACd;MACD,IAAInB,OAAO,CAACsB,OAAO,IAAId,YAAY,EAAE;QACnCY,aAAa,CAACG,GAAG,GAAGf,YAAY;MAClC,CAAC,MAAM,IAAI,CAACR,OAAO,CAACsB,OAAO,IAAId,YAAY,EAAE;QAC3CY,aAAa,CAACZ,YAAY,GAAGA,YAAY;MAC3C;MACA,OAAOf,aAAa,CAACY,gBAAgB,EAAEe,aAAa,CAAC;IACvD;IACAd,sBAAsB,CAACkB,WAAW,6BAAAC,MAAA,CAA6B5B,cAAc,CAACQ,gBAAgB,CAAC,MAAG;IAClGC,sBAAsB,CAACD,gBAAgB,GAAGA,gBAAgB;IAC1D,IAAMX,UAAU,GAAG,SAAbA,UAAUA,CAAIgC,KAAK,EAAEH,GAAG;MAAA,OAAK9B,aAAa,CAACa,sBAAsB,EAAEqB,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAE;QAChGlB,YAAY,EAAEe;MAChB,CAAC,CAAC,CAAC;IAAA;IACH,OAAOvB,OAAO,CAACsB,OAAO,GAAG3B,eAAe,CAACD,UAAU,CAAC,GAAGY,sBAAsB;EAC/E,CAAC;AAAA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"/**\n * This file automatically generated from `pre-publish.js`.\n * Do not manually edit.\n */\n\nmodule.exports = {\n \"area\": true,\n \"base\": true,\n \"br\": true,\n \"col\": true,\n \"embed\": true,\n \"hr\": true,\n \"img\": true,\n \"input\": true,\n \"link\": true,\n \"meta\": true,\n \"param\": true,\n \"source\": true,\n \"track\": true,\n \"wbr\": true\n};","map":{"version":3,"names":["module","exports"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/void-elements/index.js"],"sourcesContent":["/**\n * This file automatically generated from `pre-publish.js`.\n * Do not manually edit.\n */\n\nmodule.exports = {\n \"area\": true,\n \"base\": true,\n \"br\": true,\n \"col\": true,\n \"embed\": true,\n \"hr\": true,\n \"img\": true,\n \"input\": true,\n \"link\": true,\n \"meta\": true,\n \"param\": true,\n \"source\": true,\n \"track\": true,\n \"wbr\": true\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAEAA,MAAM,CAACC,OAAO,GAAG;EACf,MAAM,EAAE,IAAI;EACZ,MAAM,EAAE,IAAI;EACZ,IAAI,EAAE,IAAI;EACV,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,IAAI;EACb,IAAI,EAAE,IAAI;EACV,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,IAAI;EACb,MAAM,EAAE,IAAI;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,IAAI;EACd,OAAO,EAAE,IAAI;EACb,KAAK,EAAE;AACT,CAAC","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import e from \"void-elements\";\nvar t = /\\s([^'\"/\\s><]+?)[\\s/>]|([^\\s=]+)=\\s?(\".*?\"|'.*?')/g;\nfunction n(n) {\n var r = {\n type: \"tag\",\n name: \"\",\n voidElement: !1,\n attrs: {},\n children: []\n },\n i = n.match(/<\\/?([^\\s]+?)[/\\s>]/);\n if (i && (r.name = i[1], (e[i[1]] || \"/\" === n.charAt(n.length - 2)) && (r.voidElement = !0), r.name.startsWith(\"!--\"))) {\n var s = n.indexOf(\"--\\x3e\");\n return {\n type: \"comment\",\n comment: -1 !== s ? n.slice(4, s) : \"\"\n };\n }\n for (var a = new RegExp(t), c = null; null !== (c = a.exec(n));) if (c[0].trim()) if (c[1]) {\n var o = c[1].trim(),\n l = [o, \"\"];\n o.indexOf(\"=\") > -1 && (l = o.split(\"=\")), r.attrs[l[0]] = l[1], a.lastIndex--;\n } else c[2] && (r.attrs[c[2]] = c[3].trim().substring(1, c[3].length - 1));\n return r;\n}\nvar r = /<[a-zA-Z0-9\\-\\!\\/](?:\"[^\"]*\"|'[^']*'|[^'\">])*>/g,\n i = /^\\s*$/,\n s = Object.create(null);\nfunction a(e, t) {\n switch (t.type) {\n case \"text\":\n return e + t.content;\n case \"tag\":\n return e += \"<\" + t.name + (t.attrs ? function (e) {\n var t = [];\n for (var n in e) t.push(n + '=\"' + e[n] + '\"');\n return t.length ? \" \" + t.join(\" \") : \"\";\n }(t.attrs) : \"\") + (t.voidElement ? \"/>\" : \">\"), t.voidElement ? e : e + t.children.reduce(a, \"\") + \"</\" + t.name + \">\";\n case \"comment\":\n return e + \"\\x3c!--\" + t.comment + \"--\\x3e\";\n }\n}\nvar c = {\n parse: function parse(e, t) {\n t || (t = {}), t.components || (t.components = s);\n var a,\n c = [],\n o = [],\n l = -1,\n m = !1;\n if (0 !== e.indexOf(\"<\")) {\n var u = e.indexOf(\"<\");\n c.push({\n type: \"text\",\n content: -1 === u ? e : e.substring(0, u)\n });\n }\n return e.replace(r, function (r, s) {\n if (m) {\n if (r !== \"</\" + a.name + \">\") return;\n m = !1;\n }\n var u,\n f = \"/\" !== r.charAt(1),\n h = r.startsWith(\"\\x3c!--\"),\n p = s + r.length,\n d = e.charAt(p);\n if (h) {\n var v = n(r);\n return l < 0 ? (c.push(v), c) : ((u = o[l]).children.push(v), c);\n }\n if (f && (l++, \"tag\" === (a = n(r)).type && t.components[a.name] && (a.type = \"component\", m = !0), a.voidElement || m || !d || \"<\" === d || a.children.push({\n type: \"text\",\n content: e.slice(p, e.indexOf(\"<\", p))\n }), 0 === l && c.push(a), (u = o[l - 1]) && u.children.push(a), o[l] = a), (!f || a.voidElement) && (l > -1 && (a.voidElement || a.name === r.slice(2, -1)) && (l--, a = -1 === l ? c : o[l]), !m && \"<\" !== d && d)) {\n u = -1 === l ? c : o[l].children;\n var x = e.indexOf(\"<\", p),\n g = e.slice(p, -1 === x ? void 0 : x);\n i.test(g) && (g = \" \"), (x > -1 && l + u.length >= 0 || \" \" !== g) && u.push({\n type: \"text\",\n content: g\n });\n }\n }), c;\n },\n stringify: function stringify(e) {\n return e.reduce(function (e, t) {\n return e + a(\"\", t);\n }, \"\");\n }\n};\nexport default c;","map":{"version":3,"names":["t","n","r","type","name","voidElement","attrs","children","i","match","e","charAt","length","startsWith","s","indexOf","comment","slice","a","RegExp","c","exec","trim","o","l","split","lastIndex","substring","Object","create","content","push","join","reduce","parse","components","m","u","replace","f","h","p","d","v","x","g","test","stringify"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/html-parse-stringify/src/parse-tag.js","/home/runner/work/inference/inference/xinference/web/ui/node_modules/html-parse-stringify/src/parse.js","/home/runner/work/inference/inference/xinference/web/ui/node_modules/html-parse-stringify/src/stringify.js","/home/runner/work/inference/inference/xinference/web/ui/node_modules/html-parse-stringify/src/index.js"],"sourcesContent":["import lookup from 'void-elements'\nconst attrRE = /\\s([^'\"/\\s><]+?)[\\s/>]|([^\\s=]+)=\\s?(\".*?\"|'.*?')/g\n\nexport default function stringify(tag) {\n const res = {\n type: 'tag',\n name: '',\n voidElement: false,\n attrs: {},\n children: [],\n }\n\n const tagMatch = tag.match(/<\\/?([^\\s]+?)[/\\s>]/)\n if (tagMatch) {\n res.name = tagMatch[1]\n if (\n lookup[tagMatch[1]] ||\n tag.charAt(tag.length - 2) === '/'\n ) {\n res.voidElement = true\n }\n\n // handle comment tag\n if (res.name.startsWith('!--')) {\n const endIndex = tag.indexOf('-->')\n return {\n type: 'comment',\n comment: endIndex !== -1 ? tag.slice(4, endIndex) : '',\n }\n }\n }\n\n const reg = new RegExp(attrRE)\n let result = null\n for (;;) {\n result = reg.exec(tag)\n\n if (result === null) {\n break\n }\n\n if (!result[0].trim()) {\n continue\n }\n\n if (result[1]) {\n const attr = result[1].trim()\n let arr = [attr, '']\n\n if (attr.indexOf('=') > -1) {\n arr = attr.split('=')\n }\n\n res.attrs[arr[0]] = arr[1]\n reg.lastIndex--\n } else if (result[2]) {\n res.attrs[result[2]] = result[3].trim().substring(1, result[3].length - 1)\n }\n }\n\n return res\n}\n","import parseTag from './parse-tag'\n\nconst tagRE = /<[a-zA-Z0-9\\-\\!\\/](?:\"[^\"]*\"|'[^']*'|[^'\">])*>/g\nconst whitespaceRE = /^\\s*$/\n\n// re-used obj for quick lookups of components\nconst empty = Object.create(null)\n\nexport default function parse(html, options) {\n options || (options = {})\n options.components || (options.components = empty)\n const result = []\n const arr = []\n let current\n let level = -1\n let inComponent = false\n\n // handle text at top level\n if (html.indexOf('<') !== 0) {\n var end = html.indexOf('<')\n result.push({\n type: 'text',\n content: end === -1 ? html : html.substring(0, end),\n })\n }\n\n html.replace(tagRE, function (tag, index) {\n if (inComponent) {\n if (tag !== '</' + current.name + '>') {\n return\n } else {\n inComponent = false\n }\n }\n const isOpen = tag.charAt(1) !== '/'\n const isComment = tag.startsWith('<!--')\n const start = index + tag.length\n const nextChar = html.charAt(start)\n let parent\n\n if (isComment) {\n const comment = parseTag(tag)\n\n // if we're at root, push new base node\n if (level < 0) {\n result.push(comment)\n return result\n }\n parent = arr[level]\n parent.children.push(comment)\n return result\n }\n\n if (isOpen) {\n level++\n\n current = parseTag(tag)\n if (current.type === 'tag' && options.components[current.name]) {\n current.type = 'component'\n inComponent = true\n }\n\n if (\n !current.voidElement &&\n !inComponent &&\n nextChar &&\n nextChar !== '<'\n ) {\n current.children.push({\n type: 'text',\n content: html.slice(start, html.indexOf('<', start)),\n })\n }\n\n // if we're at root, push new base node\n if (level === 0) {\n result.push(current)\n }\n\n parent = arr[level - 1]\n\n if (parent) {\n parent.children.push(current)\n }\n\n arr[level] = current\n }\n\n if (!isOpen || current.voidElement) {\n if (\n level > -1 &&\n (current.voidElement || current.name === tag.slice(2, -1))\n ) {\n level--\n // move current up a level to match the end tag\n current = level === -1 ? result : arr[level]\n }\n if (!inComponent && nextChar !== '<' && nextChar) {\n // trailing text node\n // if we're at the root, push a base text node. otherwise add as\n // a child to the current node.\n parent = level === -1 ? result : arr[level].children\n\n // calculate correct end of the content slice in case there's\n // no tag after the text node.\n const end = html.indexOf('<', start)\n let content = html.slice(start, end === -1 ? undefined : end)\n // if a node is nothing but whitespace, collapse it as the spec states:\n // https://www.w3.org/TR/html4/struct/text.html#h-9.1\n if (whitespaceRE.test(content)) {\n content = ' '\n }\n // don't add whitespace-only text nodes if they would be trailing text nodes\n // or if they would be leading whitespace-only text nodes:\n // * end > -1 indicates this is not a trailing text node\n // * leading node is when level is -1 and parent has length 0\n if ((end > -1 && level + parent.length >= 0) || content !== ' ') {\n parent.push({\n type: 'text',\n content: content,\n })\n }\n }\n }\n })\n\n return result\n}\n","function attrString(attrs) {\n const buff = []\n for (let key in attrs) {\n buff.push(key + '=\"' + attrs[key] + '\"')\n }\n if (!buff.length) {\n return ''\n }\n return ' ' + buff.join(' ')\n}\n\nfunction stringify(buff, doc) {\n switch (doc.type) {\n case 'text':\n return buff + doc.content\n case 'tag':\n buff +=\n '<' +\n doc.name +\n (doc.attrs ? attrString(doc.attrs) : '') +\n (doc.voidElement ? '/>' : '>')\n if (doc.voidElement) {\n return buff\n }\n return buff + doc.children.reduce(stringify, '') + '</' + doc.name + '>'\n case 'comment':\n buff += '<!--' + doc.comment + '-->'\n return buff\n }\n}\n\nexport default function (doc) {\n return doc.reduce(function (token, rootEl) {\n return token + stringify('', rootEl)\n }, '')\n}\n","import parse from './parse'\nimport stringify from './stringify'\n\nexport default {\n parse,\n stringify,\n}\n"],"mappings":";AACA,IAAMA,CAAA,GAAS;AAAA,SAESC,EAAUA,CAAA;EAChC,IAAMC,CAAA,GAAM;MACVC,IAAA,EAAM;MACNC,IAAA,EAAM;MACNC,WAAA,GAAa;MACbC,KAAA,EAAO;MACPC,QAAA,EAAU;IAAA;IAGNC,CAAA,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