xinference 1.1.0__py3-none-any.whl → 1.2.0__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 +72 -66
- xinference/core/model.py +78 -25
- xinference/core/supervisor.py +81 -10
- xinference/core/utils.py +12 -8
- xinference/core/worker.py +32 -0
- xinference/model/audio/core.py +5 -0
- xinference/model/audio/cosyvoice.py +25 -3
- xinference/model/audio/f5tts.py +15 -10
- xinference/model/audio/f5tts_mlx.py +260 -0
- xinference/model/audio/fish_speech.py +35 -111
- xinference/model/audio/model_spec.json +19 -3
- xinference/model/audio/model_spec_modelscope.json +9 -0
- xinference/model/audio/utils.py +32 -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 +2 -0
- xinference/model/llm/llm_family.json +143 -0
- xinference/model/llm/llm_family.py +15 -36
- xinference/model/llm/llm_family_modelscope.json +148 -0
- xinference/model/llm/mlx/core.py +37 -32
- 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/utils.py +28 -3
- xinference/model/llm/vllm/core.py +48 -9
- 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 +112 -0
- xinference/model/llm/vllm/xavier/block_manager.py +71 -0
- xinference/model/llm/vllm/xavier/block_tracker.py +116 -0
- xinference/model/llm/vllm/xavier/engine.py +247 -0
- xinference/model/llm/vllm/xavier/executor.py +132 -0
- xinference/model/llm/vllm/xavier/scheduler.py +422 -0
- xinference/model/llm/vllm/xavier/test/__init__.py +13 -0
- xinference/model/llm/vllm/xavier/test/test_xavier.py +122 -0
- xinference/model/llm/vllm/xavier/transfer.py +298 -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/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/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/types.py +13 -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.1eb206d1.js +3 -0
- xinference/web/ui/build/static/js/main.1eb206d1.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/2213d49de260e1f67c888081b18f120f5225462b829ae57c9e05a05cec83689d.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/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.1.0.dist-info → xinference-1.2.0.dist-info}/METADATA +19 -11
- {xinference-1.1.0.dist-info → xinference-1.2.0.dist-info}/RECORD +178 -111
- xinference/thirdparty/cosyvoice/bin/__init__.py +0 -0
- xinference/thirdparty/cosyvoice/bin/export_trt.py +0 -8
- xinference/thirdparty/cosyvoice/flow/__init__.py +0 -0
- xinference/thirdparty/cosyvoice/hifigan/__init__.py +0 -0
- xinference/thirdparty/cosyvoice/llm/__init__.py +0 -0
- xinference/thirdparty/fish_speech/tools/__init__.py +0 -0
- 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.4eb4ee80.js +0 -3
- xinference/web/ui/build/static/js/main.4eb4ee80.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/8c5eeb02f772d02cbe8b89c05428d0dd41a97866f75f7dc1c2164a67f5a1cf98.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/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/web/ui/build/static/js/{main.4eb4ee80.js.LICENSE.txt → main.1eb206d1.js.LICENSE.txt} +0 -0
- {xinference-1.1.0.dist-info → xinference-1.2.0.dist-info}/LICENSE +0 -0
- {xinference-1.1.0.dist-info → xinference-1.2.0.dist-info}/WHEEL +0 -0
- {xinference-1.1.0.dist-info → xinference-1.2.0.dist-info}/entry_points.txt +0 -0
- {xinference-1.1.0.dist-info → xinference-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
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{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 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:\"Model Ability\"}),/*#__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:\"generate\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"chat\",children:\"chat\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"vision\",children:\"vl-chat\"})]})]}),/*#__PURE__*/_jsxs(FormControl,{sx:{marginTop:2,minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"select-status\",children:\"Status\"}),/*#__PURE__*/_jsxs(Select,{id:\"status\",labelId:\"select-status\",label:\"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:\"cached\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"favorite\",children:\"favorite\"})]})]}),/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for model name and description\",value:searchTerm,onChange:function onChange(e){return setSearchTerm(e.target.value);},size:\"small\",hotkey:\"/\"})})]}),/*#__PURE__*/_jsx(\"div\",{style:{margin:'0 0 30px 30px'},children:filterArr.map(function(item,index){return/*#__PURE__*/_jsx(Chip,{label: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","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","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'\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\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\">Model Ability</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\">generate</MenuItem>\n <MenuItem value=\"chat\">chat</MenuItem>\n <MenuItem value=\"vision\">vl-chat</MenuItem>\n </Select>\n </FormControl>\n <FormControl sx={{ marginTop: 2, minWidth: 120 }} size=\"small\">\n <InputLabel id=\"select-status\">Status</InputLabel>\n <Select\n id=\"status\"\n labelId=\"select-status\"\n label=\"Status\"\n onChange={(e) => handleChangeFilter('status', e.target.value)}\n value={status}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"cached\">cached</MenuItem>\n <MenuItem value=\"favorite\">favorite</MenuItem>\n </Select>\n </FormControl>\n\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for model name and description\"\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n size=\"small\"\n hotkey=\"/\"\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={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,CAEzC,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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AAG,CAAC,SAACO,oBAAoB,qBACxBjI,IAAA,CAACF,SAAS,EAERoI,GAAG,CAAExH,QAAS,CACdyH,SAAS,CAAEF,oBAAqB,CAChC3H,YAAY,CAAEA,YAAa,CAC3B8H,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,CAAAlD,SAAS","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _classCallCheck from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createClass.js\";import _inherits from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/inherits.js\";import _createSuper from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createSuper.js\";import Table from'@mui/material/Table';import TableBody from'@mui/material/TableBody';import TableHead from'@mui/material/TableHead';import TableRow from'@mui/material/TableRow';import Grid from'@mui/material/Unstable_Grid2';import React from'react';import fetchWrapper from'../../components/fetchWrapper';import{toReadableSize}from'../../components/utils';import{StyledTableCell,StyledTableRow}from'./style';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var NodeInfo=/*#__PURE__*/function(_React$Component){_inherits(NodeInfo,_React$Component);var _super=_createSuper(NodeInfo);function NodeInfo(props){var _this;_classCallCheck(this,NodeInfo);_this=_super.call(this,props);_this.nodeRole=props.nodeRole;_this.endpoint=props.endpoint;_this.state={version:{},info:[]};return _this;}_createClass(NodeInfo,[{key:\"refreshInfo\",value:function refreshInfo(){var _this2=this;if(this.props.cookie.token===''||this.props.cookie.token===undefined||this.props.cookie.token!=='no_auth'&&!sessionStorage.getItem('token')){return;}fetchWrapper.get('/v1/cluster/info?detailed=true').then(function(data){var state=_this2.state;state['info']=data;_this2.setState(state);}).catch(function(error){console.error('Error:',error);if(error.response.status==403){_this2.props.handleGoBack();}});if(JSON.stringify(this.state.version)==='{}'){fetchWrapper.get('/v1/cluster/version').then(function(data){var state=_this2.state;state['version']={release:'v'+data['version'],commit:data['full-revisionid']};_this2.setState(state);}).catch(function(error){console.error('Error:',error);if(error.response.status==403){_this2.props.handleGoBack();}});}}},{key:\"componentDidMount\",value:function componentDidMount(){var _this3=this;this.interval=setInterval(function(){return _this3.refreshInfo();},5000);this.refreshInfo();}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){clearInterval(this.interval);}},{key:\"render\",value:function render(){var _this4=this;if(this.state===undefined||this.state['info']===[]){return/*#__PURE__*/_jsx(\"div\",{children:\"Loading\"});}if(this.nodeRole!=='Worker-Details'){var roleData=this.state['info'].filter(function(obj){return obj['node_type']===_this4.nodeRole;});var sum=function sum(arr){return arr.reduce(function(a,b){return a+b;},0);};var gatherResourceStats=function gatherResourceStats(prop){return sum(roleData.map(function(obj){return obj[prop];}));};var resourceStats={cpu_total:gatherResourceStats('cpu_count'),cpu_avail:gatherResourceStats('cpu_available'),memory_total:gatherResourceStats('mem_total'),memory_avail:gatherResourceStats('mem_available'),gpu_total:gatherResourceStats('gpu_count'),gpu_memory_total:gatherResourceStats('gpu_vram_total'),gpu_memory_avail:gatherResourceStats('gpu_vram_available')};//for all cases, we will at least have cpu information available.\nresourceStats.cpu_used=resourceStats.cpu_total-resourceStats.cpu_avail;resourceStats.memory_used=resourceStats.memory_total-resourceStats.memory_avail;var row_count=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Count\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:roleData.length})})})]});var CPU_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"CPU Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Usage: \",resourceStats.cpu_used.toFixed(2)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Total: \",resourceStats.cpu_total.toFixed(2)]})]})})]});var CPU_Memory_Info_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"CPU Memory Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Usage: \",toReadableSize(resourceStats.memory_used)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Total: \",toReadableSize(resourceStats.memory_total)]})]})})]});var version_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Version\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Release: \",this.state.version.release]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Commit: \",this.state.version.commit]})]})})]});var table_bodies;//case that we do not have GPU presents.\nif(resourceStats.gpu_memory_total===0){table_bodies=[row_count,CPU_row,CPU_Memory_Info_row,version_row];}else{resourceStats.gpu_memory_used=resourceStats.gpu_memory_total-resourceStats.gpu_memory_avail;var GPU_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"GPU Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsxs(Grid,{xs:12,children:[\"Total: \",resourceStats.gpu_total.toFixed(2)]})})})]});var GPU_Memory_Info_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"GPU Memory Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Usage: \",toReadableSize(resourceStats.gpu_memory_used)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Total: \",toReadableSize(resourceStats.gpu_memory_total)]})]})})]});table_bodies=[row_count,CPU_row,CPU_Memory_Info_row,GPU_row,GPU_Memory_Info_row,version_row];}if(this.nodeRole==='Supervisor'){var supervisor_addr_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Address\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:roleData[0]?roleData[0]['ip_address']:'-'})})})]});table_bodies.splice(1,0,supervisor_addr_row);}return/*#__PURE__*/_jsxs(Table,{size:\"small\",children:[/*#__PURE__*/_jsx(TableHead,{children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Item\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:\"Value\"})})})]})}),/*#__PURE__*/_jsx(TableBody,{children:table_bodies})]});}else{var workerData=this.state['info'].filter(function(obj){return obj['node_type']==='Worker';});return/*#__PURE__*/_jsxs(Table,{size:\"small\",children:[/*#__PURE__*/_jsx(TableHead,{children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Node Type\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Address\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"CPU Usage\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"CPU Total\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Mem Usage\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Mem Total\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"GPU Count\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"GPU Mem Usage\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"GPU Mem Total\"})]})}),/*#__PURE__*/_jsx(TableBody,{children:workerData.map(function(row){return/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Worker\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['ip_address']}),/*#__PURE__*/_jsx(StyledTableCell,{children:(row['cpu_count']-row['cpu_available']).toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['cpu_count'].toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['mem_total']-row['mem_available'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['mem_total'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['gpu_count'].toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['gpu_vram_total']-row['gpu_vram_available'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['gpu_vram_total'])})]});})})]});}}}]);return NodeInfo;}(React.Component);export default NodeInfo;","map":{"version":3,"names":["Table","TableBody","TableHead","TableRow","Grid","React","fetchWrapper","toReadableSize","StyledTableCell","StyledTableRow","jsx","_jsx","jsxs","_jsxs","NodeInfo","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","nodeRole","endpoint","state","version","info","_createClass","key","value","refreshInfo","_this2","cookie","token","undefined","sessionStorage","getItem","get","then","data","setState","catch","error","console","response","status","handleGoBack","JSON","stringify","release","commit","componentDidMount","_this3","interval","setInterval","componentWillUnmount","clearInterval","render","_this4","children","roleData","filter","obj","sum","arr","reduce","a","b","gatherResourceStats","prop","map","resourceStats","cpu_total","cpu_avail","memory_total","memory_avail","gpu_total","gpu_memory_total","gpu_memory_avail","cpu_used","memory_used","row_count","container","length","CPU_row","xs","toFixed","CPU_Memory_Info_row","version_row","table_bodies","gpu_memory_used","GPU_row","GPU_Memory_Info_row","supervisor_addr_row","splice","size","style","fontWeight","workerData","row","Component"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/cluster_info/nodeInfo.js"],"sourcesContent":["import Table from '@mui/material/Table'\nimport TableBody from '@mui/material/TableBody'\nimport TableHead from '@mui/material/TableHead'\nimport TableRow from '@mui/material/TableRow'\nimport Grid from '@mui/material/Unstable_Grid2'\nimport PropTypes from 'prop-types'\nimport React from 'react'\n\nimport fetchWrapper from '../../components/fetchWrapper'\nimport { toReadableSize } from '../../components/utils'\nimport { StyledTableCell, StyledTableRow } from './style'\n\nclass NodeInfo extends React.Component {\n constructor(props) {\n super(props)\n this.nodeRole = props.nodeRole\n this.endpoint = props.endpoint\n this.state = {\n version: {},\n info: [],\n }\n }\n\n refreshInfo() {\n if (\n this.props.cookie.token === '' ||\n this.props.cookie.token === undefined ||\n (this.props.cookie.token !== 'no_auth' &&\n !sessionStorage.getItem('token'))\n ) {\n return\n }\n fetchWrapper\n .get('/v1/cluster/info?detailed=true')\n .then((data) => {\n const { state } = this\n state['info'] = data\n this.setState(state)\n })\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status == 403) {\n this.props.handleGoBack()\n }\n })\n\n if (JSON.stringify(this.state.version) === '{}') {\n fetchWrapper\n .get('/v1/cluster/version')\n .then((data) => {\n const { state } = this\n state['version'] = {\n release: 'v' + data['version'],\n commit: data['full-revisionid'],\n }\n this.setState(state)\n })\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status == 403) {\n this.props.handleGoBack()\n }\n })\n }\n }\n\n componentDidMount() {\n this.interval = setInterval(() => this.refreshInfo(), 5000)\n this.refreshInfo()\n }\n\n componentWillUnmount() {\n clearInterval(this.interval)\n }\n\n render() {\n if (this.state === undefined || this.state['info'] === []) {\n return <div>Loading</div>\n }\n\n if (this.nodeRole !== 'Worker-Details') {\n const roleData = this.state['info'].filter(\n (obj) => obj['node_type'] === this.nodeRole\n )\n\n const sum = (arr) => {\n return arr.reduce((a, b) => a + b, 0)\n }\n\n const gatherResourceStats = (prop) =>\n sum(roleData.map((obj) => obj[prop]))\n\n const resourceStats = {\n cpu_total: gatherResourceStats('cpu_count'),\n cpu_avail: gatherResourceStats('cpu_available'),\n memory_total: gatherResourceStats('mem_total'),\n memory_avail: gatherResourceStats('mem_available'),\n gpu_total: gatherResourceStats('gpu_count'),\n gpu_memory_total: gatherResourceStats('gpu_vram_total'),\n gpu_memory_avail: gatherResourceStats('gpu_vram_available'),\n }\n\n //for all cases, we will at least have cpu information available.\n resourceStats.cpu_used = resourceStats.cpu_total - resourceStats.cpu_avail\n resourceStats.memory_used =\n resourceStats.memory_total - resourceStats.memory_avail\n\n const row_count = (\n <StyledTableRow>\n <StyledTableCell>Count</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid>{roleData.length}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const CPU_row = (\n <StyledTableRow>\n <StyledTableCell>CPU Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>Usage: {resourceStats.cpu_used.toFixed(2)}</Grid>\n <Grid xs={8}>Total: {resourceStats.cpu_total.toFixed(2)}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const CPU_Memory_Info_row = (\n <StyledTableRow>\n <StyledTableCell>CPU Memory Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n Usage: {toReadableSize(resourceStats.memory_used)}\n </Grid>\n <Grid xs={8}>\n Total: {toReadableSize(resourceStats.memory_total)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const version_row = (\n <StyledTableRow>\n <StyledTableCell>Version</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>Release: {this.state.version.release}</Grid>\n <Grid xs={8}>Commit: {this.state.version.commit}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n let table_bodies\n //case that we do not have GPU presents.\n if (resourceStats.gpu_memory_total === 0) {\n table_bodies = [row_count, CPU_row, CPU_Memory_Info_row, version_row]\n } else {\n resourceStats.gpu_memory_used =\n resourceStats.gpu_memory_total - resourceStats.gpu_memory_avail\n\n const GPU_row = (\n <StyledTableRow>\n <StyledTableCell>GPU Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={12}>Total: {resourceStats.gpu_total.toFixed(2)}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const GPU_Memory_Info_row = (\n <StyledTableRow>\n <StyledTableCell>GPU Memory Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n Usage: {toReadableSize(resourceStats.gpu_memory_used)}\n </Grid>\n <Grid xs={8}>\n Total: {toReadableSize(resourceStats.gpu_memory_total)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n table_bodies = [\n row_count,\n CPU_row,\n CPU_Memory_Info_row,\n GPU_row,\n GPU_Memory_Info_row,\n version_row,\n ]\n }\n\n if (this.nodeRole === 'Supervisor') {\n const supervisor_addr_row = (\n <StyledTableRow>\n <StyledTableCell>Address</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid>{roleData[0] ? roleData[0]['ip_address'] : '-'}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n table_bodies.splice(1, 0, supervisor_addr_row)\n }\n\n return (\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Item\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n <Grid container>\n <Grid>Value</Grid>\n </Grid>\n </StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>{table_bodies}</TableBody>\n </Table>\n )\n } else {\n const workerData = this.state['info'].filter(\n (obj) => obj['node_type'] === 'Worker'\n )\n\n return (\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Node Type\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Address\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n CPU Usage\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n CPU Total\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Mem Usage\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Mem Total\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n GPU Count\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n GPU Mem Usage\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n GPU Mem Total\n </StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {workerData.map((row) => (\n <StyledTableRow>\n <StyledTableCell>Worker</StyledTableCell>\n <StyledTableCell>{row['ip_address']}</StyledTableCell>\n <StyledTableCell>\n {(row['cpu_count'] - row['cpu_available']).toFixed(2)}\n </StyledTableCell>\n <StyledTableCell>{row['cpu_count'].toFixed(2)}</StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['mem_total'] - row['mem_available'])}\n </StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['mem_total'])}\n </StyledTableCell>\n <StyledTableCell>{row['gpu_count'].toFixed(2)}</StyledTableCell>\n <StyledTableCell>\n {toReadableSize(\n row['gpu_vram_total'] - row['gpu_vram_available']\n )}\n </StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['gpu_vram_total'])}\n </StyledTableCell>\n </StyledTableRow>\n ))}\n </TableBody>\n </Table>\n )\n }\n }\n}\n\nNodeInfo.propTypes = {\n nodeRole: PropTypes.string,\n endpoint: PropTypes.string,\n}\n\nexport default NodeInfo\n"],"mappings":"oiBAAA,MAAO,CAAAA,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,QAAQ,KAAM,wBAAwB,CAC7C,MAAO,CAAAC,IAAI,KAAM,8BAA8B,CAE/C,MAAO,CAAAC,KAAK,KAAM,OAAO,CAEzB,MAAO,CAAAC,YAAY,KAAM,+BAA+B,CACxD,OAASC,cAAc,KAAQ,wBAAwB,CACvD,OAASC,eAAe,CAAEC,cAAc,KAAQ,SAAS,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,4BAEnD,CAAAC,QAAQ,uBAAAC,gBAAA,EAAAC,SAAA,CAAAF,QAAA,CAAAC,gBAAA,MAAAE,MAAA,CAAAC,YAAA,CAAAJ,QAAA,EACZ,SAAAA,SAAYK,KAAK,CAAE,KAAAC,KAAA,CAAAC,eAAA,MAAAP,QAAA,EACjBM,KAAA,CAAAH,MAAA,CAAAK,IAAA,MAAMH,KAAK,EACXC,KAAA,CAAKG,QAAQ,CAAGJ,KAAK,CAACI,QAAQ,CAC9BH,KAAA,CAAKI,QAAQ,CAAGL,KAAK,CAACK,QAAQ,CAC9BJ,KAAA,CAAKK,KAAK,CAAG,CACXC,OAAO,CAAE,CAAC,CAAC,CACXC,IAAI,CAAE,EACR,CAAC,QAAAP,KAAA,CACH,CAACQ,YAAA,CAAAd,QAAA,GAAAe,GAAA,eAAAC,KAAA,CAED,SAAAC,YAAA,CAAc,KAAAC,MAAA,M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AC,WAAW,CAAC,CAACb,OAAO,CAAC,CAAC,CAAC,CAAkB,CAAC,cAChE5E,IAAA,CAACH,eAAe,EAAAoD,QAAA,CACbrD,cAAc,CACb6F,GAAG,CAAC,gBAAgB,CAAC,CAAGA,GAAG,CAAC,oBAAoB,CAClD,CAAC,CACc,CAAC,cAClBzF,IAAA,CAACH,eAAe,EAAAoD,QAAA,CACbrD,cAAc,CAAC6F,GAAG,CAAC,gBAAgB,CAAC,CAAC,CACvB,CAAC,EACJ,CAAC,EAClB,CAAC,CACO,CAAC,EACP,CAAC,CAEZ,CACF,CAAC,WAAAtF,QAAA,GAlSoBT,KAAK,CAACgG,SAAS,EA0StC,cAAe,CAAAvF,QAAQ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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{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];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:\"Controlnet\"}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",size:\"small\",endIcon:/*#__PURE__*/_jsx(AddIcon,{}),className:\"addBtn\",onClick:handleAddControlnet,children:\"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:\"Model Format\"}),/*#__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:\"Delete specs\",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","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","AddControlnet","_ref","controlnetDataArr","onGetControlnetArr","scrollRef","_useState","_useState2","_slicedToArray","count","setCount","_useState3","_useState4","controlnetArr","setControlnetArr","_useState5","_useState6","isAdd","setIsAdd","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'\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\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' }}>Controlnet</label>\n <Button\n variant=\"contained\"\n size=\"small\"\n endIcon={<AddIcon />}\n className=\"addBtn\"\n onClick={handleAddControlnet}\n >\n 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 Model Format\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=\"Delete specs\" 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 },\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