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":"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 _objectWithoutProperties from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";var _excluded=[\"label\",\"value\",\"onChange\",\"hotkey\",\"t\"];import{TextField}from'@mui/material';import InputAdornment from'@mui/material/InputAdornment';import Typography from'@mui/material/Typography';import React,{useEffect,useRef,useState}from'react';import{jsx as _jsx}from\"react/jsx-runtime\";var HotkeyFocusTextField=function HotkeyFocusTextField(_ref){var label=_ref.label,value=_ref.value,onChange=_ref.onChange,_ref$hotkey=_ref.hotkey,hotkey=_ref$hotkey===void 0?'Enter':_ref$hotkey,t=_ref.t,props=_objectWithoutProperties(_ref,_excluded);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isFocused=_useState2[0],setIsFocused=_useState2[1];var textFieldRef=useRef(null);var handleKeyDown=function handleKeyDown(event){if(event.key===hotkey&&document.activeElement!==textFieldRef.current){var _textFieldRef$current;event.preventDefault();setIsFocused(true);(_textFieldRef$current=textFieldRef.current)===null||_textFieldRef$current===void 0?void 0:_textFieldRef$current.focus();}};useEffect(function(){document.addEventListener('keydown',handleKeyDown);return function(){document.removeEventListener('keydown',handleKeyDown);};},[hotkey]);return/*#__PURE__*/_jsx(TextField,_objectSpread(_objectSpread({},props),{},{label:label,value:value,onChange:onChange,inputRef:textFieldRef,autoFocus:isFocused,onBlur:function onBlur(){return setIsFocused(false);},onFocus:function onFocus(){return setIsFocused(true);},InputProps:{endAdornment:!isFocused&&!value?/*#__PURE__*/_jsx(InputAdornment,{position:\"end\",children:/*#__PURE__*/_jsx(Typography,{color:\"textSecondary\",style:{fontSize:'inherit'},children:t('launchModel.searchInstruction',{hotkey:hotkey})})}):null}}));};export default HotkeyFocusTextField;","map":{"version":3,"names":["TextField","InputAdornment","Typography","React","useEffect","useRef","useState","jsx","_jsx","HotkeyFocusTextField","_ref","label","value","onChange","_ref$hotkey","hotkey","t","props","_objectWithoutProperties","_excluded","_useState","_useState2","_slicedToArray","isFocused","setIsFocused","textFieldRef","handleKeyDown","event","key","document","activeElement","current","_textFieldRef$current","preventDefault","focus","addEventListener","removeEventListener","_objectSpread","inputRef","autoFocus","onBlur","onFocus","InputProps","endAdornment","position","children","color","style","fontSize"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/hotkeyFocusTextField.js"],"sourcesContent":["import { TextField } from '@mui/material'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Typography from '@mui/material/Typography'\nimport React, { useEffect, useRef, useState } from 'react'\n\nconst HotkeyFocusTextField = ({\n label,\n value,\n onChange,\n hotkey = 'Enter',\n t,\n ...props\n}) => {\n const [isFocused, setIsFocused] = useState(false)\n const textFieldRef = useRef(null)\n const handleKeyDown = (event) => {\n if (\n event.key === hotkey &&\n document.activeElement !== textFieldRef.current\n ) {\n event.preventDefault()\n setIsFocused(true)\n textFieldRef.current?.focus()\n }\n }\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [hotkey])\n\n return (\n <TextField\n {...props}\n label={label}\n value={value}\n onChange={onChange}\n inputRef={textFieldRef}\n autoFocus={isFocused}\n onBlur={() => setIsFocused(false)}\n onFocus={() => setIsFocused(true)}\n InputProps={{\n endAdornment:\n !isFocused && !value ? (\n <InputAdornment position=\"end\">\n <Typography color=\"textSecondary\" style={{ fontSize: 'inherit' }}>\n {t('launchModel.searchInstruction', { hotkey })}\n </Typography>\n </InputAdornment>\n ) : null,\n }}\n />\n )\n}\n\nexport default HotkeyFocusTextField\n"],"mappings":"kfAAA,OAASA,SAAS,KAAQ,eAAe,CACzC,MAAO,CAAAC,cAAc,KAAM,8BAA8B,CACzD,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,QAAAC,GAAA,IAAAC,IAAA,yBAE1D,GAAM,CAAAC,oBAAoB,CAAG,QAAvB,CAAAA,oBAAoBA,CAAAC,IAAA,CAOpB,IANJ,CAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CAAAC,WAAA,CAAAJ,IAAA,CACRK,MAAM,CAANA,MAAM,CAAAD,WAAA,UAAG,OAAO,CAAAA,WAAA,CAChBE,CAAC,CAAAN,IAAA,CAADM,CAAC,CACEC,KAAK,CAAAC,wBAAA,CAAAR,IAAA,CAAAS,SAAA,EAER,IAAAC,SAAA,CAAkCd,QAAQ,CAAC,KAAK,CAAC,CAAAe,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAA1CG,SAAS,CAAAF,UAAA,IAAEG,YAAY,CAAAH,UAAA,IAC9B,GAAM,CAAAI,YAAY,CAAGpB,MAAM,CAAC,IAAI,CAAC,CACjC,GAAM,CAAAqB,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAIC,KAAK,CAAK,CAC/B,GACEA,KAAK,CAACC,GAAG,GAAKb,MAAM,EACpBc,QAAQ,CAACC,aAAa,GAAKL,YAAY,C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"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _defineProperty from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";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{AddBoxOutlined,ChevronRightOutlined,DnsOutlined,GitHub,RocketLaunchOutlined,SmartToyOutlined}from'@mui/icons-material';import{Box,Drawer,List,ListItem,ListItemButton,ListItemIcon,ListItemText,Typography,useTheme}from'@mui/material';import{useEffect,useState}from'react';import{useTranslation}from'react-i18next';import{useLocation,useNavigate}from'react-router-dom';import icon from'../media/icon.webp';import ThemeButton from'./themeButton';import TranslateButton from'./translateButton';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var MenuSide=function MenuSide(){var theme=useTheme();var _useLocation=useLocation(),pathname=_useLocation.pathname;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),active=_useState2[0],setActive=_useState2[1];var navigate=useNavigate();var _useState3=useState(\"\".concat(Math.min(Math.max(window.innerWidth*0.2,287),320),\"px\")),_useState4=_slicedToArray(_useState3,2),drawerWidth=_useState4[0],setDrawerWidth=_useState4[1];var _useTranslation=useTranslation(),t=_useTranslation.t;var navItems=[{text:'launch_model',label:t('menu.launchModel'),icon:/*#__PURE__*/_jsx(RocketLaunchOutlined,{})},{text:'running_models',label:t('menu.runningModels'),icon:/*#__PURE__*/_jsx(SmartToyOutlined,{})},{text:'register_model',label:t('menu.registerModel'),icon:/*#__PURE__*/_jsx(AddBoxOutlined,{})},{text:'cluster_information',label:t('menu.clusterInfo'),icon:/*#__PURE__*/_jsx(DnsOutlined,{})},{text:'contact_us',label:t('menu.contactUs'),icon:/*#__PURE__*/_jsx(GitHub,{})}];useEffect(function(){setActive(pathname.substring(1));},[pathname]);useEffect(function(){var screenWidth=window.innerWidth;var maxDrawerWidth=Math.min(Math.max(screenWidth*0.2,287),320);setDrawerWidth(\"\".concat(maxDrawerWidth,\"px\"));// Update the drawer width on window resize\nvar handleResize=function handleResize(){var newScreenWidth=window.innerWidth;var newMaxDrawerWidth=Math.min(Math.max(newScreenWidth*0.2,287),320);setDrawerWidth(\"\".concat(newMaxDrawerWidth,\"px\"));};window.addEventListener('resize',handleResize);return function(){window.removeEventListener('resize',handleResize);};},[]);return/*#__PURE__*/_jsxs(Drawer,{variant:\"permanent\",sx:_objectSpread(_objectSpread({width:drawerWidth},theme.mixins.toolbar),{},_defineProperty({flexShrink:0},\"& .MuiDrawer-paper\",{width:drawerWidth,boxSizing:'border-box'})),children:[/*#__PURE__*/_jsx(Box,{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",width:\"100%\",children:/*#__PURE__*/_jsx(Box,{display:\"flex\",m:\"2rem 1rem 0rem 1rem\",width:\"217px\",children:/*#__PURE__*/_jsxs(Box,{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",textTransform:\"none\",children:[/*#__PURE__*/_jsx(Box,{component:\"img\",alt:\"profile\",src:icon,height:\"60px\",width:\"60px\",borderRadius:\"50%\",sx:{objectFit:'cover',mr:1.5}}),/*#__PURE__*/_jsx(Box,{textAlign:\"left\",children:/*#__PURE__*/_jsx(Typography,{fontWeight:\"bold\",fontSize:\"1.7rem\",children:'Xinference'})})]})})}),/*#__PURE__*/_jsx(Box,{sx:{flexGrow:1},children:/*#__PURE__*/_jsxs(Box,{width:\"100%\",children:[/*#__PURE__*/_jsx(Box,{m:\"1.5rem 2rem 2rem 3rem\"}),/*#__PURE__*/_jsx(List,{children:navItems.map(function(_ref){var text=_ref.text,label=_ref.label,icon=_ref.icon;if(!icon){return/*#__PURE__*/_jsx(Typography,{sx:{m:'2.25rem 0 1rem 3rem'},children:label},text);}return/*#__PURE__*/_jsx(ListItem,{children:/*#__PURE__*/_jsxs(ListItemButton,{onClick:function onClick(){if(text==='contact_us'){window.open('https://github.com/xorbitsai/inference','_blank','noreferrer');}else if(text==='launch_model'){sessionStorage.setItem('modelType','/launch_model/llm');navigate('/launch_model/llm');setActive(text);sessionStorage.setItem('lastActiveUrl',text);console.log(active);}else if(text==='cluster_information'){navigate('/cluster_info');setActive(text);}else if(text==='running_models'){navigate('/running_models/LLM');sessionStorage.setItem('runningModelType','/running_models/LLM');setActive(text);sessionStorage.setItem('lastActiveUrl',text);console.log(active);}else if(text==='register_model'){sessionStorage.setItem('registerModelType','/register_model/llm');navigate('/register_model/llm');setActive(text);sessionStorage.setItem('lastActiveUrl',text);console.log(active);}else{navigate(\"/\".concat(text));setActive(text);console.log(active);}},children:[/*#__PURE__*/_jsx(ListItemIcon,{sx:{ml:'2rem'},children:icon}),/*#__PURE__*/_jsx(ListItemText,{primary:label}),/*#__PURE__*/_jsx(ChevronRightOutlined,{sx:{ml:'auto'}})]})},text);})})]})}),/*#__PURE__*/_jsxs(Box,{display:\"flex\",alignItems:\"center\",marginLeft:'3rem',children:[/*#__PURE__*/_jsx(ThemeButton,{sx:{m:'1rem'}}),/*#__PURE__*/_jsx(TranslateButton,{})]})]});};export default MenuSide;","map":{"version":3,"names":["AddBoxOutlined","ChevronRightOutlined","DnsOutlined","GitHub","RocketLaunchOutlined","SmartToyOutlined","Box","Drawer","List","ListItem","ListItemButton","ListItemIcon","ListItemText","Typography","useTheme","useEffect","useState","useTranslation","useLocation","useNavigate","icon","ThemeButton","TranslateButton","jsx","_jsx","jsxs","_jsxs","MenuSide","theme","_useLocation","pathname","_useState","_useState2","_slicedToArray","active","setActive","navigate","_useState3","concat","Math","min","max","window","innerWidth","_useState4","drawerWidth","setDrawerWidth","_useTranslation","t","navItems","text","label","substring","screenWidth","maxDrawerWidth","handleResize","newScreenWidth","newMaxDrawerWidth","addEventListener","removeEventListener","variant","sx","_objectSpread","width","mixins","toolbar","_defineProperty","flexShrink","boxSizing","children","display","justifyContent","alignItems","m","textTransform","component","alt","src","height","borderRadius","objectFit","mr","textAlign","fontWeight","fontSize","flexGrow","map","_ref","onClick","open","sessionStorage","setItem","console","log","ml","primary","marginLeft"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/MenuSide.js"],"sourcesContent":["import {\n AddBoxOutlined,\n ChevronRightOutlined,\n DnsOutlined,\n GitHub,\n RocketLaunchOutlined,\n SmartToyOutlined,\n} from '@mui/icons-material'\nimport {\n Box,\n Drawer,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Typography,\n useTheme,\n} from '@mui/material'\nimport { useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport icon from '../media/icon.webp'\nimport ThemeButton from './themeButton'\nimport TranslateButton from './translateButton'\n\nconst MenuSide = () => {\n const theme = useTheme()\n const { pathname } = useLocation()\n const [active, setActive] = useState('')\n const navigate = useNavigate()\n const [drawerWidth, setDrawerWidth] = useState(\n `${Math.min(Math.max(window.innerWidth * 0.2, 287), 320)}px`\n )\n const { t } = useTranslation()\n\n const navItems = [\n {\n text: 'launch_model',\n label: t('menu.launchModel'),\n icon: <RocketLaunchOutlined />,\n },\n {\n text: 'running_models',\n label: t('menu.runningModels'),\n icon: <SmartToyOutlined />,\n },\n {\n text: 'register_model',\n label: t('menu.registerModel'),\n icon: <AddBoxOutlined />,\n },\n {\n text: 'cluster_information',\n label: t('menu.clusterInfo'),\n icon: <DnsOutlined />,\n },\n {\n text: 'contact_us',\n label: t('menu.contactUs'),\n icon: <GitHub />,\n },\n ]\n\n useEffect(() => {\n setActive(pathname.substring(1))\n }, [pathname])\n\n useEffect(() => {\n const screenWidth = window.innerWidth\n const maxDrawerWidth = Math.min(Math.max(screenWidth * 0.2, 287), 320)\n setDrawerWidth(`${maxDrawerWidth}px`)\n\n // Update the drawer width on window resize\n const handleResize = () => {\n const newScreenWidth = window.innerWidth\n const newMaxDrawerWidth = Math.min(\n Math.max(newScreenWidth * 0.2, 287),\n 320\n )\n setDrawerWidth(`${newMaxDrawerWidth}px`)\n }\n\n window.addEventListener('resize', handleResize)\n return () => {\n window.removeEventListener('resize', handleResize)\n }\n }, [])\n\n return (\n <Drawer\n variant=\"permanent\"\n sx={{\n width: drawerWidth,\n ...theme.mixins.toolbar,\n flexShrink: 0,\n [`& .MuiDrawer-paper`]: {\n width: drawerWidth,\n boxSizing: 'border-box',\n },\n }}\n >\n {/* Title */}\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n width=\"100%\"\n >\n <Box display=\"flex\" m=\"2rem 1rem 0rem 1rem\" width=\"217px\">\n <Box\n display=\"flex\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n textTransform=\"none\"\n >\n <Box\n component=\"img\"\n alt=\"profile\"\n src={icon}\n height=\"60px\"\n width=\"60px\"\n borderRadius=\"50%\"\n sx={{ objectFit: 'cover', mr: 1.5 }}\n />\n <Box textAlign=\"left\">\n <Typography fontWeight=\"bold\" fontSize=\"1.7rem\">\n {'Xinference'}\n </Typography>\n </Box>\n </Box>\n </Box>\n </Box>\n\n <Box sx={{ flexGrow: 1 }}>\n <Box width=\"100%\">\n <Box m=\"1.5rem 2rem 2rem 3rem\"></Box>\n <List>\n {navItems.map(({ text, label, icon }) => {\n if (!icon) {\n return (\n <Typography key={text} sx={{ m: '2.25rem 0 1rem 3rem' }}>\n {label}\n </Typography>\n )\n }\n return (\n <ListItem key={text}>\n <ListItemButton\n onClick={() => {\n if (text === 'contact_us') {\n window.open(\n 'https://github.com/xorbitsai/inference',\n '_blank',\n 'noreferrer'\n )\n } else if (text === 'launch_model') {\n sessionStorage.setItem('modelType', '/launch_model/llm')\n navigate('/launch_model/llm')\n setActive(text)\n sessionStorage.setItem('lastActiveUrl', text)\n console.log(active)\n } else if (text === 'cluster_information') {\n navigate('/cluster_info')\n setActive(text)\n } else if (text === 'running_models') {\n navigate('/running_models/LLM')\n sessionStorage.setItem(\n 'runningModelType',\n '/running_models/LLM'\n )\n setActive(text)\n sessionStorage.setItem('lastActiveUrl', text)\n console.log(active)\n } else if (text === 'register_model') {\n sessionStorage.setItem(\n 'registerModelType',\n '/register_model/llm'\n )\n navigate('/register_model/llm')\n setActive(text)\n sessionStorage.setItem('lastActiveUrl', text)\n console.log(active)\n } else {\n navigate(`/${text}`)\n setActive(text)\n console.log(active)\n }\n }}\n >\n <ListItemIcon\n sx={{\n ml: '2rem',\n }}\n >\n {icon}\n </ListItemIcon>\n <ListItemText primary={label} />\n <ChevronRightOutlined sx={{ ml: 'auto' }} />\n </ListItemButton>\n </ListItem>\n )\n })}\n </List>\n </Box>\n </Box>\n\n <Box display=\"flex\" alignItems=\"center\" marginLeft={'3rem'}>\n <ThemeButton sx={{ m: '1rem' }} />\n <TranslateButton />\n </Box>\n </Drawer>\n )\n}\n\nexport default MenuSide\n"],"mappings":"waAAA,OACEA,cAAc,CACdC,oBAAoB,CACpBC,WAAW,CACXC,MAAM,CACNC,oBAAoB,CACpBC,gBAAgB,KACX,qBAAqB,CAC5B,OACEC,GAAG,CACHC,MAAM,CACNC,IAAI,CACJC,QAAQ,CACRC,cAAc,CACdC,YAAY,CACZC,YAAY,CACZC,UAAU,CACVC,QAAQ,KACH,eAAe,CACtB,OAASC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC3C,OAASC,cAAc,KAAQ,eAAe,CAC9C,OAASC,WAAW,CAAEC,WAAW,KAAQ,kBAAkB,CAE3D,MAAO,CAAAC,IAAI,KAAM,oBAAoB,CACrC,MAAO,CAAAC,WAAW,KAAM,eAAe,CACvC,MAAO,CAAAC,eAAe,KAAM,mBAAmB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAE/C,GAAM,CAAAC,QAAQ,CAAG,QAAX,CAAAA,QAAQA,CAAA,CAAS,CACrB,GAAM,CAAAC,KAAK,CAAGd,QAAQ,CAAC,CAAC,CACxB,IAAAe,YAAA,CAAqBX,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@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _defineProperty from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";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 AddIcon from'@mui/icons-material/Add';import DeleteIcon from'@mui/icons-material/Delete';import{Box,Button,FormControlLabel,Radio,RadioGroup,TextField,Tooltip}from'@mui/material';import React,{useEffect,useState}from'react';import{useTranslation}from'react-i18next';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";import{Fragment as _Fragment}from\"react/jsx-runtime\";var AddControlnet=function AddControlnet(_ref){var controlnetDataArr=_ref.controlnetDataArr,onGetControlnetArr=_ref.onGetControlnetArr,scrollRef=_ref.scrollRef;var _useState=useState(0),_useState2=_slicedToArray(_useState,2),count=_useState2[0],setCount=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),controlnetArr=_useState4[0],setControlnetArr=_useState4[1];var _useState5=useState(false),_useState6=_slicedToArray(_useState5,2),isAdd=_useState6[0],setIsAdd=_useState6[1];var _useTranslation=useTranslation(),t=_useTranslation.t;useEffect(function(){if(controlnetDataArr&&controlnetDataArr.length){var dataArr=controlnetDataArr.map(function(item){setCount(count+1);item.id=count;return item;});setControlnetArr(dataArr);}},[]);useEffect(function(){var arr=controlnetArr.map(function(item){var name=item.model_name,uri=item.model_uri,model_family=item.model_family;return{model_name:name,model_uri:uri,model_family:model_family};});onGetControlnetArr(arr);isAdd&&handleScrollBottom();setIsAdd(false);},[controlnetArr]);var handleAddControlnet=function handleAddControlnet(){setCount(count+1);var item={id:count,model_name:'custom-controlnet',model_uri:'/path/to/controlnet-model',model_family:'controlnet'};setControlnetArr([].concat(_toConsumableArray(controlnetArr),[item]));setIsAdd(true);};var handleUpdateSpecsArr=function handleUpdateSpecsArr(index,type,newValue){setControlnetArr(controlnetArr.map(function(item,subIndex){if(subIndex===index){return _objectSpread(_objectSpread({},item),{},_defineProperty({},type,newValue));}return item;}));};var handleDeleteControlnet=function handleDeleteControlnet(index){setControlnetArr(controlnetArr.filter(function(_,subIndex){return index!==subIndex;}));};var handleScrollBottom=function handleScrollBottom(){scrollRef.current.scrollTo({top:scrollRef.current.scrollHeight,behavior:'smooth'});};return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"label\",{style:{marginBottom:'20px'},children:t('registerModel.controlnet')}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",size:\"small\",endIcon:/*#__PURE__*/_jsx(AddIcon,{}),className:\"addBtn\",onClick:handleAddControlnet,children:t('registerModel.more')})]}),/*#__PURE__*/_jsx(\"div\",{className:\"specs_container\",children:controlnetArr.map(function(item,index){return/*#__PURE__*/_jsxs(\"div\",{className:\"item\",children:[/*#__PURE__*/_jsx(TextField,{error:item.model_name!==''?false:true,style:{minWidth:'60%',marginTop:'10px'},label:\"Model Name\",size:\"small\",value:item.model_name,onChange:function onChange(e){handleUpdateSpecsArr(index,'model_name',e.target.value);}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:item.model_uri!==''?false:true,style:{minWidth:'60%'},label:\"Model Path\",size:\"small\",value:item.model_uri,onChange:function onChange(e){handleUpdateSpecsArr(index,'model_uri',e.target.value);}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5},children:t('registerModel.modelFormat')}),/*#__PURE__*/_jsx(RadioGroup,{value:item.model_format,onChange:function onChange(e){handleUpdateSpecsArr(index,'model_format',e.target.value);},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"controlnet\",checked:true,control:/*#__PURE__*/_jsx(Radio,{}),label:\"controlnet\"})},item)})}),/*#__PURE__*/_jsx(Tooltip,{title:t('registerModel.delete'),placement:\"top\",children:/*#__PURE__*/_jsx(\"div\",{className:\"deleteBtn\",onClick:function onClick(){return handleDeleteControlnet(index);},children:/*#__PURE__*/_jsx(DeleteIcon,{className:\"deleteIcon\"})})})]},item.id);})})]});};export default AddControlnet;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',alignItems:'center',width:'100%'}};","map":{"version":3,"names":["AddIcon","DeleteIcon","Box","Button","FormControlLabel","Radio","RadioGroup","TextField","Tooltip","React","useEffect","useState","useTranslation","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","AddControlnet","_ref","controlnetDataArr","onGetControlnetArr","scrollRef","_useState","_useState2","_slicedToArray","count","setCount","_useState3","_useState4","controlnetArr","setControlnetArr","_useState5","_useState6","isAdd","setIsAdd","_useTranslation","t","length","dataArr","map","item","id","arr","name","model_name","uri","model_uri","model_family","handleScrollBottom","handleAddControlnet","concat","_toConsumableArray","handleUpdateSpecsArr","index","type","newValue","subIndex","_objectSpread","_defineProperty","handleDeleteControlnet","filter","_","current","scrollTo","top","scrollHeight","behavior","children","style","marginBottom","variant","size","endIcon","className","onClick","error","minWidth","marginTop","label","value","onChange","e","target","padding","paddingLeft","model_format","sx","styles","checkboxWrapper","marginLeft","checked","control","title","placement","baseFormControl","width","margin","display","flexWrap","alignItems"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/components/addControlnet.js"],"sourcesContent":["import AddIcon from '@mui/icons-material/Add'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport {\n Box,\n Button,\n FormControlLabel,\n Radio,\n RadioGroup,\n TextField,\n Tooltip,\n} from '@mui/material'\nimport React, { useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nconst AddControlnet = ({\n controlnetDataArr,\n onGetControlnetArr,\n scrollRef,\n}) => {\n const [count, setCount] = useState(0)\n const [controlnetArr, setControlnetArr] = useState([])\n const [isAdd, setIsAdd] = useState(false)\n const { t } = useTranslation()\n\n useEffect(() => {\n if (controlnetDataArr && controlnetDataArr.length) {\n const dataArr = controlnetDataArr.map((item) => {\n setCount(count + 1)\n item.id = count\n return item\n })\n setControlnetArr(dataArr)\n }\n }, [])\n\n useEffect(() => {\n const arr = controlnetArr.map((item) => {\n const { model_name: name, model_uri: uri, model_family } = item\n return {\n model_name: name,\n model_uri: uri,\n model_family,\n }\n })\n onGetControlnetArr(arr)\n isAdd && handleScrollBottom()\n setIsAdd(false)\n }, [controlnetArr])\n\n const handleAddControlnet = () => {\n setCount(count + 1)\n const item = {\n id: count,\n model_name: 'custom-controlnet',\n model_uri: '/path/to/controlnet-model',\n model_family: 'controlnet',\n }\n setControlnetArr([...controlnetArr, item])\n setIsAdd(true)\n }\n\n const handleUpdateSpecsArr = (index, type, newValue) => {\n setControlnetArr(\n controlnetArr.map((item, subIndex) => {\n if (subIndex === index) {\n return { ...item, [type]: newValue }\n }\n return item\n })\n )\n }\n\n const handleDeleteControlnet = (index) => {\n setControlnetArr(controlnetArr.filter((_, subIndex) => index !== subIndex))\n }\n\n const handleScrollBottom = () => {\n scrollRef.current.scrollTo({\n top: scrollRef.current.scrollHeight,\n behavior: 'smooth',\n })\n }\n\n return (\n <>\n <div>\n <label style={{ marginBottom: '20px' }}>\n {t('registerModel.controlnet')}\n </label>\n <Button\n variant=\"contained\"\n size=\"small\"\n endIcon={<AddIcon />}\n className=\"addBtn\"\n onClick={handleAddControlnet}\n >\n {t('registerModel.more')}\n </Button>\n </div>\n <div className=\"specs_container\">\n {controlnetArr.map((item, index) => (\n <div className=\"item\" key={item.id}>\n <TextField\n error={item.model_name !== '' ? false : true}\n style={{ minWidth: '60%', marginTop: '10px' }}\n label=\"Model Name\"\n size=\"small\"\n value={item.model_name}\n onChange={(e) => {\n handleUpdateSpecsArr(index, 'model_name', e.target.value)\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={item.model_uri !== '' ? false : true}\n style={{ minWidth: '60%' }}\n label=\"Model Path\"\n size=\"small\"\n value={item.model_uri}\n onChange={(e) => {\n handleUpdateSpecsArr(index, 'model_uri', e.target.value)\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n }}\n >\n {t('registerModel.modelFormat')}\n </label>\n <RadioGroup\n value={item.model_format}\n onChange={(e) => {\n handleUpdateSpecsArr(index, 'model_format', e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n <Box key={item} sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"controlnet\"\n checked\n control={<Radio />}\n label=\"controlnet\"\n />\n </Box>\n </Box>\n </RadioGroup>\n\n <Tooltip title={t('registerModel.delete')} placement=\"top\">\n <div\n className=\"deleteBtn\"\n onClick={() => handleDeleteControlnet(index)}\n >\n <DeleteIcon className=\"deleteIcon\" />\n </div>\n </Tooltip>\n </div>\n ))}\n </div>\n </>\n )\n}\n\nexport default AddControlnet\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n width: '100%',\n },\n}\n"],"mappings":"6jBAAA,MAAO,CAAAA,OAAO,KAAM,yBAAyB,CAC7C,MAAO,CAAAC,UAAU,KAAM,4BAA4B,CACnD,OACEC,GAAG,CACHC,MAAM,CACNC,gBAAgB,CAChBC,KAAK,CACLC,UAAU,CACVC,SAAS,CACTC,OAAO,KACF,eAAe,CACtB,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAClD,OAASC,cAAc,KAAQ,eAAe,QAAAC,GAAA,IAAAC,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AAE,CAAE,CAAEG,UAAU,CAAE,MAAO,CAAE,CAAAtB,QAAA,cACzCvD,IAAA,CAACV,gBAAgB,EACf6E,KAAK,CAAC,YAAY,CAClBW,OAAO,MACPC,OAAO,cAAE/E,IAAA,CAACT,KAAK,GAAE,CAAE,CACnB2E,KAAK,CAAC,YAAY,CACnB,CAAC,EANMtC,IAOL,CAAC,CACH,CAAC,CACI,CAAC,cAEb5B,IAAA,CAACN,OAAO,EAACsF,KAAK,CAAExD,CAAC,CAAC,sBAAsB,CAAE,CAACyD,SAAS,CAAC,KAAK,CAAA1B,QAAA,cACxDvD,IAAA,QACE6D,SAAS,CAAC,WAAW,CACrBC,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAAf,sBAAsB,CAACN,KAAK,CAAC,EAAC,CAAAc,QAAA,cAE7CvD,IAAA,CAACb,UAAU,EAAC0E,SAAS,CAAC,YAAY,CAAE,CAAC,CAClC,CAAC,CACC,CAAC,GAzDejC,IAAI,CAACC,EA0D3B,CAAC,EACP,CAAC,CACC,CAAC,EACN,CAAC,CAEP,CAAC,CAED,cAAe,CAAAxB,aAAa,CAE5B,GAAM,CAAAsE,MAAM,CAAG,CACbO,eAAe,CAAE,CACfC,KAAK,CAAE,MAAM,CACbC,MAAM,CAAE,QAAQ,CAChBzB,IAAI,CAAE,OACR,CAAC,CACDiB,eAAe,CAAE,CACfS,OAAO,CAAE,MAAM,CACfC,QAAQ,CAAE,MAAM,CAChBC,UAAU,CAAE,QAAQ,CACpBJ,KAAK,CAAE,MACT,CACF,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"var i18nInstance;\nexport var setI18n = function setI18n(instance) {\n i18nInstance = instance;\n};\nexport var getI18n = function getI18n() {\n return i18nInstance;\n};","map":{"version":3,"names":["i18nInstance","setI18n","instance","getI18n"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/i18nInstance.js"],"sourcesContent":["let i18nInstance;\nexport const setI18n = instance => {\n i18nInstance = instance;\n};\nexport const getI18n = () => i18nInstance;"],"mappings":"AAAA,IAAIA,YAAY;AAChB,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAGC,QAAQ,EAAI;EACjCF,YAAY,GAAGE,QAAQ;AACzB,CAAC;AACD,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAA;EAAA,OAASH,YAAY;AAAA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import { useContext } from 'react';\nimport { getI18n, I18nContext } from './context.js';\nexport var useSSR = function useSSR(initialI18nStore, initialLanguage) {\n var _i18n$options;\n var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var i18nFromProps = props.i18n;\n var _ref = useContext(I18nContext) || {},\n i18nFromContext = _ref.i18n;\n var i18n = i18nFromProps || i18nFromContext || getI18n();\n if ((_i18n$options = i18n.options) !== null && _i18n$options !== void 0 && _i18n$options.isClone) return;\n if (initialI18nStore && !i18n.initializedStoreOnce) {\n i18n.services.resourceStore.data = initialI18nStore;\n i18n.options.ns = Object.values(initialI18nStore).reduce(function (mem, lngResources) {\n Object.keys(lngResources).forEach(function (ns) {\n if (mem.indexOf(ns) < 0) mem.push(ns);\n });\n return mem;\n }, i18n.options.ns);\n i18n.initializedStoreOnce = true;\n i18n.isInitialized = true;\n }\n if (initialLanguage && !i18n.initializedLanguageOnce) {\n i18n.changeLanguage(initialLanguage);\n i18n.initializedLanguageOnce = true;\n }\n};","map":{"version":3,"names":["useContext","getI18n","I18nContext","useSSR","initialI18nStore","initialLanguage","_i18n$options","props","arguments","length","undefined","i18nFromProps","i18n","_ref","i18nFromContext","options","isClone","initializedStoreOnce","services","resourceStore","data","ns","Object","values","reduce","mem","lngResources","keys","forEach","indexOf","push","isInitialized","initializedLanguageOnce","changeLanguage"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/node_modules/react-i18next/dist/es/useSSR.js"],"sourcesContent":["import { useContext } from 'react';\nimport { getI18n, I18nContext } from './context.js';\nexport const useSSR = (initialI18nStore, initialLanguage, props = {}) => {\n const {\n i18n: i18nFromProps\n } = props;\n const {\n i18n: i18nFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n if (i18n.options?.isClone) return;\n if (initialI18nStore && !i18n.initializedStoreOnce) {\n i18n.services.resourceStore.data = initialI18nStore;\n i18n.options.ns = Object.values(initialI18nStore).reduce((mem, lngResources) => {\n Object.keys(lngResources).forEach(ns => {\n if (mem.indexOf(ns) < 0) mem.push(ns);\n });\n return mem;\n }, i18n.options.ns);\n i18n.initializedStoreOnce = true;\n i18n.isInitialized = true;\n }\n if (initialLanguage && !i18n.initializedLanguageOnce) {\n i18n.changeLanguage(initialLanguage);\n i18n.initializedLanguageOnce = true;\n }\n};"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,OAAO,EAAEC,WAAW,QAAQ,cAAc;AACnD,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAIC,gBAAgB,EAAEC,eAAe,EAAiB;EAAA,IAAAC,aAAA;EAAA,IAAfC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAClE,IACQG,aAAa,GACjBJ,KAAK,CADPK,IAAI;EAEN,IAAAC,IAAA,GAEIb,UAAU,CAACE,WAAW,CAAC,IAAI,CAAC,CAAC;IADzBY,eAAe,GAAAD,IAAA,CAArBD,IAAI;EAEN,IAAMA,IAAI,GAAGD,aAAa,IAAIG,eAAe,IAAIb,OAAO,CAAC,CAAC;EAC1D,KAAAK,aAAA,GAAIM,IAAI,CAACG,OAAO,cAAAT,aAAA,eAAZA,aAAA,CAAcU,OAAO,EAAE;EAC3B,IAAIZ,gBAAgB,IAAI,CAACQ,IAAI,CAACK,oBAAoB,EAAE;IAClDL,IAAI,CAACM,QAAQ,CAACC,aAAa,CAACC,IAAI,GAAGhB,gBAAgB;IACnDQ,IAAI,CAACG,OAAO,CAACM,EAAE,GAAGC,MAAM,CAACC,MAAM,CAACnB,gBAAgB,CAAC,CAACoB,MAAM,CAAC,UAACC,GAAG,EAAEC,YAAY,EAAK;MAC9EJ,MAAM,CAACK,IAAI,CAACD,YAAY,CAAC,CAACE,OAAO,CAAC,UAAAP,EAAE,EAAI;QACtC,IAAII,GAAG,CAACI,OAAO,CAACR,EAAE,CAAC,GAAG,CAAC,EAAEI,GAAG,CAACK,IAAI,CAACT,EAAE,CAAC;MACvC,CAAC,CAAC;MACF,OAAOI,GAAG;IACZ,CAAC,EAAEb,IAAI,CAACG,OAAO,CAACM,EAAE,CAAC;IACnBT,IAAI,CAACK,oBAAoB,GAAG,IAAI;IAChCL,IAAI,CAACmB,aAAa,GAAG,IAAI;EAC3B;EACA,IAAI1B,eAAe,IAAI,CAACO,IAAI,CAACoB,uBAAuB,EAAE;IACpDpB,IAAI,CAACqB,cAAc,CAAC5B,eAAe,CAAC;IACpCO,IAAI,CAACoB,uBAAuB,GAAG,IAAI;EACrC;AACF,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Tab}from'@mui/material';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 fetchWrapper from'../../components/fetchWrapper';import Title from'../../components/Title';import{isValidBearerToken}from'../../components/utils';import LaunchCustom from'./launchCustom';import LaunchLLM from'./launchLLM';import LaunchModelComponent from'./LaunchModelComponent';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchModel=function LaunchModel(){var _React$useState=React.useState(sessionStorage.getItem('modelType')?sessionStorage.getItem('modelType'):'/launch_model/llm'),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var _useState=useState(-1),_useState2=_slicedToArray(_useState,2),gpuAvailable=_useState2[0],setGPUAvailable=_useState2[1];var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var _useTranslation=useTranslation(),t=_useTranslation.t;var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);navigate(newValue);sessionStorage.setItem('modelType',newValue);newValue==='/launch_model/custom/llm'?sessionStorage.setItem('subType',newValue):'';};useEffect(function(){if(sessionStorage.getItem('auth')==='true'&&!isValidBearerToken(sessionStorage.getItem('token'))&&!isValidBearerToken(cookie.token)){navigate('/login',{replace:true});}if(gpuAvailable===-1){fetchWrapper.get('/v1/cluster/devices').then(function(data){return setGPUAvailable(parseInt(data,10));}).catch(function(error){console.error('Error:',error);if(error.response.status!==403&&error.response.status!==401){setErrorMsg(error.message);}});}},[cookie.token]);return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:t('menu.launchModel')}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:value,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:value,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:t('model.languageModels'),value:\"/launch_model/llm\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.embeddingModels'),value:\"/launch_model/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.rerankModels'),value:\"/launch_model/rerank\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.imageModels'),value:\"/launch_model/image\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.audioModels'),value:\"/launch_model/audio\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.videoModels'),value:\"/launch_model/video\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.customModels'),value:\"/launch_model/custom/llm\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchLLM,{gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/embedding\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'embedding',gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'rerank',gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/image\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'image'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/audio\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'audio'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/video\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'video'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/custom/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchCustom,{gpuAvailable:gpuAvailable})})]})]});};export default LaunchModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","useContext","useEffect","useState","useCookies","useTranslation","useNavigate","ApiContext","ErrorMessageSnackBar","fetchWrapper","Title","isValidBearerToken","LaunchCustom","LaunchLLM","LaunchModelComponent","jsx","_jsx","jsxs","_jsxs","LaunchModel","_React$useState","sessionStorage","getItem","_React$useState2","_slicedToArray","value","setValue","_useState","_useState2","gpuAvailable","setGPUAvailable","_useContext","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","_useTranslation","t","handleTabChange","event","newValue","setItem","token","replace","get","then","data","parseInt","catch","error","console","response","status","message","m","children","title","sx","borderBottom","borderColor","onChange","label","padding","modelType"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Tab } from '@mui/material'\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 fetchWrapper from '../../components/fetchWrapper'\nimport Title from '../../components/Title'\nimport { isValidBearerToken } from '../../components/utils'\nimport LaunchCustom from './launchCustom'\nimport LaunchLLM from './launchLLM'\nimport LaunchModelComponent from './LaunchModelComponent'\n\nconst LaunchModel = () => {\n const [value, setValue] = React.useState(\n sessionStorage.getItem('modelType')\n ? sessionStorage.getItem('modelType')\n : '/launch_model/llm'\n )\n const [gpuAvailable, setGPUAvailable] = useState(-1)\n\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n const { t } = useTranslation()\n\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('modelType', newValue)\n newValue === '/launch_model/custom/llm'\n ? sessionStorage.setItem('subType', newValue)\n : ''\n }\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\n if (gpuAvailable === -1) {\n fetchWrapper\n .get('/v1/cluster/devices')\n .then((data) => setGPUAvailable(parseInt(data, 10)))\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 }\n }, [cookie.token])\n\n return (\n <Box m=\"20px\">\n <Title title={t('menu.launchModel')} />\n <ErrorMessageSnackBar />\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label={t('model.languageModels')} value=\"/launch_model/llm\" />\n <Tab\n label={t('model.embeddingModels')}\n value=\"/launch_model/embedding\"\n />\n <Tab label={t('model.rerankModels')} value=\"/launch_model/rerank\" />\n <Tab label={t('model.imageModels')} value=\"/launch_model/image\" />\n <Tab label={t('model.audioModels')} value=\"/launch_model/audio\" />\n <Tab label={t('model.videoModels')} value=\"/launch_model/video\" />\n <Tab\n label={t('model.customModels')}\n value=\"/launch_model/custom/llm\"\n />\n </TabList>\n </Box>\n <TabPanel value=\"/launch_model/llm\" sx={{ padding: 0 }}>\n <LaunchLLM gpuAvailable={gpuAvailable} />\n </TabPanel>\n <TabPanel value=\"/launch_model/embedding\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'embedding'}\n gpuAvailable={gpuAvailable}\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/rerank\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'rerank'}\n gpuAvailable={gpuAvailable}\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/image\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'image'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/audio\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'audio'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/video\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'video'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/llm\" sx={{ padding: 0 }}>\n <LaunchCustom gpuAvailable={gpuAvailable} />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport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