xinference 0.6.5__py3-none-any.whl → 0.7.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/_version.py +3 -3
- xinference/api/restful_api.py +18 -4
- xinference/core/model.py +33 -10
- xinference/core/supervisor.py +10 -0
- xinference/core/worker.py +40 -13
- xinference/deploy/utils.py +4 -1
- xinference/model/embedding/__init__.py +5 -1
- xinference/model/embedding/core.py +10 -7
- xinference/model/llm/ggml/chatglm.py +7 -5
- xinference/model/llm/llm_family.py +41 -15
- xinference/model/llm/pytorch/core.py +1 -0
- xinference/model/llm/pytorch/utils.py +3 -0
- xinference/model/llm/vllm/core.py +8 -2
- xinference/model/rerank/__init__.py +5 -1
- xinference/model/rerank/core.py +7 -6
- xinference/model/utils.py +38 -2
- xinference/types.py +4 -4
- xinference/web/ui/build/asset-manifest.json +3 -3
- xinference/web/ui/build/index.html +1 -1
- xinference/web/ui/build/static/js/main.778615cc.js +3 -0
- xinference/web/ui/build/static/js/main.778615cc.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/0cccfbe5d963b8e31eb679f9d9677392839cedd04aa2956ac6b33cf19599d597.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/2f651cf60b1bde50c0601c7110f77dd44819fb6e2501ff748a631724d91445d4.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/35204b265d70210394b0a8571e5b01c8c0f9a748437b8a923961e3560ae3d550.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/47887a9524ffeecdc2a7839dace146b24f97a5564fc3d431d6179ad2b153cf1f.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/483eb7e5f01e34c6a42ad7c64dad550ff945ee21053a52c2e5e7ebe108b85411.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/667753ce39ce1d4bcbf9a5f1a103d653be1d19d42f4e1fbaceb9b507679a52c7.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/6a60ae66b29c2f3634fd081d369b9e63b4522fe18eb9e43e9979d1ff264b68ad.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/6e63957e4e0801705c6cb258379bfda0007ce6c3ddd2e3b62898b68455c3edf4.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/8d2b0b3c6988d1894694dcbbe708ef91cfe62d62dac317031f09915ced637953.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/8d77975a2735d67a618407026e5325608ccd66f1b379a74faf35b4087db536f3.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/a158a9ffa0c9b169aee53dd4a0c44501a596755b4e4f6ede7746d65a72e2a71f.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/a5e2e9f707eb7039bea096ca117d996b8f9cbc2a5613fd8e0c5b0094444ce23c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/b374bf2be1eac3cff5e0a8528a8e816e266ece911f714c123110961798a93a3b.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/d8a42e9df7157de9f28eecefdf178fd113bf2280d28471b6e32a8a45276042df.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/e26750d9556e9741912333349e4da454c53dbfddbfc6002ab49518dcf02af745.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/ed010102f476cd1a22b49be031a7f94f2ab3dd7ba8bf58839a771d46e28ff559.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/ef42ec014d7bc373b874b2a1ff0dcd785490f125e913698bc049b0bd778e4d66.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/fe3eb4d76c79ca98833f686d642224eeeb94cc83ad14300d281623796d087f0a.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/fe653ca0ca4297b415c0be4013574870d0465a657ae0f3d3f5b66ef6a831390c.json +1 -0
- xinference/web/ui/node_modules/.package-lock.json +1077 -405
- xinference/web/ui/node_modules/@eslint/eslintrc/node_modules/globals/globals.json +163 -3
- xinference/web/ui/node_modules/@eslint/eslintrc/node_modules/globals/package.json +1 -1
- xinference/web/ui/node_modules/@eslint/eslintrc/node_modules/ignore/package.json +64 -0
- xinference/web/ui/node_modules/@eslint/eslintrc/package.json +18 -37
- xinference/web/ui/node_modules/@eslint/js/package.json +1 -1
- xinference/web/ui/node_modules/@eslint-community/regexpp/package.json +9 -4
- xinference/web/ui/node_modules/@humanwhocodes/config-array/package.json +14 -14
- xinference/web/ui/node_modules/@rushstack/eslint-patch/package.json +6 -4
- xinference/web/ui/node_modules/@types/semver/package.json +15 -15
- xinference/web/ui/node_modules/@ungap/structured-clone/cjs/package.json +1 -0
- xinference/web/ui/node_modules/@ungap/structured-clone/package.json +53 -0
- xinference/web/ui/node_modules/ansi-colors/package.json +129 -0
- xinference/web/ui/node_modules/array-includes/package.json +8 -8
- xinference/web/ui/node_modules/array.prototype.findlastindex/package.json +120 -0
- xinference/web/ui/node_modules/array.prototype.flat/package.json +8 -8
- xinference/web/ui/node_modules/array.prototype.flatmap/package.json +8 -8
- xinference/web/ui/node_modules/arraybuffer.prototype.slice/package.json +103 -0
- xinference/web/ui/node_modules/ast-types-flow/package.json +2 -2
- xinference/web/ui/node_modules/astral-regex/package.json +33 -0
- xinference/web/ui/node_modules/asynciterator.prototype/package.json +72 -0
- xinference/web/ui/node_modules/axe-core/locales/_template.json +0 -12
- xinference/web/ui/node_modules/axe-core/package.json +1 -2
- xinference/web/ui/node_modules/axe-core/sri-history.json +0 -8
- xinference/web/ui/node_modules/call-bind/package.json +33 -23
- xinference/web/ui/node_modules/define-data-property/package.json +113 -0
- xinference/web/ui/node_modules/define-data-property/tsconfig.json +59 -0
- xinference/web/ui/node_modules/define-properties/package.json +5 -4
- xinference/web/ui/node_modules/enquirer/package.json +112 -0
- xinference/web/ui/node_modules/es-abstract/helpers/caseFolding.json +1430 -0
- xinference/web/ui/node_modules/es-abstract/package.json +29 -23
- xinference/web/ui/node_modules/es-iterator-helpers/index.json +17 -0
- xinference/web/ui/node_modules/es-iterator-helpers/package.json +185 -0
- xinference/web/ui/node_modules/eslint/conf/{rule-type-list.json → category-list.json} +9 -6
- xinference/web/ui/node_modules/eslint/node_modules/@babel/code-frame/package.json +25 -0
- xinference/web/ui/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json +289 -0
- xinference/web/ui/node_modules/eslint/node_modules/eslint-visitor-keys/package.json +39 -0
- xinference/web/ui/node_modules/eslint/node_modules/glob-parent/package.json +48 -0
- xinference/web/ui/node_modules/eslint/node_modules/ignore/package.json +64 -0
- xinference/web/ui/node_modules/eslint/package.json +53 -82
- xinference/web/ui/node_modules/eslint-config-prettier/package.json +13 -0
- xinference/web/ui/node_modules/eslint-import-resolver-node/package.json +3 -3
- xinference/web/ui/node_modules/eslint-plugin-import/package.json +22 -17
- xinference/web/ui/node_modules/eslint-plugin-jsx-a11y/package.json +25 -24
- xinference/web/ui/node_modules/eslint-plugin-simple-import-sort/package.json +23 -0
- xinference/web/ui/node_modules/eslint-plugin-testing-library/package.json +1 -1
- xinference/web/ui/node_modules/eslint-scope/package.json +19 -34
- xinference/web/ui/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json +284 -0
- xinference/web/ui/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json +40 -0
- xinference/web/ui/node_modules/eslint-utils/package.json +65 -0
- xinference/web/ui/node_modules/eslint-visitor-keys/package.json +15 -15
- xinference/web/ui/node_modules/espree/node_modules/acorn/package.json +35 -0
- xinference/web/ui/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json +284 -0
- xinference/web/ui/node_modules/espree/node_modules/eslint-visitor-keys/package.json +40 -0
- xinference/web/ui/node_modules/espree/package.json +27 -51
- xinference/web/ui/node_modules/function-bind/package.json +38 -14
- xinference/web/ui/node_modules/function.prototype.name/package.json +32 -13
- xinference/web/ui/node_modules/functional-red-black-tree/package.json +40 -0
- xinference/web/ui/node_modules/get-intrinsic/package.json +11 -11
- xinference/web/ui/node_modules/hasown/package.json +91 -0
- xinference/web/ui/node_modules/hasown/tsconfig.json +49 -0
- xinference/web/ui/node_modules/is-async-function/package.json +86 -0
- xinference/web/ui/node_modules/is-core-module/core.json +3 -3
- xinference/web/ui/node_modules/is-core-module/package.json +7 -7
- xinference/web/ui/node_modules/is-finalizationregistry/package.json +67 -0
- xinference/web/ui/node_modules/is-generator-function/package.json +87 -0
- xinference/web/ui/node_modules/is-typed-array/package.json +8 -10
- xinference/web/ui/node_modules/iterator.prototype/package.json +73 -0
- xinference/web/ui/node_modules/jsx-ast-utils/package.json +5 -5
- xinference/web/ui/node_modules/language-tags/package.json +48 -8
- xinference/web/ui/node_modules/lodash.truncate/package.json +17 -0
- xinference/web/ui/node_modules/object-inspect/package.json +8 -6
- xinference/web/ui/node_modules/object.entries/package.json +7 -7
- xinference/web/ui/node_modules/object.fromentries/package.json +7 -7
- xinference/web/ui/node_modules/object.groupby/package.json +83 -0
- xinference/web/ui/node_modules/object.values/package.json +7 -7
- xinference/web/ui/node_modules/prettier/package.json +21 -0
- xinference/web/ui/node_modules/progress/package.json +26 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/@eslint/eslintrc/package.json +82 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/@humanwhocodes/config-array/package.json +61 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/@humanwhocodes/object-schema/package.json +33 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/ansi-styles/package.json +56 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/chalk/package.json +68 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/color-convert/package.json +48 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/color-name/package.json +28 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/escape-string-regexp/package.json +38 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/eslint/conf/replacements.json +22 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/eslint/conf/rule-type-list.json +28 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/eslint/package.json +179 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/eslint-scope/package.json +63 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/espree/package.json +88 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/globals/globals.json +1974 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/globals/package.json +55 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/has-flag/package.json +46 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/supports-color/package.json +53 -0
- xinference/web/ui/node_modules/react-scripts/node_modules/type-fest/package.json +58 -0
- xinference/web/ui/node_modules/reflect.getprototypeof/package.json +99 -0
- xinference/web/ui/node_modules/regexp.prototype.flags/package.json +8 -7
- xinference/web/ui/node_modules/regexpp/package.json +91 -0
- xinference/web/ui/node_modules/resolve/lib/core.json +4 -1
- xinference/web/ui/node_modules/resolve/package.json +9 -8
- xinference/web/ui/node_modules/resolve/test/resolver/multirepo/package.json +1 -1
- xinference/web/ui/node_modules/safe-array-concat/package.json +5 -5
- xinference/web/ui/node_modules/set-function-length/package.json +84 -0
- xinference/web/ui/node_modules/set-function-name/package.json +80 -0
- xinference/web/ui/node_modules/slice-ansi/node_modules/ansi-styles/package.json +56 -0
- xinference/web/ui/node_modules/slice-ansi/node_modules/color-convert/package.json +48 -0
- xinference/web/ui/node_modules/slice-ansi/node_modules/color-name/package.json +28 -0
- xinference/web/ui/node_modules/slice-ansi/package.json +52 -0
- xinference/web/ui/node_modules/string.prototype.trim/package.json +7 -7
- xinference/web/ui/node_modules/string.prototype.trimend/package.json +7 -7
- xinference/web/ui/node_modules/string.prototype.trimstart/package.json +7 -7
- xinference/web/ui/node_modules/table/dist/src/schemas/config.json +95 -0
- xinference/web/ui/node_modules/table/dist/src/schemas/shared.json +139 -0
- xinference/web/ui/node_modules/table/dist/src/schemas/streamConfig.json +25 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/data.json +13 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/data.json +13 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- xinference/web/ui/node_modules/table/node_modules/ajv/package.json +126 -0
- xinference/web/ui/node_modules/table/node_modules/json-schema-traverse/package.json +43 -0
- xinference/web/ui/node_modules/table/package.json +77 -0
- xinference/web/ui/node_modules/typed-array-buffer/package.json +73 -0
- xinference/web/ui/node_modules/typed-array-byte-length/package.json +98 -0
- xinference/web/ui/node_modules/v8-compile-cache/package.json +34 -0
- xinference/web/ui/node_modules/which-builtin-type/package.json +93 -0
- xinference/web/ui/node_modules/which-typed-array/package.json +4 -5
- xinference/web/ui/package-lock.json +1085 -406
- xinference/web/ui/package.json +10 -2
- {xinference-0.6.5.dist-info → xinference-0.7.1.dist-info}/METADATA +46 -35
- {xinference-0.6.5.dist-info → xinference-0.7.1.dist-info}/RECORD +217 -110
- xinference/web/ui/build/static/js/main.9b46963e.js +0 -3
- xinference/web/ui/build/static/js/main.9b46963e.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/06363becf51869c421a8b3e34b4e3f50aa0aac3d590446044f9412e379f4ebbe.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/2849edddeb99a8ecdda577e810eead74b8f8a291cdfbd987839d604666ed79d0.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/2c774712d327cdf0b192aaa22785ec380e9427c587350c33289828d99e9c4abc.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/34c578e50d3040519ca8dc28bf0f7fec8674c2d6c0fcc3e98401c0a3f9f013cf.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/5933910e7c33febbabc0297ef7ba80f5e53ed96aa125b6a44ff2910aec29ced1.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/5e18a8354ea03d22a967fd8cb2171aa798edcb3da5d66ab1fd3b9663affd0abe.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/717cd7c186ace4812d1e602bdd299d8dc507f072670cc43974d53aac2574df5d.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/a178cfde289ffd15fd54b1c80fd9d231ae0f9644db33acb02084e69b32bfee37.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/aad919619ddb400e30bf9886f3ad7f59d5ec7cdbb98ed8b8442565bb19164237.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/adaec65f73accce3171b51b0fbcbfd8d0cd83f81a2e1b28eb34148644875499a.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/ae8f44c77c2e6f79680fe32fb00174183cd867093ebbda967b8985c33cc10fa2.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/b10bd04b4d6e28bfcaaaab37b0a4c1986e87a5b7e62e5ce4d56019880ef26990.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/cfc5da1cedee985a556e04865affccb72d0f624cbfb73da348bbe8693e8a4983.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/eebd0123c4b4396737e56b9181406a9fd76b107dd32971d23b0de99f51dd38d6.json +0 -1
- xinference/web/ui/node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/eslint-scope/package.json +0 -48
- xinference/web/ui/node_modules/@typescript-eslint/utils/node_modules/eslint-scope/package.json +0 -48
- xinference/web/ui/node_modules/@typescript-eslint/utils/node_modules/estraverse/package.json +0 -40
- xinference/web/ui/node_modules/eslint/node_modules/argparse/package.json +0 -31
- xinference/web/ui/node_modules/eslint/node_modules/js-yaml/package.json +0 -66
- xinference/web/ui/node_modules/eslint-plugin-jsx-a11y/node_modules/semver/package.json +0 -38
- xinference/web/ui/node_modules/function-bind/.jscs.json +0 -176
- xinference/web/ui/node_modules/resolve/test/resolver/malformed_package_json/package.json +0 -1
- xinference/web/ui/node_modules/webpack/node_modules/eslint-scope/package.json +0 -48
- xinference/web/ui/node_modules/webpack/node_modules/estraverse/package.json +0 -40
- /xinference/web/ui/build/static/js/{main.9b46963e.js.LICENSE.txt → main.778615cc.js.LICENSE.txt} +0 -0
- /xinference/web/ui/node_modules/{@nicolo-ribaudo/eslint-scope-5-internals → eslint-scope}/node_modules/estraverse/package.json +0 -0
- /xinference/web/ui/node_modules/{@eslint/eslintrc → react-scripts}/node_modules/argparse/package.json +0 -0
- /xinference/web/ui/node_modules/{eslint → react-scripts/node_modules/eslint}/lib/cli-engine/formatters/formatters-meta.json +0 -0
- /xinference/web/ui/node_modules/{eslint-config-react-app → react-scripts/node_modules/eslint-config-react-app}/package.json +0 -0
- /xinference/web/ui/node_modules/{eslint-plugin-flowtype → react-scripts/node_modules/eslint-plugin-flowtype}/dist/configs/recommended.json +0 -0
- /xinference/web/ui/node_modules/{eslint-plugin-flowtype → react-scripts/node_modules/eslint-plugin-flowtype}/package.json +0 -0
- /xinference/web/ui/node_modules/{@eslint/eslintrc → react-scripts}/node_modules/js-yaml/package.json +0 -0
- {xinference-0.6.5.dist-info → xinference-0.7.1.dist-info}/LICENSE +0 -0
- {xinference-0.6.5.dist-info → xinference-0.7.1.dist-info}/WHEEL +0 -0
- {xinference-0.6.5.dist-info → xinference-0.7.1.dist-info}/entry_points.txt +0 -0
- {xinference-0.6.5.dist-info → xinference-0.7.1.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import{Typography,Box}from\"@mui/material\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var Title=function Title(_ref){var title=_ref.title,subtitle=_ref.subtitle;return/*#__PURE__*/_jsxs(Box,{mb:\"30px\",children:[/*#__PURE__*/_jsx(Typography,{variant:\"h2\",color:\"#141414\",fontWeight:\"bold\",sx:{m:\"0 0 5px 0\"},children:title}),/*#__PURE__*/_jsx(Typography,{variant:\"h5\",color:\"#3d3d3d\",children:subtitle})]});};export default Title;","map":{"version":3,"names":["Typography","Box","jsx","_jsx","jsxs","_jsxs","Title","_ref","title","subtitle","mb","children","variant","color","fontWeight","sx","m"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/Title.js"],"sourcesContent":["import { Typography, Box } from \"@mui/material\";\n\nconst Title = ({ title, subtitle }) => {\n return (\n <Box mb=\"30px\">\n <Typography\n variant=\"h2\"\n color=\"#141414\"\n fontWeight=\"bold\"\n sx={{ m: \"0 0 5px 0\" }}\n >\n {title}\n </Typography>\n <Typography variant=\"h5\" color=\"#3d3d3d\">\n {subtitle}\n </Typography>\n </Box>\n );\n};\n\nexport default Title;\n"],"mappings":"AAAA,OAASA,UAAU,CAAEC,GAAG,KAAQ,eAAe,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEhD,GAAM,CAAAC,KAAK,CAAG,QAAR,CAAAA,KAAKA,CAAAC,IAAA,CAA4B,IAAtB,CAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAC9B,mBACEJ,KAAA,CAACJ,GAAG,EAACS,EAAE,CAAC,MAAM,CAAAC,QAAA,eACZR,IAAA,CAACH,UAAU,EACTY,OAAO,CAAC,IAAI,CACZC,KAAK,CAAC,SAAS,CACfC,UAAU,CAAC,MAAM,CACjBC,EAAE,CAAE,CAAEC,CAAC,CAAE,WAAY,CAAE,CAAAL,QAAA,CAEtBH,KAAK,CACI,CAAC,cACbL,IAAA,CAACH,UAAU,EAACY,OAAO,CAAC,IAAI,CAACC,KAAK,CAAC,SAAS,CAAAF,QAAA,CACrCF,QAAQ,CACC,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAH,KAAK"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{CssBaseline,ThemeProvider}from\"@mui/material\";import{HashRouter,Route,Routes}from\"react-router-dom\";import{ApiContextProvider}from\"./components/apiContext\";import{useMode}from\"./theme\";import Layout from\"./scenes/_layout\";import RunningModels from\"./scenes/running_models\";import LaunchModel from\"./scenes/launch_model\";import RegisterModel from\"./scenes/register_model\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";function App(){var _useMode=useMode(),_useMode2=_slicedToArray(_useMode,1),theme=_useMode2[0];return/*#__PURE__*/_jsx(\"div\",{className:\"app\",children:/*#__PURE__*/_jsx(HashRouter,{children:/*#__PURE__*/_jsx(ThemeProvider,{theme:theme,children:/*#__PURE__*/_jsxs(ApiContextProvider,{children:[/*#__PURE__*/_jsx(CssBaseline,{}),/*#__PURE__*/_jsx(Routes,{children:/*#__PURE__*/_jsxs(Route,{element:/*#__PURE__*/_jsx(Layout,{}),children:[/*#__PURE__*/_jsx(Route,{path:\"/\",element:/*#__PURE__*/_jsx(LaunchModel,{})}),/*#__PURE__*/_jsx(Route,{path:\"/running_models\",element:/*#__PURE__*/_jsx(RunningModels,{})}),/*#__PURE__*/_jsx(Route,{path:\"/register_model\",element:/*#__PURE__*/_jsx(RegisterModel,{})})]})})]})})})});}export default App;","map":{"version":3,"names":["CssBaseline","ThemeProvider","HashRouter","Route","Routes","ApiContextProvider","useMode","Layout","RunningModels","LaunchModel","RegisterModel","jsx","_jsx","jsxs","_jsxs","App","_useMode","_useMode2","_slicedToArray","theme","className","children","element","path"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/App.js"],"sourcesContent":["import { CssBaseline, ThemeProvider } from \"@mui/material\";\nimport { HashRouter, Route, Routes } from \"react-router-dom\";\nimport { ApiContextProvider } from \"./components/apiContext\";\nimport { useMode } from \"./theme\";\nimport Layout from \"./scenes/_layout\";\n\nimport RunningModels from \"./scenes/running_models\";\nimport LaunchModel from \"./scenes/launch_model\";\nimport RegisterModel from \"./scenes/register_model\";\n\nfunction App() {\n const [theme] = useMode();\n return (\n <div className=\"app\">\n <HashRouter>\n <ThemeProvider theme={theme}>\n <ApiContextProvider>\n <CssBaseline />\n <Routes>\n <Route element={<Layout />}>\n <Route path=\"/\" element={<LaunchModel />} />\n <Route path=\"/running_models\" element={<RunningModels />} />\n <Route path=\"/register_model\" element={<RegisterModel />} />\n </Route>\n </Routes>\n </ApiContextProvider>\n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,EAACoB,IAAI,CAAC,iBAAiB,CAACD,OAAO,cAAEV,IAAA,CAACF,aAAa,GAAE,CAAE,CAAE,CAAC,EACvD,CAAC,CACF,CAAC,EACS,CAAC,CACR,CAAC,CACN,CAAC,CACV,CAAC,CAEV,CAEA,cAAe,CAAAK,GAAG"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import React from\"react\";import ReactDOM from\"react-dom/client\";import App from\"./App\";import{jsx as _jsx}from\"react/jsx-runtime\";var root=ReactDOM.createRoot(document.getElementById(\"root\"));root.render(/*#__PURE__*/_jsx(React.StrictMode,{children:/*#__PURE__*/_jsx(App,{})}));","map":{"version":3,"names":["React","ReactDOM","App","jsx","_jsx","root","createRoot","document","getElementById","render","StrictMode","children"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/index.js"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport App from \"./App\";\n\nconst root = ReactDOM.createRoot(document.getElementById(\"root\"));\nroot.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n);\n"],"mappings":"AAAA,MAAO,CAAAA,KAAK,KAAM,OAAO,CACzB,MAAO,CAAAC,QAAQ,KAAM,kBAAkB,CACvC,MAAO,CAAAC,GAAG,KAAM,OAAO,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAExB,GAAM,CAAAC,IAAI,CAAGJ,QAAQ,CAACK,UAAU,CAACC,QAAQ,CAACC,cAAc,CAAC,MAAM,CAAC,CAAC,CACjEH,IAAI,CAACI,MAAM,cACTL,IAAA,CAACJ,KAAK,CAACU,UAAU,EAAAC,QAAA,cACfP,IAAA,CAACF,GAAG,GAAE,CAAC,CACS,CACpB,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React,{createContext,useState}from\"react\";import{jsx as _jsx}from\"react/jsx-runtime\";export var ApiContext=/*#__PURE__*/createContext();export var ApiContextProvider=function ApiContextProvider(_ref){var children=_ref.children;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isCallingApi=_useState2[0],setIsCallingApi=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isUpdatingModel=_useState4[0],setIsUpdatingModel=_useState4[1];var endPoint=\"\";if(!process.env.NODE_ENV||process.env.NODE_ENV===\"development\"){endPoint=\"http://127.0.0.1:9997\";}else{var fullUrl=window.location.href;endPoint=fullUrl.split(\"/ui\")[0];}return/*#__PURE__*/_jsx(ApiContext.Provider,{value:{isCallingApi:isCallingApi,setIsCallingApi:setIsCallingApi,isUpdatingModel:isUpdatingModel,setIsUpdatingModel:setIsUpdatingModel,endPoint:endPoint},children:children});};","map":{"version":3,"names":["React","createContext","useState","jsx","_jsx","ApiContext","ApiContextProvider","_ref","children","_useState","_useState2","_slicedToArray","isCallingApi","setIsCallingApi","_useState3","_useState4","isUpdatingModel","setIsUpdatingModel","endPoint","process","env","NODE_ENV","fullUrl","window","location","href","split","Provider","value"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/apiContext.js"],"sourcesContent":["import React, { createContext, useState } from \"react\";\n\nexport const ApiContext = createContext();\n\nexport const ApiContextProvider = ({ children }) => {\n const [isCallingApi, setIsCallingApi] = useState(false);\n const [isUpdatingModel, setIsUpdatingModel] = useState(false);\n let endPoint = \"\";\n if (!process.env.NODE_ENV || process.env.NODE_ENV === \"development\") {\n endPoint = \"http://127.0.0.1:9997\";\n } else {\n const fullUrl = window.location.href;\n endPoint = fullUrl.split(\"/ui\")[0];\n }\n\n return (\n <ApiContext.Provider\n value={{\n isCallingApi,\n setIsCallingApi,\n isUpdatingModel,\n setIsUpdatingModel,\n endPoint,\n }}\n >\n {children}\n </ApiContext.Provider>\n );\n};\n"],"mappings":"6IAAA,MAAO,CAAAA,KA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
{"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React,{useContext,useState,useEffect}from\"react\";import ModelCard from\"./modelCard\";import Title from\"../../components/Title\";import{Box,TextField,FormControl,Select,MenuItem,InputLabel,Tabs,Tab}from\"@mui/material\";import{ApiContext}from\"../../components/apiContext\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchLLM=function LaunchLLM(){var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;// States used for filtering\nvar _useState3=useState(\"\"),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(\"all\"),_useState6=_slicedToArray(_useState5,2),modelAbility=_useState6[0],setModelAbility=_useState6[1];var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var handleTabChange=function handleTabChange(event,newValue){setTabValue(newValue);};var handleChange=function handleChange(event){setSearchTerm(event.target.value);};var handleAbilityChange=function handleAbilityChange(event){setModelAbility(event.target.value);};var filter=function filter(registration){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&&modelAbility!==\"all\"){if(registration.model_ability.indexOf(modelAbility)<0){return false;}}return true;};var update=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,registrations;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context.next=2;break;}return _context.abrupt(\"return\");case 2:_context.prev=2;setIsCallingApi(true);_context.next=6;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/LLM?detailed=true\"),{method:\"GET\"});case 6:response=_context.sent;_context.next=9;return response.json();case 9:registrations=_context.sent;setRegistrationData(registrations);_context.next=16;break;case 13:_context.prev=13;_context.t0=_context[\"catch\"](2);console.error(\"Error:\",_context.t0);case 16:_context.prev=16;setIsCallingApi(false);return _context.finish(16);case 19:case\"end\":return _context.stop();}},_callee,null,[[2,13,16,19]]);}));return function update(){return _ref.apply(this,arguments);};}();useEffect(function(){update();// eslint-disable-next-line\n},[]);var style={display:\"grid\",gridTemplateColumns:\"repeat(auto-fill, minmax(300px, 1fr))\",paddingLeft:\"2rem\",gridGap:\"2rem 0rem\"};function a11yProps(index){return{id:\"simple-tab-\".concat(index),\"aria-controls\":\"simple-tabpanel-\".concat(index)};}return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"grid\",gridTemplateColumns:\"150px 1fr\",columnGap:\"20px\",margin:\"30px 2rem\"},children:[/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"ability-select-label\",children:\"Model Ability\"}),/*#__PURE__*/_jsxs(Select,{id:\"ability\",labelId:\"ability-select-label\",label:\"Model Ability\",onChange:handleAbilityChange,value:modelAbility,size:\"small\",sx:{width:\"150px\"},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"all\",children:\"all\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"generate\",children:\"generate\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"chat\",children:\"chat\"})]})]}),/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(TextField,{id:\"search\",type:\"search\",label:\"Search for model name and description\",value:searchTerm,onChange:handleChange,size:\"small\"})})]}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration});})})]});};export default LaunchLLM;","map":{"version":3,"names":["React","useContext","useState","useEffect","ModelCard","Title","Box","TextField","FormControl","Select","MenuItem","InputLabel","Tabs","Tab","ApiContext","jsx","_jsx","jsxs","_jsxs","LaunchLLM","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","_useState6","modelAbility","setModelAbility","_React$useState","_React$useState2","tabValue","setTabValue","handleTabChange","event","newValue","handleChange","target","value","handleAbilityChange","filter","registration","modelName","model_name","toLowerCase","modelDescription","model_description","includes","model_ability","indexOf","update","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","registrations","wrap","_callee$","_context","prev","next","abrupt","fetch","concat","method","sent","json","t0","console","error","finish","stop","apply","arguments","style","display","gridTemplateColumns","paddingLeft","gridGap","a11yProps","index","id","m","children","columnGap","margin","variant","labelId","label","onChange","size","sx","width","type","map","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchLLM.js"],"sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport ModelCard from \"./modelCard\";\nimport Title from \"../../components/Title\";\nimport {\n Box,\n TextField,\n FormControl,\n Select,\n MenuItem,\n InputLabel,\n Tabs,\n Tab,\n} from \"@mui/material\";\nimport { ApiContext } from \"../../components/apiContext\";\n\nconst LaunchLLM = () => {\n let endPoint = useContext(ApiContext).endPoint;\n const [registrationData, setRegistrationData] = useState([]);\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext);\n const { isUpdatingModel } = useContext(ApiContext);\n\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState(\"\");\n\n const [modelAbility, setModelAbility] = useState(\"all\");\n const [tabValue, setTabValue] = React.useState(0);\n\n const handleTabChange = (event, newValue) => {\n setTabValue(newValue);\n };\n\n const handleChange = (event) => {\n setSearchTerm(event.target.value);\n };\n\n const handleAbilityChange = (event) => {\n setModelAbility(event.target.value);\n };\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== \"string\") return false;\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : \"\";\n 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 if (modelAbility && modelAbility !== \"all\") {\n if (registration.model_ability.indexOf(modelAbility) < 0) {\n return false;\n }\n }\n return true;\n };\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return;\n\n try {\n setIsCallingApi(true);\n\n const response = await fetch(\n `${endPoint}/v1/model_registrations/LLM?detailed=true`,\n {\n method: \"GET\",\n },\n );\n\n const registrations = await response.json();\n\n setRegistrationData(registrations);\n } catch (error) {\n console.error(\"Error:\", error);\n } finally {\n setIsCallingApi(false);\n }\n };\n\n useEffect(() => {\n update();\n // eslint-disable-next-line\n }, []);\n\n const style = {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fill, minmax(300px, 1fr))\",\n paddingLeft: \"2rem\",\n gridGap: \"2rem 0rem\",\n };\n\n function a11yProps(index) {\n return {\n id: `simple-tab-${index}`,\n \"aria-controls\": `simple-tabpanel-${index}`,\n };\n }\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"150px 1fr\",\n columnGap: \"20px\",\n margin: \"30px 2rem\",\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\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={handleAbilityChange}\n value={modelAbility}\n size=\"small\"\n sx={{ width: \"150px\" }}\n >\n <MenuItem value=\"all\">all</MenuItem>\n <MenuItem value=\"generate\">generate</MenuItem>\n <MenuItem value=\"chat\">chat</MenuItem>\n </Select>\n </FormControl>\n <FormControl variant=\"outlined\" margin=\"normal\">\n <TextField\n id=\"search\"\n type=\"search\"\n label=\"Search for model name and description\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard url={endPoint} modelData={filteredRegistration} />\n ))}\n </div>\n </Box>\n );\n};\n\nexport default LaunchLLM;\n"],"mappings":"ubAAA,MAAO,CAAAA,KAAK,EAAIC,UAAU,CAAEC,QAAQ,CAAEC,SAAS,KAAQ,OAAO,CAC9D,MAAO,CAAAC,SAAS,KAAM,aAAa,CACnC,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,OACEC,GAAG,CACHC,SAAS,CACTC,WAAW,CACXC,MAAM,CACNC,QAAQ,CACRC,UAAU,CACVC,IAAI,CACJC,GAAG,KACE,eAAe,CACtB,OAASC,UAAU,KAAQ,6BAA6B,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEzD,GAAM,CAAAC,SAAS,CAAG,QAAZ,CAAAA,SAASA,CAAA,CAAS,CACtB,GAAI,CAAAC,QAAQ,CAAGnB,UAAU,CAACa,UAAU,CAAC,CAACM,QAAQ,CAC9C,IAAAC,SAAA,CAAgDnB,QAAQ,CAAC,EAAE,CAAC,CAAAoB,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAArDG,gBAAgB,CAAAF,UAAA,IAAEG,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CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAxF,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import{createTheme}from\"@mui/material/styles\";// mui theme settings\nexport var themeSettings=function themeSettings(){return{ERROR_COLOR:\"#d8342c\",typography:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:12,h1:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:40},h2:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:32},h3:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:24},h4:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:20},h5:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:16},h6:{fontFamily:[\"Source Sans Pro\",\"sans-serif\"].join(\",\"),fontSize:14}}};};export var useMode=function useMode(){var theme=createTheme(themeSettings());return[theme];};","map":{"version":3,"names":["createTheme","themeSettings","ERROR_COLOR","typography","fontFamily","join","fontSize","h1","h2","h3","h4","h5","h6","useMode","theme"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/theme.js"],"sourcesContent":["import { createTheme } from \"@mui/material/styles\";\n\n// mui theme settings\nexport const themeSettings = () => {\n return {\n ERROR_COLOR: \"#d8342c\",\n typography: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 12,\n h1: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 40,\n },\n h2: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 32,\n },\n h3: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 24,\n },\n h4: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 20,\n },\n h5: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 16,\n },\n h6: {\n fontFamily: [\"Source Sans Pro\", \"sans-serif\"].join(\",\"),\n fontSize: 14,\n },\n },\n };\n};\n\nexport const useMode = () => {\n const theme = createTheme(themeSettings());\n return [theme];\n};\n"],"mappings":"AAAA,OAASA,WAAW,KAAQ,sBAAsB,CAElD;AACA,MAAO,IAAM,CAAAC,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAS,CACjC,MAAO,CACLC,WAAW,CAAE,SAAS,CACtBC,UAAU,CAAE,CACVC,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EAAE,CACZC,EAAE,CAAE,CACFH,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EACZ,CAAC,CACDE,EAAE,CAAE,CACFJ,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EACZ,CAAC,CACDG,EAAE,CAAE,CACFL,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EACZ,CAAC,CACDI,EAAE,CAAE,CACFN,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EACZ,CAAC,CACDK,EAAE,CAAE,CACFP,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EACZ,CAAC,CACDM,EAAE,CAAE,CACFR,UAAU,CAAE,CAAC,iBAAiB,CAAE,YAAY,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACvDC,QAAQ,CAAE,EACZ,CACF,CACF,CAAC,CACH,CAAC,CAED,MAAO,IAAM,CAAAO,OAAO,CAAG,QAAV,CAAAA,OAAOA,CAAA,CAAS,CAC3B,GAAM,CAAAC,KAAK,CAAGd,WAAW,CAACC,aAAa,CAAC,CAAC,CAAC,CAC1C,MAAO,CAACa,KAAK,CAAC,CAChB,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import React from\"react\";import{Box}from\"@mui/material\";import{Outlet}from\"react-router-dom\";import MenuSide from\"../../components/MenuSide\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var Layout=function Layout(){return/*#__PURE__*/_jsxs(Box,{display:\"flex\",width:\"100%\",height:\"100%\",children:[/*#__PURE__*/_jsx(MenuSide,{}),/*#__PURE__*/_jsx(Box,{flexGrow:1,children:/*#__PURE__*/_jsx(Outlet,{})})]});};export default Layout;","map":{"version":3,"names":["React","Box","Outlet","MenuSide","jsx","_jsx","jsxs","_jsxs","Layout","display","width","height","children","flexGrow"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/_layout/index.js"],"sourcesContent":["import React from \"react\";\nimport { Box } from \"@mui/material\";\nimport { Outlet } from \"react-router-dom\";\nimport MenuSide from \"../../components/MenuSide\";\n\nconst Layout = () => {\n return (\n <Box display=\"flex\" width=\"100%\" height=\"100%\">\n <MenuSide />\n <Box flexGrow={1}>\n <Outlet />\n </Box>\n </Box>\n );\n};\n\nexport default Layout;\n"],"mappings":"AAAA,MAAO,CAAAA,KAAK,KAAM,OAAO,CACzB,OAASC,GAAG,KAAQ,eAAe,CACnC,OAASC,MAAM,KAAQ,kBAAkB,CACzC,MAAO,CAAAC,QAAQ,KAAM,2BAA2B,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEjD,GAAM,CAAAC,MAAM,CAAG,QAAT,CAAAA,MAAMA,CAAA,CAAS,CACnB,mBACED,KAAA,CAACN,GAAG,EAACQ,OAAO,CAAC,MAAM,CAACC,KAAK,CAAC,MAAM,CAACC,MAAM,CAAC,MAAM,CAAAC,QAAA,eAC5CP,IAAA,CAACF,QAAQ,GAAE,CAAC,cACZE,IAAA,CAACJ,GAAG,EAACY,QAAQ,CAAE,CAAE,CAAAD,QAAA,cACfP,IAAA,CAACH,MAAM,GAAE,CAAC,CACP,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAM,MAAM"},"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 _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{useEffect,useState}from\"react\";import{Box,Drawer,List,ListItem,ListItemButton,ListItemIcon,ListItemText,Typography,useTheme}from\"@mui/material\";import{ChevronRightOutlined,RocketLaunchOutlined,SmartToyOutlined,AddBoxOutlined,GitHub,LibraryBooksOutlined}from\"@mui/icons-material\";import icon from\"../media/icon.webp\";import{useLocation,useNavigate}from\"react-router-dom\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var navItems=[{text:\"Launch Model\",icon:/*#__PURE__*/_jsx(RocketLaunchOutlined,{})},{text:\"Running Models\",icon:/*#__PURE__*/_jsx(SmartToyOutlined,{})},{text:\"Register Model\",icon:/*#__PURE__*/_jsx(AddBoxOutlined,{})},{text:\"Contact Us\",icon:/*#__PURE__*/_jsx(GitHub,{})}];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];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,{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,icon=_ref.icon;if(!icon){return/*#__PURE__*/_jsx(Typography,{sx:{m:\"2.25rem 0 1rem 3rem\"},children:text},text);}var link=text.toLowerCase().replace(\" \",\"_\");console.log(link);return/*#__PURE__*/_jsx(ListItem,{children:/*#__PURE__*/_jsxs(ListItemButton,{onClick:function onClick(){if(link===\"contact_us\"){window.open(\"https://github.com/xorbitsai/inference\",\"_blank\",\"noreferrer\");}else if(link===\"launch_model\"){navigate(\"/\");setActive(link);console.log(active);}else{navigate(\"/\".concat(link));setActive(link);console.log(active);}},children:[/*#__PURE__*/_jsx(ListItemIcon,{sx:{ml:\"2rem\"},children:icon}),/*#__PURE__*/_jsx(ListItemText,{primary:text}),/*#__PURE__*/_jsx(ChevronRightOutlined,{sx:{ml:\"auto\"}})]})},text);})})]})})]});};export default MenuSide;","map":{"version":3,"names":["useEffect","useState","Box","Drawer","List","ListItem","ListItemButton","ListItemIcon","ListItemText","Typography","useTheme","ChevronRightOutlined","RocketLaunchOutlined","SmartToyOutlined","AddBoxOutlined","GitHub","LibraryBooksOutlined","icon","useLocation","useNavigate","jsx","_jsx","jsxs","_jsxs","navItems","text","MenuSide","theme","_useLocation","pathname","_useState","_useState2","_slicedToArray","active","setActive","navigate","_useState3","concat","Math","min","max","window","innerWidth","_useState4","drawerWidth","setDrawerWidth","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","map","_ref","link","toLowerCase","replace","console","log","onClick","open","ml","primary"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/MenuSide.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport {\n Box,\n Drawer,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Typography,\n useTheme,\n} from \"@mui/material\";\nimport {\n ChevronRightOutlined,\n RocketLaunchOutlined,\n SmartToyOutlined,\n AddBoxOutlined,\n GitHub,\n LibraryBooksOutlined,\n} from \"@mui/icons-material\";\nimport icon from \"../media/icon.webp\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nconst navItems = [\n {\n text: \"Launch Model\",\n icon: <RocketLaunchOutlined />,\n },\n {\n text: \"Running Models\",\n icon: <SmartToyOutlined />,\n },\n {\n text: \"Register Model\",\n icon: <AddBoxOutlined />,\n },\n {\n text: \"Contact Us\",\n icon: <GitHub />,\n },\n];\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\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>\n <Box width=\"100%\">\n <Box m=\"1.5rem 2rem 2rem 3rem\"></Box>\n <List>\n {navItems.map(({ text, icon }) => {\n if (!icon) {\n return (\n <Typography key={text} sx={{ m: \"2.25rem 0 1rem 3rem\" }}>\n {text}\n </Typography>\n );\n }\n\n const link = text.toLowerCase().replace(\" \", \"_\");\n console.log(link);\n\n return (\n <ListItem key={text}>\n <ListItemButton\n onClick={() => {\n if (link === \"contact_us\") {\n window.open(\n \"https://github.com/xorbitsai/inference\",\n \"_blank\",\n \"noreferrer\",\n );\n } else if (link === \"launch_model\") {\n navigate(`/`);\n setActive(link);\n console.log(active);\n } else {\n navigate(`/${link}`);\n setActive(link);\n console.log(active);\n }\n }}\n >\n <ListItemIcon\n sx={{\n ml: \"2rem\",\n }}\n >\n {icon}\n </ListItemIcon>\n <ListItemText primary={text} />\n <ChevronRightOutlined sx={{ ml: \"auto\" }} />\n </ListItemButton>\n </ListItem>\n );\n })}\n </List>\n </Box>\n </Box>\n </Drawer>\n );\n};\n\nexport default MenuSide;\n"],"mappings":"waAAA,OAASA,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC3C,OACEC,GAAG,CACHC,MAAM,CACNC,IAAI,CACJC,QAAQ,CACRC,cAAc,CACdC,YAAY,CACZC,YAAY,CACZC,UAAU,CACVC,QAAQ,KACH,eAAe,CACtB,OACEC,oBAAoB,CACpBC,oBAAoB,CACpBC,gBAAgB,CAChBC,cAAc,CACdC,MAAM,CACNC,oBAAoB,KACf,qBAAqB,CAC5B,M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,CAAC,CAED,cAAe,CAAAC,QAAQ"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -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 _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React,{useState,useContext,useEffect}from\"react\";import TextField from\"@mui/material/TextField\";import Button from\"@mui/material/Button\";import{ApiContext}from\"../../components/apiContext\";import{Box,Checkbox,FormHelperText,FormControlLabel,Radio,RadioGroup,FormControl}from\"@mui/material\";import{useMode}from\"../../theme\";import Title from\"../../components/Title\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:\"English\",zh:\"Chinese\"};var SUPPORTED_FEATURES=[\"Generate\",\"Chat\"];// Convert dictionary of supported languages into list\nvar SUPPORTED_LANGUAGES=Object.keys(SUPPORTED_LANGUAGES_DICT);var RegisterModel=function RegisterModel(){var ERROR_COLOR=useMode();var endPoint=useContext(ApiContext).endPoint;var _useState=useState(\"\"),_useState2=_slicedToArray(_useState,2),errorMessage=_useState2[0],setErrorMessage=_useState2[1];var _useState3=useState(\"pytorch\"),_useState4=_slicedToArray(_useState3,2),modelFormat=_useState4[0],setModelFormat=_useState4[1];var _useState5=useState(7),_useState6=_slicedToArray(_useState5,2),modelSize=_useState6[0],setModelSize=_useState6[1];var _useState7=useState(\"/path/to/llama-2\"),_useState8=_slicedToArray(_useState7,2),modelUri=_useState8[0],setModelUri=_useState8[1];var _useState9=useState({version:1,context_length:2048,model_name:\"custom-llama-2\",model_lang:[\"en\"],model_ability:[\"generate\"],model_description:\"This is a custom model description.\",model_specs:[],prompt_style:undefined}),_useState10=_slicedToArray(_useState9,2),formData=_useState10[0],setFormData=_useState10[1];var _useState11=useState(\"vicuna\"),_useState12=_slicedToArray(_useState11,2),promptStyleLabel=_useState12[0],setPromptStyleLabel=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),promptStyles=_useState14[0],setPromptStyles=_useState14[1];// model name must be\n// 1. Starts with an alphanumeric character (a letter or a digit).\n// 2. Followed by any number of alphanumeric characters, underscores (_), or hyphens (-).\nvar errorModelName=!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(formData.model_name);var errorModelDescription=!/^[A-Za-z0-9\\s!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]{0,500}$/.test(formData.model_description);var errorContextLength=formData.context_length===0;var errorLanguage=formData.model_lang===undefined||formData.model_lang.length===0;var errorAbility=formData.model_ability===undefined||formData.model_ability.length===0;var errorModelSize=formData.model_specs&&formData.model_specs.some(function(spec){return spec.model_size_in_billions===undefined||spec.model_size_in_billions===0;});var errorAny=errorModelName||errorModelDescription||errorContextLength||errorLanguage||errorAbility||errorModelSize;useEffect(function(){var getBuiltInPromptStyles=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,errorData,data,res,key,v;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(endPoint+\"/v1/models/prompts\",{method:\"GET\",headers:{\"Content-Type\":\"application/json\"}});case 2:response=_context.sent;if(response.ok){_context.next=10;break;}_context.next=6;return response.json();case 6:errorData=_context.sent;throw new Error(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||\"Unknown error\"));case 10:_context.next=12;return response.json();case 12:data=_context.sent;res=[];for(key in data){v=data[key];v[\"name\"]=key;res.push(v);}setPromptStyles(res);case 16:case\"end\":return _context.stop();}},_callee);}));return function getBuiltInPromptStyles(){return _ref.apply(this,arguments);};}();getBuiltInPromptStyles().catch(console.error);});var isModelFormatPytorch=function isModelFormatPytorch(){return modelFormat===\"pytorch\";};var getPathComponents=function getPathComponents(path){var normalizedPath=path.replace(/\\\\/g,\"/\");var baseDir=normalizedPath.substring(0,normalizedPath.lastIndexOf(\"/\"));var filename=normalizedPath.substring(normalizedPath.lastIndexOf(\"/\")+1);return{baseDir:baseDir,filename:filename};};var handleClick=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _getPathComponents,baseDir,filename,ps,response,errorData;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!isModelFormatPytorch()){_getPathComponents=getPathComponents(modelUri),baseDir=_getPathComponents.baseDir,filename=_getPathComponents.filename;formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[\"\"],model_id:\"\",model_file_name_template:filename,model_uri:baseDir}];}else{formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[\"4-bit\",\"8-bit\",\"none\"],model_id:\"\",model_uri:modelUri}];}ps=promptStyles.find(function(item){return item.name===promptStyleLabel;});formData.prompt_style={style_name:ps.style_name,system_prompt:ps.system_prompt,roles:ps.roles,intra_message_sep:ps.intra_message_sep,inter_message_sep:ps.inter_message_sep};if(!errorAny){_context2.next=6;break;}setErrorMessage(\"Please fill in valid value for all fields\");return _context2.abrupt(\"return\");case 6:_context2.prev=6;_context2.next=9;return fetch(endPoint+\"/v1/model_registrations/LLM\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 9:response=_context2.sent;if(response.ok){_context2.next=15;break;}_context2.next=13;return response.json();case 13:errorData=_context2.sent;throw new Error(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||\"Unknown error\"));case 15:setErrorMessage(\"Model has been registered successfully! Navigate to launch model page to proceed.\");_context2.next=22;break;case 18:_context2.prev=18;_context2.t0=_context2[\"catch\"](6);console.error(\"There was a problem with the fetch operation:\",_context2.t0);setErrorMessage(_context2.t0.message||\"An unexpected error occurred.\");case 22:case\"end\":return _context2.stop();}},_callee2,null,[[6,18]]);}));return function handleClick(){return _ref2.apply(this,arguments);};}();var toggleLanguage=function toggleLanguage(lang){if(formData.model_lang.includes(lang)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:formData.model_lang.filter(function(l){return l!==lang;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:[].concat(_toConsumableArray(formData.model_lang),[lang])}));}};var toggleAbility=function toggleAbility(ability){if(formData.model_ability.includes(ability)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:formData.model_ability.filter(function(a){return a!==ability;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:[].concat(_toConsumableArray(formData.model_ability),[ability])}));}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Register Model\"}),/*#__PURE__*/_jsx(Box,{padding:\"20px\"}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(TextField,{label:\"Model Name\",error:errorModelName,defaultValue:formData.model_name,size:\"small\",helperText:\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_name:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5},children:\"Model Format\"}),/*#__PURE__*/_jsx(RadioGroup,{value:modelFormat,onChange:function onChange(e){setModelFormat(e.target.value);},children:/*#__PURE__*/_jsxs(Box,{sx:styles.checkboxWrapper,children:[/*#__PURE__*/_jsx(Box,{sx:{marginLeft:\"10px\"},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"pytorch\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"PyTorch\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:\"10px\"},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggmlv3\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGML\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:\"10px\"},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggufv2\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGUF\"})})]})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:errorContextLength,label:\"Context Length\",value:formData.context_length,size:\"small\",onChange:function onChange(event){var value=event.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,\"\")||\"0\";}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value=\"0\";}// Update with the processed value\nsetFormData(_objectSpread(_objectSpread({},formData),{},{context_length:Number(value)}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Size in Billions\",size:\"small\",error:errorModelSize,value:modelSize,onChange:function onChange(e){var value=e.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,\"\")||\"0\";}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value=\"0\";}setModelSize(Number(value));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Path\",size:\"small\",value:modelUri,onChange:function onChange(e){setModelUri(e.target.value);},helperText:\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Description (Optional)\",error:errorModelDescription,defaultValue:formData.model_description,size:\"small\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_description:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorLanguage?ERROR_COLOR:\"inherit\"},children:\"Model Languages\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_LANGUAGES.map(function(lang){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:\"10px\"},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_lang.includes(lang),onChange:function onChange(){return toggleLanguage(lang);},name:lang,sx:errorLanguage?{color:ERROR_COLOR,\"&.Mui-checked\":{color:ERROR_COLOR}}:{}}),label:SUPPORTED_LANGUAGES_DICT[lang],style:{paddingLeft:10,color:errorLanguage?ERROR_COLOR:\"inherit\"}})},lang);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:\"inherit\"},children:\"Model Abilities\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_FEATURES.map(function(ability){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:\"10px\"},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_ability.includes(ability.toLowerCase()),onChange:function onChange(){return toggleAbility(ability.toLowerCase());},name:ability,sx:errorAbility?{color:ERROR_COLOR,\"&.Mui-checked\":{color:ERROR_COLOR}}:{}}),label:ability,style:{paddingLeft:10,color:errorAbility?ERROR_COLOR:\"inherit\"}})},ability);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),formData.model_ability.includes(\"chat\")&&/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:\"inherit\"},children:\"Prompt styles\"}),/*#__PURE__*/_jsx(FormHelperText,{children:\"Select a prompt style that aligns with the training data of your model.\"}),/*#__PURE__*/_jsx(RadioGroup,{value:promptStyleLabel,onChange:function onChange(e){setPromptStyleLabel(e.target.value);},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:promptStyles.map(function(p){return/*#__PURE__*/_jsx(Box,{sx:{marginLeft:\"10px\"},children:/*#__PURE__*/_jsx(FormControlLabel,{value:p.name,control:/*#__PURE__*/_jsx(Radio,{}),label:p.name})});})})})]}),/*#__PURE__*/_jsxs(Box,{width:\"100%\",children:[/*#__PURE__*/_jsx(\"div\",{style:_objectSpread(_objectSpread({},styles.error),{},{color:ERROR_COLOR}),children:errorMessage}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]});};export default RegisterModel;var styles={baseFormControl:{width:\"100%\",margin:\"normal\",size:\"small\"},checkboxWrapper:{display:\"flex\",flexWrap:\"wrap\",maxWidth:\"80%\"},labelPaddingLeft:{paddingLeft:5},formControlLabelPaddingLeft:{paddingLeft:10},buttonBox:{width:\"100%\",margin:\"20px\"},error:{fontWeight:\"bold\",margin:\"5px 0\",padding:\"1px\",borderRadius:\"5px\"}};","map":{"version":3,"names":["React","useState","useContext","useEffect","TextField","Button","ApiContext","Box","Checkbox","FormHelperText","FormControlLabel","Radio","RadioGroup","FormControl","useMode","Title","jsx","_jsx","jsxs","_jsxs","SUPPORTED_LANGUAGES_DICT","en","zh","SUPPORTED_FEATURES","SUPPORTED_LANGUAGES","Object","keys","RegisterModel","ERROR_COLOR","endPoint","_useState","_useState2","_slicedToArray","errorMessage","setErrorMessage","_useState3","_useState4","modelFormat","setModelFormat","_useState5","_useState6","modelSize","setModelSize","_useState7","_useState8","modelUri","setModelUri","_useState9","version","context_length","model_name","model_lang","model_ability","model_description","model_specs","prompt_style","undefined","_useState10","formData","setFormData","_useState11","_useState12","promptStyleLabel","setPromptStyleLabel","_useState13","_useState14","promptStyles","setPromptStyles","errorModelName","test","errorModelDescription","errorContextLength","errorLanguage","length","errorAbility","errorModelSize","some","spec","model_size_in_billions","errorAny","getBuiltInPromptStyles","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","errorData","data","res","key","v","wrap","_callee$","_context","prev","next","fetch","method","headers","sent","ok","json","Error","concat","status","detail","push","stop","apply","arguments","catch","console","error","isModelFormatPytorch","getPathComponents","path","normalizedPath","replace","baseDir","substring","lastIndexOf","filename","handleClick","_ref2","_callee2","_getPathComponents","ps","_callee2$","_context2","model_format","quantizations","model_id","model_file_name_template","model_uri","find","item","name","style_name","system_prompt","roles","intra_message_sep","inter_message_sep","abrupt","body","JSON","stringify","model","persist","t0","message","toggleLanguage","lang","includes","_objectSpread","filter","l","_toConsumableArray","toggleAbility","ability","a","m","children","title","padding","sx","styles","baseFormControl","label","defaultValue","size","helperText","onChange","event","target","value","style","paddingLeft","e","checkboxWrapper","marginLeft","control","parseInt","Number","color","map","marginRight","checked","toLowerCase","p","width","variant","type","onClick","margin","display","flexWrap","maxWidth","labelPaddingLeft","formControlLabelPaddingLeft","buttonBox","fontWeight","borderRadius"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect} from \"react\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { ApiContext } from \"../../components/apiContext\";\nimport {\n Box,\n Checkbox,\n FormHelperText,\n FormControlLabel,\n Radio,\n RadioGroup,\n FormControl,\n} from \"@mui/material\";\nimport { useMode } from \"../../theme\";\nimport Title from \"../../components/Title\";\n\nconst SUPPORTED_LANGUAGES_DICT = { en: \"English\", zh: \"Chinese\" };\nconst SUPPORTED_FEATURES = [\"Generate\", \"Chat\"];\n\n// Convert dictionary of supported languages into list\nconst SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT);\n\nconst RegisterModel = () => {\n const ERROR_COLOR = useMode();\n const endPoint = useContext(ApiContext).endPoint;\n const [errorMessage, setErrorMessage] = useState(\"\");\n const [modelFormat, setModelFormat] = useState(\"pytorch\");\n const [modelSize, setModelSize] = useState(7);\n const [modelUri, setModelUri] = useState(\"/path/to/llama-2\");\n const [formData, setFormData] = useState({\n version: 1,\n context_length: 2048,\n model_name: \"custom-llama-2\",\n model_lang: [\"en\"],\n model_ability: [\"generate\"],\n model_description: \"This is a custom model description.\",\n model_specs: [],\n prompt_style: undefined,\n });\n const [promptStyleLabel, setPromptStyleLabel] = useState(\"vicuna\");\n const [promptStyles, setPromptStyles] = useState([]);\n\n // model name must be\n // 1. Starts with an alphanumeric character (a letter or a digit).\n // 2. Followed by any number of alphanumeric characters, underscores (_), or hyphens (-).\n const errorModelName = !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(\n formData.model_name,\n );\n const errorModelDescription =\n !/^[A-Za-z0-9\\s!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]{0,500}$/.test(\n formData.model_description,\n );\n const errorContextLength = formData.context_length === 0;\n const errorLanguage =\n formData.model_lang === undefined || formData.model_lang.length === 0;\n const errorAbility =\n formData.model_ability === undefined || formData.model_ability.length === 0;\n const errorModelSize =\n formData.model_specs &&\n formData.model_specs.some((spec) => {\n return (\n spec.model_size_in_billions === undefined ||\n spec.model_size_in_billions === 0\n );\n });\n const errorAny =\n errorModelName ||\n errorModelDescription ||\n errorContextLength ||\n errorLanguage ||\n errorAbility ||\n errorModelSize;\n\n useEffect( () => {\n const getBuiltInPromptStyles = async () => {\n const response = await fetch(endPoint + \"/v1/models/prompts\", {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n if (!response.ok) {\n const errorData = await response.json(); // Assuming the server returns error details in JSON format\n throw new Error(\n `Server error: ${response.status} - ${\n errorData.detail || \"Unknown error\"\n }`,\n );\n } else {\n const data = await response.json()\n let res = []\n for (const key in data) {\n let v = data[key]\n v[\"name\"] = key\n res.push(v)\n }\n setPromptStyles(res)\n }\n };\n getBuiltInPromptStyles().catch(console.error);\n });\n\n const isModelFormatPytorch = () => {\n return modelFormat === \"pytorch\";\n };\n\n const getPathComponents = (path) => {\n const normalizedPath = path.replace(/\\\\/g, \"/\");\n const baseDir = normalizedPath.substring(\n 0,\n normalizedPath.lastIndexOf(\"/\"),\n );\n const filename = normalizedPath.substring(\n normalizedPath.lastIndexOf(\"/\") + 1,\n );\n return { baseDir, filename };\n };\n\n const handleClick = async () => {\n if (!isModelFormatPytorch()) {\n const { baseDir, filename } = getPathComponents(modelUri);\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [\"\"],\n model_id: \"\",\n model_file_name_template: filename,\n model_uri: baseDir,\n },\n ];\n } else {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [\"4-bit\", \"8-bit\", \"none\"],\n model_id: \"\",\n model_uri: modelUri,\n },\n ];\n }\n\n const ps = promptStyles.find((item) => item.name === promptStyleLabel);\n formData.prompt_style = {\n style_name: ps.style_name,\n system_prompt: ps.system_prompt,\n roles: ps.roles,\n intra_message_sep: ps.intra_message_sep,\n inter_message_sep: ps.inter_message_sep,\n };\n\n if (errorAny) {\n setErrorMessage(\"Please fill in valid value for all fields\");\n return;\n }\n\n try {\n const response = await fetch(endPoint + \"/v1/model_registrations/LLM\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n model: JSON.stringify(formData),\n persist: true,\n }),\n });\n if (!response.ok) {\n const errorData = await response.json(); // Assuming the server returns error details in JSON format\n throw new Error(\n `Server error: ${response.status} - ${\n errorData.detail || \"Unknown error\"\n }`,\n );\n }\n\n setErrorMessage(\n \"Model has been registered successfully! Navigate to launch model page to proceed.\",\n );\n } catch (error) {\n console.error(\"There was a problem with the fetch operation:\", error);\n setErrorMessage(error.message || \"An unexpected error occurred.\");\n }\n };\n\n const toggleLanguage = (lang) => {\n if (formData.model_lang.includes(lang)) {\n setFormData({\n ...formData,\n model_lang: formData.model_lang.filter((l) => l !== lang),\n });\n } else {\n setFormData({\n ...formData,\n model_lang: [...formData.model_lang, lang],\n });\n }\n };\n\n const toggleAbility = (ability) => {\n if (formData.model_ability.includes(ability)) {\n setFormData({\n ...formData,\n model_ability: formData.model_ability.filter((a) => a !== ability),\n });\n } else {\n setFormData({\n ...formData,\n model_ability: [...formData.model_ability, ability],\n });\n }\n };\n\n return (\n <Box m=\"20px\">\n <Title title=\"Register Model\" />\n <Box padding=\"20px\"></Box>\n\n {/* Base Information */}\n <FormControl sx={styles.baseFormControl}>\n <TextField\n label=\"Model Name\"\n error={errorModelName}\n defaultValue={formData.model_name}\n size=\"small\"\n helperText=\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\"\n onChange={(event) =>\n setFormData({ ...formData, model_name: event.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\n <RadioGroup\n value={modelFormat}\n onChange={(e) => {\n setModelFormat(e.target.value);\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n <Box sx={{ marginLeft: \"10px\" }}>\n <FormControlLabel\n value=\"pytorch\"\n control={<Radio />}\n label=\"PyTorch\"\n />\n </Box>\n <Box sx={{ marginLeft: \"10px\" }}>\n <FormControlLabel\n value=\"ggmlv3\"\n control={<Radio />}\n label=\"GGML\"\n />\n </Box>\n <Box sx={{ marginLeft: \"10px\" }}>\n <FormControlLabel\n value=\"ggufv2\"\n control={<Radio />}\n label=\"GGUF\"\n />\n </Box>\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={errorContextLength}\n label=\"Context Length\"\n value={formData.context_length}\n size=\"small\"\n onChange={(event) => {\n let value = event.target.value;\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, \"\") || \"0\";\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = \"0\";\n }\n // Update with the processed value\n setFormData({\n ...formData,\n context_length: Number(value),\n });\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Size in Billions\"\n size=\"small\"\n error={errorModelSize}\n value={modelSize}\n onChange={(e) => {\n let value = e.target.value;\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, \"\") || \"0\";\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = \"0\";\n }\n setModelSize(Number(value));\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Path\"\n size=\"small\"\n value={modelUri}\n onChange={(e) => {\n setModelUri(e.target.value);\n }}\n helperText=\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Description (Optional)\"\n error={errorModelDescription}\n defaultValue={formData.model_description}\n size=\"small\"\n onChange={(event) =>\n setFormData({ ...formData, model_description: event.target.value })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorLanguage ? ERROR_COLOR : \"inherit\",\n }}\n >\n Model Languages\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_LANGUAGES.map((lang) => (\n <Box key={lang} sx={{ marginRight: \"10px\" }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_lang.includes(lang)}\n onChange={() => toggleLanguage(lang)}\n name={lang}\n sx={\n errorLanguage\n ? {\n color: ERROR_COLOR,\n \"&.Mui-checked\": {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={SUPPORTED_LANGUAGES_DICT[lang]}\n style={{\n paddingLeft: 10,\n color: errorLanguage ? ERROR_COLOR : \"inherit\",\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : \"inherit\",\n }}\n >\n Model Abilities\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_FEATURES.map((ability) => (\n <Box key={ability} sx={{ marginRight: \"10px\" }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_ability.includes(\n ability.toLowerCase(),\n )}\n onChange={() => toggleAbility(ability.toLowerCase())}\n name={ability}\n sx={\n errorAbility\n ? {\n color: ERROR_COLOR,\n \"&.Mui-checked\": {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={ability}\n style={{\n paddingLeft: 10,\n color: errorAbility ? ERROR_COLOR : \"inherit\",\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n {formData.model_ability.includes(\"chat\") && (\n <FormControl sx={styles.baseFormControl}>\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : \"inherit\",\n }}\n >\n Prompt styles\n </label>\n <FormHelperText>\n Select a prompt style that aligns with the training data of your\n model.\n </FormHelperText>\n <RadioGroup\n value={promptStyleLabel}\n onChange={(e) => {\n setPromptStyleLabel(e.target.value);\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n {promptStyles.map((p) => (\n <Box sx={{ marginLeft: \"10px\" }}>\n <FormControlLabel\n value={p.name}\n control={<Radio />}\n label={p.name}\n />\n </Box>\n ))}\n </Box>\n </RadioGroup>\n </FormControl>\n )}\n\n <Box width={\"100%\"}>\n <div style={{ ...styles.error, color: ERROR_COLOR }}>\n {errorMessage}\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleClick}\n >\n Register Model\n </Button>\n </Box>\n </Box>\n );\n};\n\nexport default RegisterModel;\n\nconst styles = {\n baseFormControl: {\n width: \"100%\",\n margin: \"normal\",\n size: \"small\",\n },\n checkboxWrapper: {\n display: \"flex\",\n flexWrap: \"wrap\",\n maxWidth: \"80%\",\n },\n labelPaddingLeft: {\n paddingLeft: 5,\n },\n formControlLabelPaddingLeft: {\n paddingLeft: 10,\n },\n buttonBox: {\n width: \"100%\",\n margin: \"20px\",\n },\n error: {\n fontWeight: \"bold\",\n margin: \"5px 0\",\n padding: \"1px\",\n borderRadius: \"5px\",\n },\n};\n"],"mappings":"wtBAAA,MAAO,CAAAA,KAAK,EAAGC,QAAQ,CAAEC,UAAU,CAAEC,SAAS,KAAO,OAAO,CAC5D,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,MAAM,KAAM,sBAAsB,CACzC,OAASC,UAAU,KAAQ,6BAA6B,CACxD,OACEC,GAAG,CACHC,QAAQ,CACRC,cAAc,CACdC,gBAAgB,CAChBC,KAAK,CACLC,UAAU,CACVC,WAAW,KACN,eAAe,CACtB,OAASC,OAAO,KAAQ,aAAa,CACrC,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAE3C,GAAM,CAAAC,wBAAwB,CAAG,CAAEC,EAAE,CAAE,SAAS,CAAEC,EAAE,CAAE,SAAU,CAAC,CACjE,GAAM,CAAAC,kBAAkB,CAAG,CAAC,UAAU,CAAE,MAAM,CAAC,CAE/C;AACA,GAAM,CAAAC,mBAAmB,CAAGC,MAAM,CAACC,IAAI,CAACN,wBAAwB,CAAC,CAEjE,GAAM,CAAAO,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAS,CAC1B,GAAM,CAAAC,WAAW,CAAGd,OAAO,CAAC,CAAC,CAC7B,GAAM,CAAAe,QAAQ,CAAG3B,UAAU,CAACI,UAAU,CAAC,CAACuB,QAAQ,CAChD,IAAAC,SAAA,CAAwC7B,QAAQ,CAAC,EAAE,CAAC,CAAA8B,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAA7CG,YAAY,CAAAF,UAAA,IAAEG,eAAe,CAAAH,UAAA,IACpC,IAAAI,UAAA,C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K,CAAE,MAAO,CAAA5B,QAAA,eACjBjJ,IAAA,QAAK+J,KAAK,CAAAtB,aAAA,CAAAA,aAAA,IAAOY,MAAM,CAACrD,KAAK,MAAEuE,KAAK,CAAE5J,WAAW,EAAG,CAAAsI,QAAA,CACjDjI,YAAY,CACV,CAAC,cACNhB,IAAA,CAACZ,MAAM,EACL0L,OAAO,CAAC,WAAW,CACnBP,KAAK,CAAC,SAAS,CACfQ,IAAI,CAAC,QAAQ,CACbC,OAAO,CAAEtE,WAAY,CAAAuC,QAAA,CACtB,gBAED,CAAQ,CAAC,EACN,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAvI,aAAa,CAE5B,GAAM,CAAA2I,MAAM,CAAG,CACbC,eAAe,CAAE,CACfuB,KAAK,CAAE,MAAM,CACbI,MAAM,CAAE,QAAQ,CAChBxB,IAAI,CAAE,OACR,CAAC,CACDS,eAAe,CAAE,CACfgB,OAAO,CAAE,MAAM,CACfC,QAAQ,CAAE,MAAM,CAChBC,QAAQ,CAAE,KACZ,CAAC,CACDC,gBAAgB,CAAE,CAChBrB,WAAW,CAAE,CACf,CAAC,CACDsB,2BAA2B,CAAE,CAC3BtB,WAAW,CAAE,EACf,CAAC,CACDuB,SAAS,CAAE,CACTV,KAAK,CAAE,MAAM,CACbI,MAAM,CAAE,MACV,CAAC,CACDjF,KAAK,CAAE,CACLwF,UAAU,CAAE,MAAM,CAClBP,MAAM,CAAE,OAAO,CACf9B,OAAO,CAAE,KAAK,CACdsC,YAAY,CAAE,KAChB,CACF,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React from\"react\";import Title from\"../../components/Title\";import LaunchLLM from\"./launchLLM\";import LaunchEmbedding from\"./launchEmbedding\";import{Box,Tab}from\"@mui/material\";import{TabContext,TabList,TabPanel}from\"@mui/lab\";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(\"1\"),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Launch Model\"}),/*#__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:\"Language Models\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"2\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"1\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchLLM,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchEmbedding,{})})]})]});};export default LaunchModel;","map":{"version":3,"names":["React","Title","LaunchLLM","LaunchEmbedding","Box","Tab","TabContext","TabList","TabPanel","jsx","_jsx","jsxs","_jsxs","LaunchModel","_React$useState","useState","_React$useState2","_slicedToArray","value","setValue","handleTabChange","event","newValue","m","children","title","sx","borderBottom","borderColor","onChange","label","padding"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/index.js"],"sourcesContent":["import React from \"react\";\nimport Title from \"../../components/Title\";\nimport LaunchLLM from \"./launchLLM\";\nimport LaunchEmbedding from \"./launchEmbedding\";\nimport { Box, Tab } from \"@mui/material\";\nimport { TabContext, TabList, TabPanel } from \"@mui/lab\";\n\nconst LaunchModel = () => {\n const [value, setValue] = React.useState(\"1\");\n\n const handleTabChange = (event, newValue) => {\n setValue(newValue);\n };\n\n return (\n <Box m=\"20px\">\n <Title title=\"Launch Model\" />\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: \"divider\" }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label=\"Language Models\" value=\"1\" />\n <Tab label=\"Embedding Models\" value=\"2\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <LaunchLLM />\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <LaunchEmbedding />\n </TabPanel>\n </TabContext>\n </Box>\n );\n};\n\nexport default LaunchModel;\n"],"mappings":"6IAAA,MAAO,CAAAA,KAAK,KAAM,OAAO,CACzB,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,MAAO,CAAAC,SAAS,KAAM,aAAa,CACnC,MAAO,CAAAC,eAAe,KAAM,mBAAmB,CAC/C,OAASC,GAAG,CAAEC,GAAG,KAAQ,eAAe,CACxC,OAASC,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEzD,GAAM,CAAAC,WAAW,CAAG,QAAd,CAAAA,WAAWA,CAAA,CAAS,CACxB,IAAAC,eAAA,CAA0Bd,KAAK,CAACe,QAAQ,CAAC,GAAG,CAAC,CAAAC,gBAAA,CAAAC,cAAA,CAAAH,eAAA,IAAtCI,KAAK,CAAAF,gBAAA,IAAEG,QAAQ,CAAAH,gBAAA,IAEtB,GAAM,CAAAI,eAAe,CAAG,QAAlB,CAAAA,eAAeA,CAAIC,KAAK,CAAEC,QAAQ,CAAK,CAC3CH,QAAQ,CAACG,QAAQ,CAAC,CACpB,CAAC,CAED,mBACEV,KAAA,CAACR,GAAG,EAACmB,CAAC,CAAC,MAAM,CAAAC,QAAA,eACXd,IAAA,CAACT,KAAK,EAACwB,KAAK,CAAC,cAAc,CAAE,CAAC,cAC9Bb,KAAA,CAACN,UAAU,EAACY,KAAK,CAAEA,KAAM,CAAAM,QAAA,eACvBd,IAAA,CAACN,GAAG,EAACsB,EAAE,CAAE,CAAEC,YAAY,CAAE,CAAC,CAAEC,WAAW,CAAE,SAAU,CAAE,CAAAJ,QAAA,cACnDZ,KAAA,CAACL,OAAO,EAACW,KAAK,CAAEA,KAAM,CAACW,QAAQ,CAAET,eAAgB,CAAC,aAAW,MAAM,CAAAI,QAAA,eACjEd,IAAA,CAACL,GAAG,EAACyB,KAAK,CAAC,iBAAiB,CAACZ,KAAK,CAAC,GAAG,CAAE,CAAC,cACzCR,IAAA,CAACL,GAAG,EAACyB,KAAK,CAAC,kBAAkB,CAACZ,KAAK,CAAC,GAAG,CAAE,CAAC,EACnC,CAAC,CACP,CAAC,cACNR,IAAA,CAACF,QAAQ,EAACU,KAAK,CAAC,GAAG,CAACQ,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACrCd,IAAA,CAACR,SAAS,GAAE,CAAC,CACL,CAAC,cACXQ,IAAA,CAACF,QAAQ,EAACU,KAAK,CAAC,GAAG,CAACQ,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACrCd,IAAA,CAACP,eAAe,GAAE,CAAC,CACX,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAU,WAAW"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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 React,{useEffect,useState,useContext}from\"react\";import{Box,Stack,Typography}from\"@mui/material\";import{ApiContext}from\"../../components/apiContext\";import{DataGrid}from\"@mui/x-data-grid\";import Title from\"../../components/Title\";import OpenInBrowserOutlinedIcon from\"@mui/icons-material/OpenInBrowserOutlined\";import DeleteOutlineOutlinedIcon from\"@mui/icons-material/DeleteOutlineOutlined\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var RunningModels=function RunningModels(){var _useState=useState([]),_useState2=_slicedToArray(_useState,2),llmData=_useState2[0],setLlmData=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),embeddingModelData=_useState4[0],setEmbeddingModelData=_useState4[1];var _useState5=useState([]),_useState6=_slicedToArray(_useState5,2),imageModelData=_useState6[0],setImageModelData=_useState6[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel,setIsUpdatingModel=_useContext2.setIsUpdatingModel;var endPoint=useContext(ApiContext).endPoint;var update=function update(isCallingApi){if(isCallingApi){setLlmData([{id:\"Loading, do not refresh page...\",url:\"IS_LOADING\"}]);setEmbeddingModelData([{id:\"Loading, do not refresh page...\",url:\"IS_LOADING\"}]);setImageModelData([{id:\"Loading, do not refresh page...\",url:\"IS_LOADING\"}]);}else{setIsUpdatingModel(true);fetch(\"\".concat(endPoint,\"/v1/models/\"),{method:\"GET\"}).then(function(response){return response.json();}).then(function(data){var newLlmData=[];var newEmbeddingModelData=[];var newImageModelData=[];Object.entries(data).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];var newValue=_objectSpread(_objectSpread({},value),{},{id:key,url:key});if(newValue.model_type===\"LLM\"){newLlmData.push(newValue);}else if(newValue.model_type===\"embedding\"){newEmbeddingModelData.push(newValue);}else if(newValue.model_type===\"image\"){newImageModelData.push(newValue);}});setLlmData(newLlmData);setEmbeddingModelData(newEmbeddingModelData);setImageModelData(newImageModelData);setIsUpdatingModel(false);}).catch(function(error){console.error(\"Error:\",error);setIsUpdatingModel(false);});}};useEffect(function(){update(isCallingApi);// eslint-disable-next-line\n},[isCallingApi]);var llmColumns=[{field:\"id\",headerName:\"ID\",flex:1,minWidth:250},{field:\"model_name\",headerName:\"Name\",flex:1},{field:\"address\",headerName:\"Address\",flex:1},{field:\"accelerators\",headerName:\"GPU Indexes\",flex:1},{field:\"model_size_in_billions\",headerName:\"Size\",flex:1},{field:\"quantization\",headerName:\"Quantization\",flex:1},{field:\"url\",headerName:\"Actions\",flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref3){var row=_ref3.row;var url=row.url;var openUrl=\"\".concat(endPoint,\"/\")+url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;var gradioUrl=\"\".concat(endPoint,\"/v1/ui/\")+url;if(url===\"IS_LOADING\"){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsxs(Box,{style:{width:\"100%\",display:\"flex\",justifyContent:\"left\",alignItems:\"left\"},children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch Web UI\",style:{borderWidth:\"0px\",backgroundColor:\"transparent\",paddingLeft:\"0px\",paddingRight:\"10px\"},onClick:function onClick(){if(isCallingApi||isUpdatingModel){// Make sure no ongoing call\nreturn;}setIsCallingApi(true);fetch(openUrl,{method:\"HEAD\"}).then(function(response){if(response.status===404){// If web UI doesn't exist (404 Not Found)\nconsole.log(\"UI does not exist, creating new...\");return fetch(gradioUrl,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({model_type:row.model_type,model_name:row.model_name,model_size_in_billions:row.model_size_in_billions,model_format:row.model_format,quantization:row.quantization,context_length:row.context_length,model_ability:row.model_ability,model_description:row.model_description,model_lang:row.model_lang})}).then(function(response){return response.json();}).then(function(){return window.open(openUrl,\"_blank\",\"noopener noreferrer\");}).finally(function(){return setIsCallingApi(false);});}else if(response.ok){// If web UI does exist\nconsole.log(\"UI exists, opening...\");window.open(openUrl,\"_blank\",\"noopener noreferrer\");setIsCallingApi(false);}else{// Other HTTP errors\nconsole.error(\"Unexpected response status: \".concat(response.status));setIsCallingApi(false);}}).catch(function(error){console.error(\"Error:\",error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:\"1px solid #e5e7eb\",borderWidth:\"1px\",borderColor:\"#e5e7eb\"},children:/*#__PURE__*/_jsx(OpenInBrowserOutlinedIcon,{})})}),/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:\"0px\",backgroundColor:\"transparent\",paddingLeft:\"0px\",paddingRight:\"10px\"},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetch(closeUrl,{method:\"DELETE\"}).then(function(response){response.json();}).then(function(data){setIsCallingApi(false);}).catch(function(error){console.error(\"Error:\",error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:\"1px solid #e5e7eb\",borderWidth:\"1px\",borderColor:\"#e5e7eb\"},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})]});}}];var embeddingModelColumns=[{field:\"id\",headerName:\"ID\",flex:1,minWidth:250},{field:\"model_name\",headerName:\"Name\",flex:1},{field:\"address\",headerName:\"Address\",flex:1},{field:\"accelerators\",headerName:\"GPU Indexes\",flex:1},{field:\"url\",headerName:\"Actions\",flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref4){var row=_ref4.row;var url=row.url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;if(url===\"IS_LOADING\"){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsx(Box,{style:{width:\"100%\",display:\"flex\",justifyContent:\"left\",alignItems:\"left\"},children:/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:\"0px\",backgroundColor:\"transparent\",paddingLeft:\"0px\",paddingRight:\"10px\"},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetch(closeUrl,{method:\"DELETE\"}).then(function(response){response.json();}).then(function(data){setIsCallingApi(false);}).catch(function(error){console.error(\"Error:\",error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:\"1px solid #e5e7eb\",borderWidth:\"1px\",borderColor:\"#e5e7eb\"},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})});}}];var imageModelColumns=embeddingModelColumns;return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Running Models\"}),/*#__PURE__*/_jsxs(Box,{m:\"40px 0 0 0\",height:\"30vh\",children:[/*#__PURE__*/_jsx(Typography,{variant:\"h5\",gutterBottom:true,children:\"Language Models\"}),/*#__PURE__*/_jsx(DataGrid,{rows:llmData,columns:llmColumns,sx:{\"& .MuiDataGrid-main\":{width:\"95% !important\",overflow:\"visible\"},\"& .MuiDataGrid-row\":{background:\"white\",margin:\"10px 0px\"},\"& .MuiDataGrid-cell\":{borderBottom:\"none\"},\"& .CustomWide-cell\":{minWidth:\"250px !important\"},\"& .MuiDataGrid-columnHeaders\":{borderBottom:\"none\"},\"& .MuiDataGrid-columnHeaderTitle\":{fontWeight:\"bold\"},\"& .MuiDataGrid-virtualScroller\":{overflowX:\"visible !important\",overflow:\"visible\"},\"& .MuiDataGrid-footerContainer\":{borderTop:\"none\"},\"border-width\":\"0px\"},slots:{noRowsOverlay:function noRowsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models\"});},noResultsOverlay:function noResultsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models Matches\"});}}})]}),/*#__PURE__*/_jsxs(Box,{m:\"40px 0 0 0\",height:\"30vh\",children:[/*#__PURE__*/_jsx(Typography,{variant:\"h5\",gutterBottom:true,children:\"Embedding models\"}),/*#__PURE__*/_jsx(DataGrid,{rows:embeddingModelData,columns:embeddingModelColumns,sx:{\"& .MuiDataGrid-main\":{width:\"95% !important\",overflow:\"visible\"},\"& .MuiDataGrid-row\":{background:\"white\",margin:\"10px 0px\"},\"& .MuiDataGrid-cell\":{borderBottom:\"none\"},\"& .CustomWide-cell\":{minWidth:\"250px !important\"},\"& .MuiDataGrid-columnHeaders\":{borderBottom:\"none\"},\"& .MuiDataGrid-columnHeaderTitle\":{fontWeight:\"bold\"},\"& .MuiDataGrid-virtualScroller\":{overflowX:\"visible !important\",overflow:\"visible\"},\"& .MuiDataGrid-footerContainer\":{borderTop:\"none\"},\"border-width\":\"0px\"},slots:{noRowsOverlay:function noRowsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models\"});},noResultsOverlay:function noResultsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models Matches\"});}}})]}),/*#__PURE__*/_jsxs(Box,{m:\"40px 0 0 0\",height:\"30vh\",children:[/*#__PURE__*/_jsx(Typography,{variant:\"h5\",gutterBottom:true,children:\"Image models\"}),/*#__PURE__*/_jsx(DataGrid,{rows:imageModelData,columns:imageModelColumns,sx:{\"& .MuiDataGrid-main\":{width:\"95% !important\",overflow:\"visible\"},\"& .MuiDataGrid-row\":{background:\"white\",margin:\"10px 0px\"},\"& .MuiDataGrid-cell\":{borderBottom:\"none\"},\"& .CustomWide-cell\":{minWidth:\"250px !important\"},\"& .MuiDataGrid-columnHeaders\":{borderBottom:\"none\"},\"& .MuiDataGrid-columnHeaderTitle\":{fontWeight:\"bold\"},\"& .MuiDataGrid-virtualScroller\":{overflowX:\"visible !important\",overflow:\"visible\"},\"& .MuiDataGrid-footerContainer\":{borderTop:\"none\"},\"border-width\":\"0px\"},slots:{noRowsOverlay:function noRowsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models\"});},noResultsOverlay:function noResultsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models Matches\"});}}})]})]});};export default RunningModels;","map":{"version":3,"names":["React","useEffect","useState","useContext","Box","Stack","Typography","ApiContext","DataGrid","Title","OpenInBrowserOutlinedIcon","DeleteOutlineOutlinedIcon","jsx","_jsx","jsxs","_jsxs","RunningModels","_useState","_useState2","_slicedToArray","llmData","setLlmData","_useState3","_useState4","embeddingModelData","setEmbeddingModelData","_useState5","_useState6","imageModelData","setImageModelData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","setIsUpdatingModel","endPoint","update","id","url","fetch","concat","method","then","response","json","data","newLlmData","newEmbeddingModelData","newImageModelData","Object","entries","forEach","_ref","_ref2","key","value","newValue","_objectSpread","model_type","push","catch","error","console","llmColumns","field","headerName","flex","minWidth","sortable","filterable","disableColumnMenu","renderCell","_ref3","row","openUrl","closeUrl","gradioUrl","style","width","display","justifyContent","alignItems","children","title","borderWidth","backgroundColor","paddingLeft","paddingRight","onClick","status","log","headers","body","JSON","stringify","model_name","model_size_in_billions","model_format","quantization","context_length","model_ability","model_description","model_lang","window","open","finally","ok","m","p","borderRadius","border","borderColor","embeddingModelColumns","_ref4","imageModelColumns","height","variant","gutterBottom","rows","columns","sx","overflow","background","margin","borderBottom","fontWeight","overflowX","borderTop","slots","noRowsOverlay","noResultsOverlay"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/running_models/index.js"],"sourcesContent":["import React, { useEffect, useState, useContext } from \"react\";\nimport { Box, Stack, Typography } from \"@mui/material\";\nimport { ApiContext } from \"../../components/apiContext\";\nimport { DataGrid } from \"@mui/x-data-grid\";\nimport Title from \"../../components/Title\";\nimport OpenInBrowserOutlinedIcon from \"@mui/icons-material/OpenInBrowserOutlined\";\nimport DeleteOutlineOutlinedIcon from \"@mui/icons-material/DeleteOutlineOutlined\";\n\nconst RunningModels = () => {\n const [llmData, setLlmData] = useState([]);\n const [embeddingModelData, setEmbeddingModelData] = useState([]);\n const [imageModelData, setImageModelData] = useState([]);\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext);\n const { isUpdatingModel, setIsUpdatingModel } = useContext(ApiContext);\n const endPoint = useContext(ApiContext).endPoint;\n\n const update = (isCallingApi) => {\n if (isCallingApi) {\n setLlmData([\n { id: \"Loading, do not refresh page...\", url: \"IS_LOADING\" },\n ]);\n setEmbeddingModelData([\n { id: \"Loading, do not refresh page...\", url: \"IS_LOADING\" },\n ]);\n setImageModelData([\n { id: \"Loading, do not refresh page...\", url: \"IS_LOADING\" },\n ]);\n } else {\n setIsUpdatingModel(true);\n fetch(`${endPoint}/v1/models/`, {\n method: \"GET\",\n })\n .then((response) => response.json())\n .then((data) => {\n const newLlmData = [];\n const newEmbeddingModelData = [];\n const newImageModelData = [];\n Object.entries(data).forEach(([key, value]) => {\n let newValue = {\n ...value,\n id: key,\n url: key,\n };\n if (newValue.model_type === \"LLM\") {\n newLlmData.push(newValue);\n } else if (newValue.model_type === \"embedding\") {\n newEmbeddingModelData.push(newValue);\n } else if (newValue.model_type === \"image\") {\n newImageModelData.push(newValue);\n }\n });\n setLlmData(newLlmData);\n setEmbeddingModelData(newEmbeddingModelData);\n setImageModelData(newImageModelData);\n setIsUpdatingModel(false);\n })\n .catch((error) => {\n console.error(\"Error:\", error);\n setIsUpdatingModel(false);\n });\n }\n };\n\n useEffect(() => {\n update(isCallingApi);\n // eslint-disable-next-line\n }, [isCallingApi]);\n\n const llmColumns = [\n {\n field: \"id\",\n headerName: \"ID\",\n flex: 1,\n minWidth: 250,\n },\n {\n field: \"model_name\",\n headerName: \"Name\",\n flex: 1,\n },\n {\n field: \"address\",\n headerName: \"Address\",\n flex: 1,\n },\n {\n field: \"accelerators\",\n headerName: \"GPU Indexes\",\n flex: 1,\n },\n {\n field: \"model_size_in_billions\",\n headerName: \"Size\",\n flex: 1,\n },\n {\n field: \"quantization\",\n headerName: \"Quantization\",\n flex: 1,\n },\n {\n field: \"url\",\n headerName: \"Actions\",\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url;\n const openUrl = `${endPoint}/` + url;\n const closeUrl = `${endPoint}/v1/models/` + url;\n const gradioUrl = `${endPoint}/v1/ui/` + url;\n\n if (url === \"IS_LOADING\") {\n return <div></div>;\n }\n\n return (\n <Box\n style={{\n width: \"100%\",\n display: \"flex\",\n justifyContent: \"left\",\n alignItems: \"left\",\n }}\n >\n <button\n title=\"Launch Web UI\"\n style={{\n borderWidth: \"0px\",\n backgroundColor: \"transparent\",\n paddingLeft: \"0px\",\n paddingRight: \"10px\",\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n // Make sure no ongoing call\n return;\n }\n\n setIsCallingApi(true);\n\n fetch(openUrl, {\n method: \"HEAD\",\n })\n .then((response) => {\n if (response.status === 404) {\n // If web UI doesn't exist (404 Not Found)\n console.log(\"UI does not exist, creating new...\");\n return fetch(gradioUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n model_type: row.model_type,\n model_name: row.model_name,\n model_size_in_billions: row.model_size_in_billions,\n model_format: row.model_format,\n quantization: row.quantization,\n context_length: row.context_length,\n model_ability: row.model_ability,\n model_description: row.model_description,\n model_lang: row.model_lang,\n }),\n })\n .then((response) => response.json())\n .then(() =>\n window.open(openUrl, \"_blank\", \"noopener noreferrer\"),\n )\n .finally(() => setIsCallingApi(false));\n } else if (response.ok) {\n // If web UI does exist\n console.log(\"UI exists, opening...\");\n window.open(openUrl, \"_blank\", \"noopener noreferrer\");\n setIsCallingApi(false);\n } else {\n // Other HTTP errors\n console.error(\n `Unexpected response status: ${response.status}`,\n );\n setIsCallingApi(false);\n }\n })\n .catch((error) => {\n console.error(\"Error:\", error);\n setIsCallingApi(false);\n });\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: \"1px solid #e5e7eb\",\n borderWidth: \"1px\",\n borderColor: \"#e5e7eb\",\n }}\n >\n <OpenInBrowserOutlinedIcon />\n </Box>\n </button>\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: \"0px\",\n backgroundColor: \"transparent\",\n paddingLeft: \"0px\",\n paddingRight: \"10px\",\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return;\n }\n setIsCallingApi(true);\n fetch(closeUrl, {\n method: \"DELETE\",\n })\n .then((response) => {\n response.json();\n })\n .then((data) => {\n setIsCallingApi(false);\n })\n .catch((error) => {\n console.error(\"Error:\", error);\n setIsCallingApi(false);\n });\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: \"1px solid #e5e7eb\",\n borderWidth: \"1px\",\n borderColor: \"#e5e7eb\",\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n );\n },\n },\n ];\n\n const embeddingModelColumns = [\n {\n field: \"id\",\n headerName: \"ID\",\n flex: 1,\n minWidth: 250,\n },\n {\n field: \"model_name\",\n headerName: \"Name\",\n flex: 1,\n },\n {\n field: \"address\",\n headerName: \"Address\",\n flex: 1,\n },\n {\n field: \"accelerators\",\n headerName: \"GPU Indexes\",\n flex: 1,\n },\n {\n field: \"url\",\n headerName: \"Actions\",\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url;\n const closeUrl = `${endPoint}/v1/models/` + url;\n\n if (url === \"IS_LOADING\") {\n return <div></div>;\n }\n\n return (\n <Box\n style={{\n width: \"100%\",\n display: \"flex\",\n justifyContent: \"left\",\n alignItems: \"left\",\n }}\n >\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: \"0px\",\n backgroundColor: \"transparent\",\n paddingLeft: \"0px\",\n paddingRight: \"10px\",\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return;\n }\n setIsCallingApi(true);\n fetch(closeUrl, {\n method: \"DELETE\",\n })\n .then((response) => {\n response.json();\n })\n .then((data) => {\n setIsCallingApi(false);\n })\n .catch((error) => {\n console.error(\"Error:\", error);\n setIsCallingApi(false);\n });\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: \"1px solid #e5e7eb\",\n borderWidth: \"1px\",\n borderColor: \"#e5e7eb\",\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n );\n },\n },\n ];\n\n const imageModelColumns = embeddingModelColumns;\n\n return (\n <Box m=\"20px\">\n <Title title=\"Running Models\" />\n <Box m=\"40px 0 0 0\" height=\"30vh\">\n <Typography variant=\"h5\" gutterBottom>\n Language Models\n </Typography>\n <DataGrid\n rows={llmData}\n columns={llmColumns}\n sx={{\n \"& .MuiDataGrid-main\": {\n width: \"95% !important\",\n overflow: \"visible\",\n },\n \"& .MuiDataGrid-row\": {\n background: \"white\",\n margin: \"10px 0px\",\n },\n \"& .MuiDataGrid-cell\": {\n borderBottom: \"none\",\n },\n \"& .CustomWide-cell\": {\n minWidth: \"250px !important\",\n },\n \"& .MuiDataGrid-columnHeaders\": {\n borderBottom: \"none\",\n },\n \"& .MuiDataGrid-columnHeaderTitle\": {\n fontWeight: \"bold\",\n },\n \"& .MuiDataGrid-virtualScroller\": {\n overflowX: \"visible !important\",\n overflow: \"visible\",\n },\n \"& .MuiDataGrid-footerContainer\": {\n borderTop: \"none\",\n },\n \"border-width\": \"0px\",\n }}\n slots={{\n noRowsOverlay: () => (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models\n </Stack>\n ),\n noResultsOverlay: () => (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models Matches\n </Stack>\n ),\n }}\n />\n </Box>\n <Box m=\"40px 0 0 0\" height=\"30vh\">\n <Typography variant=\"h5\" gutterBottom>\n Embedding models\n </Typography>\n <DataGrid\n rows={embeddingModelData}\n columns={embeddingModelColumns}\n sx={{\n \"& .MuiDataGrid-main\": {\n width: \"95% !important\",\n overflow: \"visible\",\n },\n \"& .MuiDataGrid-row\": {\n background: \"white\",\n margin: \"10px 0px\",\n },\n \"& .MuiDataGrid-cell\": {\n borderBottom: \"none\",\n },\n \"& .CustomWide-cell\": {\n minWidth: \"250px !important\",\n },\n \"& .MuiDataGrid-columnHeaders\": {\n borderBottom: \"none\",\n },\n \"& .MuiDataGrid-columnHeaderTitle\": {\n fontWeight: \"bold\",\n },\n \"& .MuiDataGrid-virtualScroller\": {\n overflowX: \"visible !important\",\n overflow: \"visible\",\n },\n \"& .MuiDataGrid-footerContainer\": {\n borderTop: \"none\",\n },\n \"border-width\": \"0px\",\n }}\n slots={{\n noRowsOverlay: () => (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models\n </Stack>\n ),\n noResultsOverlay: () => (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models Matches\n </Stack>\n ),\n }}\n />\n </Box>\n <Box m=\"40px 0 0 0\" height=\"30vh\">\n <Typography variant=\"h5\" gutterBottom>\n Image models\n </Typography>\n <DataGrid\n rows={imageModelData}\n columns={imageModelColumns}\n sx={{\n \"& .MuiDataGrid-main\": {\n width: \"95% !important\",\n overflow: \"visible\",\n },\n \"& .MuiDataGrid-row\": {\n background: \"white\",\n margin: \"10px 0px\",\n },\n \"& .MuiDataGrid-cell\": {\n borderBottom: \"none\",\n },\n \"& .CustomWide-cell\": {\n minWidth: \"250px !important\",\n },\n \"& .MuiDataGrid-columnHeaders\": {\n borderBottom: \"none\",\n },\n \"& .MuiDataGrid-columnHeaderTitle\": {\n fontWeight: \"bold\",\n },\n \"& .MuiDataGrid-virtualScroller\": {\n overflowX: \"visible !important\",\n overflow: \"visible\",\n },\n \"& .MuiDataGrid-footerContainer\": {\n borderTop: \"none\",\n },\n \"border-width\": \"0px\",\n }}\n slots={{\n noRowsOverlay: () => (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models\n </Stack>\n ),\n noResultsOverlay: () => (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models Matches\n </Stack>\n ),\n }}\n />\n </Box>\n </Box>\n );\n};\n\nexport default RunningModels;\n"],"mappings":"yRAAA,MAAO,CAAAA,KAAK,EAAIC,SAAS,CAAEC,QAAQ,CAAEC,UAAU,KAAQ,OAAO,CAC9D,OAASC,GAAG,CAAEC,KAAK,CAAEC,UAAU,KAAQ,eAAe,CACtD,OAASC,UAAU,KAAQ,6BAA6B,CACxD,OAASC,QAAQ,KAAQ,kBAAkB,CAC3C,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,MAAO,CAAAC,yBAAyB,KAAM,2CAA2C,CACjF,MAAO,CAAAC,yBAAyB,KAAM,2CAA2C,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAElF,GAAM,CAAAC,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAS,CAC1B,IAAAC,SAAA,CAA8Bf,QAAQ,CAAC,EAAE,CAAC,CAAAgB,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAAnCG,OAAO,CAAAF,UAAA,IAAEG,UAAU,CAAAH,UAAA,IAC1B,IAAAI,UAAA,CAAoDpB,QAAQ,CAAC,EAAE,CAAC,CAAAqB,UAAA,CAAAJ,cAAA,CAAAG,UAAA,IAAzDE,kBAAkB,CAAAD,UAAA,IAAEE,qBAAqB,CAAAF,UAAA,IAChD,IAAAG,UA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ACV,CAAC,CACD,qBAAqB,CAAE,CACrBC,YAAY,CAAE,MAChB,CAAC,CACD,oBAAoB,CAAE,CACpBzD,QAAQ,CAAE,kBACZ,CAAC,CACD,8BAA8B,CAAE,CAC9ByD,YAAY,CAAE,MAChB,CAAC,CACD,kCAAkC,CAAE,CAClCC,UAAU,CAAE,MACd,CAAC,CACD,gCAAgC,CAAE,CAChCC,SAAS,CAAE,oBAAoB,CAC/BL,QAAQ,CAAE,SACZ,CAAC,CACD,gCAAgC,CAAE,CAChCM,SAAS,CAAE,MACb,CAAC,CACD,cAAc,CAAE,KAClB,CAAE,CACFC,KAAK,CAAE,CACLC,aAAa,CAAE,SAAAA,cAAA,qBACbrH,IAAA,CAACR,KAAK,EAAC+G,MAAM,CAAC,MAAM,CAAClC,UAAU,CAAC,QAAQ,CAACD,cAAc,CAAC,QAAQ,CAAAE,QAAA,CAAC,mBAEjE,CAAO,CAAC,EACT,CACDgD,gBAAgB,CAAE,SAAAA,iBAAA,qBAChBtH,IAAA,CAACR,KAAK,EAAC+G,MAAM,CAAC,MAAM,CAAClC,UAAU,CAAC,QAAQ,CAACD,cAAc,CAAC,QAAQ,CAAAE,QAAA,CAAC,2BAEjE,CAAO,CAAC,EAEZ,CAAE,CACH,CAAC,EACC,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAnE,aAAa"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"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 React,{useState,useContext,useEffect}from\"react\";import{v1 as uuidv1}from\"uuid\";import{ApiContext}from\"../../components/apiContext\";import{FormControl,InputLabel,Select,MenuItem,Box,Chip}from\"@mui/material\";import{CircularProgress}from\"@mui/material\";import{ChatOutlined,EditNoteOutlined,HelpCenterOutlined,UndoOutlined,RocketLaunchOutlined}from\"@mui/icons-material\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var CARD_HEIGHT=350;var CARD_WIDTH=270;var ModelCard=function ModelCard(_ref){var url=_ref.url,modelData=_ref.modelData;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hover=_useState2[0],setHover=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),selected=_useState4[0],setSelected=_useState4[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;// Model parameter selections\nvar _useState5=useState(\"\"),_useState6=_slicedToArray(_useState5,2),modelFormat=_useState6[0],setModelFormat=_useState6[1];var _useState7=useState(\"\"),_useState8=_slicedToArray(_useState7,2),modelSize=_useState8[0],setModelSize=_useState8[1];var _useState9=useState(\"\"),_useState10=_slicedToArray(_useState9,2),quantization=_useState10[0],setQuantization=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),formatOptions=_useState12[0],setFormatOptions=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),sizeOptions=_useState14[0],setSizeOptions=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),quantizationOptions=_useState16[0],setQuantizationOptions=_useState16[1];var isCached=function isCached(spec){if(spec.model_format===\"pytorch\"){return spec.cache_status&&spec.cache_status===true;}else{return spec.cache_status&&spec.cache_status.some(function(cs){return cs;});}};// UseEffects for parameter selection, change options based on previous selections\nuseEffect(function(){if(modelData){var modelFamily=modelData.model_specs;var formats=_toConsumableArray(new Set(modelFamily.map(function(spec){return spec.model_format;})));setFormatOptions(formats);}},[modelData]);useEffect(function(){if(modelFormat&&modelData){var modelFamily=modelData.model_specs;var sizes=_toConsumableArray(new Set(modelFamily.filter(function(spec){return spec.model_format===modelFormat;}).map(function(spec){return spec.model_size_in_billions;})));setSizeOptions(sizes);}},[modelFormat,modelData]);useEffect(function(){if(modelFormat&&modelSize&&modelData){var modelFamily=modelData.model_specs;var quants=_toConsumableArray(new Set(modelFamily.filter(function(spec){return spec.model_format===modelFormat&&spec.model_size_in_billions===parseFloat(modelSize);}).flatMap(function(spec){return spec.quantizations;})));setQuantizationOptions(quants);}},[modelFormat,modelSize,modelData]);var launchModel=function launchModel(url){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);var uuid=uuidv1();var modelDataWithID={model_uid:uuid,model_name:modelData.model_name,model_format:modelFormat,model_size_in_billions:modelSize,quantization:quantization};// First fetch request to initiate the model\nfetch(url+\"/v1/models\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(modelDataWithID)}).then(function(response){if(!response.ok){// Assuming the server returns error details in JSON format\nreturn response.json().then(function(errorData){throw new Error(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||\"Unknown error\"));});}return response.json();// Also return the promise from response.json() for successful responses\n}).then(function(){window.open(url+\"/ui/#/running_models\",\"_blank\",\"noreferrer\");setIsCallingApi(false);}).catch(function(error){console.error(\"Error:\",error);setIsCallingApi(false);});};var styles={container:{display:\"block\",position:\"relative\",width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:\"1px solid #ddd\",borderRadius:\"20px\",background:\"white\",overflow:\"hidden\"},containerSelected:{display:\"block\",position:\"relative\",width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:\"1px solid #ddd\",borderRadius:\"20px\",background:\"white\",overflow:\"hidden\",boxShadow:\"0 0 2px #00000099\"},descriptionCard:{position:\"relative\",top:\"-1px\",left:\"-1px\",width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:\"1px solid #ddd\",padding:\"20px\",borderRadius:\"20px\",background:\"white\"},parameterCard:{position:\"relative\",top:\"-\".concat(CARD_HEIGHT+1,\"px\"),left:\"-1px\",width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:\"1px solid #ddd\",padding:\"20px\",borderRadius:\"20px\",background:\"white\"},img:{display:\"block\",margin:\"0 auto\",width:\"180px\",height:\"180px\",objectFit:\"cover\",borderRadius:\"10px\"},h2:{margin:\"10px 10px\",fontSize:\"20px\"},p:{minHeight:\"140px\",fontSize:\"14px\",padding:\"0px 10px 15px 10px\"},buttonsContainer:{display:\"flex\",margin:\"0 auto\",marginTop:\"30px\",border:\"none\",justifyContent:\"space-between\",alignItems:\"center\"},buttonContainer:{width:\"45%\",borderWidth:\"0px\",backgroundColor:\"transparent\",paddingLeft:\"0px\",paddingRight:\"0px\"},buttonItem:{width:\"100%\",margin:\"0 auto\",padding:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",border:\"1px solid #e5e7eb\",borderWidth:\"1px\",borderColor:\"#e5e7eb\"},instructionText:{fontSize:\"12px\",color:\"#666666\",fontStyle:\"italic\",margin:\"10px 0\",textAlign:\"center\"},slideIn:{transform:\"translateX(0%)\",transition:\"transform 0.2s ease-in-out\"},slideOut:{transform:\"translateX(100%)\",transition:\"transform 0.2s ease-in-out\"},iconRow:{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\"},iconItem:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",margin:\"20px\"},boldIconText:{fontWeight:\"bold\",fontSize:\"1.2em\"},muiIcon:{fontSize:\"1.5em\"},smallText:{fontSize:\"0.8em\"},tagRow:{margin:\"2px 5px\"}};// Set two different states based on mouse hover\nreturn/*#__PURE__*/_jsxs(Box,{style:hover?styles.containerSelected:styles.container,onMouseEnter:function onMouseEnter(){return setHover(true);},onMouseLeave:function onMouseLeave(){return setHover(false);},onClick:function onClick(){if(!selected){setSelected(true);}},children:[/*#__PURE__*/_jsxs(Box,{style:styles.descriptionCard,children:[/*#__PURE__*/_jsx(\"h2\",{style:styles.h2,children:modelData.model_name}),/*#__PURE__*/_jsxs(\"div\",{style:styles.tagRow,children:[function(){if(modelData.model_lang.includes(\"en\")){return/*#__PURE__*/_jsx(Chip,{label:\"EN\",variant:\"outlined\",size:\"small\"});}}(),function(){if(modelData.model_lang.includes(\"zh\")){return/*#__PURE__*/_jsx(Chip,{label:\"ZH\",variant:\"outlined\",size:\"small\",sx:{marginLeft:\"10px\"}});}}(),function(){if(modelData.model_specs.some(function(spec){return isCached(spec);})){return/*#__PURE__*/_jsx(Chip,{label:\"Cached\",variant:\"outlined\",size:\"small\",sx:{marginLeft:\"10px\"}});}}()]}),/*#__PURE__*/_jsx(\"p\",{style:styles.p,children:modelData.model_description}),/*#__PURE__*/_jsxs(\"div\",{style:styles.iconRow,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsxs(\"span\",{style:styles.boldIconText,children:[Math.floor(modelData.context_length/1000),\"K\"]}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"context length\"})]}),function(){if(modelData.model_ability.includes(\"chat\")){return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(ChatOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"chat model\"})]});}else if(modelData.model_ability.includes(\"generate\")){return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(EditNoteOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"generate model\"})]});}else{return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(HelpCenterOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"other model\"})]});}}()]}),hover?/*#__PURE__*/_jsx(\"p\",{style:styles.instructionText,children:\"Click with mouse to launch the model\"}):/*#__PURE__*/_jsx(\"p\",{style:styles.instructionText})]}),/*#__PURE__*/_jsxs(Box,{style:selected?_objectSpread(_objectSpread({},styles.parameterCard),styles.slideIn):_objectSpread(_objectSpread({},styles.parameterCard),styles.slideOut),children:[/*#__PURE__*/_jsx(\"h2\",{style:styles.h2,children:modelData.model_name}),/*#__PURE__*/_jsxs(Box,{display:\"flex\",flexDirection:\"column\",width:\"80%\",mx:\"auto\",children:[/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"modelFormat-label\",children:\"Model Format\"}),/*#__PURE__*/_jsx(Select,{labelId:\"modelFormat-label\",value:modelFormat,onChange:function onChange(e){return setModelFormat(e.target.value);},label:\"Model Format\",children:formatOptions.map(function(format){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===format;});var cached=specs.some(function(spec){return isCached(spec);});var displayedFormat=cached?format+\" (cached)\":format;return/*#__PURE__*/_jsx(MenuItem,{value:format,children:displayedFormat},format);})})]}),/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",size:\"small\",disabled:!modelFormat,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"modelSize-label\",children:\"Model Size\"}),/*#__PURE__*/_jsx(Select,{labelId:\"modelSize-label\",value:modelSize,onChange:function onChange(e){return setModelSize(e.target.value);},label:\"Model Size\",children:sizeOptions.map(function(size){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===size;});var cached=specs.some(function(spec){return isCached(spec);});var displayedSize=cached?size+\" (cached)\":size;return/*#__PURE__*/_jsx(MenuItem,{value:size,children:displayedSize},size);})})]}),(modelData.is_builtin||modelFormat===\"pytorch\")&&/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",size:\"small\",disabled:!modelFormat||!modelSize,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"quantization-label\",children:\"Quantization\"}),/*#__PURE__*/_jsx(Select,{labelId:\"quantization-label\",value:quantization,onChange:function onChange(e){return setQuantization(e.target.value);},label:\"Quantization\",children:quantizationOptions.map(function(quant,index){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===modelSize;});var cached=modelFormat===\"pytorch\"?specs[0].cache_status&&specs[0].cache_status===true:specs[0].cache_status&&specs[0].cache_status[index]===true;var displayedQuant=cached?quant+\" (cached)\":quant;return/*#__PURE__*/_jsx(MenuItem,{value:quant,children:displayedQuant},quant);})})]})]}),/*#__PURE__*/_jsxs(Box,{style:styles.buttonsContainer,children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch\",style:styles.buttonContainer,onClick:function onClick(){return launchModel(url,modelData);},disabled:isCallingApi||isUpdatingModel||!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!==\"pytorch\")),children:function(){if(isCallingApi||isUpdatingModel){return/*#__PURE__*/_jsx(Box,{style:_objectSpread(_objectSpread({},styles.buttonItem),{},{backgroundColor:\"#f2f2f2\"}),children:/*#__PURE__*/_jsx(CircularProgress,{size:\"20px\",sx:{color:\"#000000\"}})});}else if(!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!==\"pytorch\"))){return/*#__PURE__*/_jsx(Box,{style:_objectSpread(_objectSpread({},styles.buttonItem),{},{backgroundColor:\"#f2f2f2\"}),children:/*#__PURE__*/_jsx(RocketLaunchOutlined,{size:\"20px\"})});}else{return/*#__PURE__*/_jsx(Box,{style:styles.buttonItem,children:/*#__PURE__*/_jsx(RocketLaunchOutlined,{color:\"#000000\",size:\"20px\"})});}}()}),/*#__PURE__*/_jsx(\"button\",{title:\"Go Back\",style:styles.buttonContainer,onClick:function onClick(){return setSelected(false);},children:/*#__PURE__*/_jsx(Box,{style:styles.buttonItem,children:/*#__PURE__*/_jsx(UndoOutlined,{color:\"#000000\",size:\"20px\"})})})]})]})]});};export default ModelCard;","map":{"version":3,"names":["React","useState","useContext","useEffect","v1","uuidv1","ApiContext","FormControl","InputLabel","Select","MenuItem","Box","Chip","CircularProgress","ChatOutlined","EditNoteOutlined","HelpCenterOutlined","UndoOutlined","RocketLaunchOutlined","jsx","_jsx","jsxs","_jsxs","CARD_HEIGHT","CARD_WIDTH","ModelCard","_ref","url","modelData","_useState","_useState2","_slicedToArray","hover","setHover","_useState3","_useState4","selected","setSelected","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState5","_useState6","modelFormat","setModelFormat","_useState7","_useState8","modelSize","setModelSize","_useState9","_useState10","quantization","setQuantization","_useState11","_useState12","formatOptions","setFormatOptions","_useState13","_useState14","sizeOptions","setSizeOptions","_useState15","_useState16","quantizationOptions","setQuantizationOptions","isCached","spec","model_format","cache_status","some","cs","modelFamily","model_specs","formats","_toConsumableArray","Set","map","sizes","filter","model_size_in_billions","quants","parseFloat","flatMap","quantizations","launchModel","uuid","modelDataWithID","model_uid","model_name","fetch","method","headers","body","JSON","stringify","then","response","ok","json","errorData","Error","concat","status","detail","window","open","catch","error","console","styles","container","display","position","width","height","border","borderRadius","background","overflow","containerSelected","boxShadow","descriptionCard","top","left","padding","parameterCard","img","margin","objectFit","h2","fontSize","p","minHeight","buttonsContainer","marginTop","justifyContent","alignItems","buttonContainer","borderWidth","backgroundColor","paddingLeft","paddingRight","buttonItem","borderColor","instructionText","color","fontStyle","textAlign","slideIn","transform","transition","slideOut","iconRow","iconItem","flexDirection","boldIconText","fontWeight","muiIcon","smallText","tagRow","style","onMouseEnter","onMouseLeave","onClick","children","model_lang","includes","label","variant","size","sx","marginLeft","model_description","Math","floor","context_length","model_ability","_objectSpread","mx","id","labelId","value","onChange","e","target","format","specs","cached","displayedFormat","disabled","displayedSize","is_builtin","quant","index","displayedQuant","title"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/modelCard.js"],"sourcesContent":["import React, { useState, useContext, useEffect } from \"react\";\nimport { v1 as uuidv1 } from \"uuid\";\nimport { ApiContext } from \"../../components/apiContext\";\nimport {\n FormControl,\n InputLabel,\n Select,\n MenuItem,\n Box,\n Chip,\n} from \"@mui/material\";\nimport { CircularProgress } from \"@mui/material\";\nimport {\n ChatOutlined,\n EditNoteOutlined,\n HelpCenterOutlined,\n UndoOutlined,\n RocketLaunchOutlined,\n} from \"@mui/icons-material\";\n\nconst CARD_HEIGHT = 350;\nconst CARD_WIDTH = 270;\n\nconst ModelCard = ({ url, modelData }) => {\n const [hover, setHover] = useState(false);\n const [selected, setSelected] = useState(false);\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext);\n const { isUpdatingModel } = useContext(ApiContext);\n\n // Model parameter selections\n const [modelFormat, setModelFormat] = useState(\"\");\n const [modelSize, setModelSize] = useState(\"\");\n const [quantization, setQuantization] = useState(\"\");\n\n const [formatOptions, setFormatOptions] = useState([]);\n const [sizeOptions, setSizeOptions] = useState([]);\n const [quantizationOptions, setQuantizationOptions] = useState([]);\n\n const isCached = (spec) => {\n if (spec.model_format === \"pytorch\") {\n return spec.cache_status && spec.cache_status === true;\n } else {\n return spec.cache_status && spec.cache_status.some((cs) => cs);\n }\n };\n\n // UseEffects for parameter selection, change options based on previous selections\n useEffect(() => {\n if (modelData) {\n const modelFamily = modelData.model_specs;\n const formats = [\n ...new Set(modelFamily.map((spec) => spec.model_format)),\n ];\n setFormatOptions(formats);\n }\n }, [modelData]);\n\n useEffect(() => {\n if (modelFormat && modelData) {\n const modelFamily = modelData.model_specs;\n const sizes = [\n ...new Set(\n modelFamily\n .filter((spec) => spec.model_format === modelFormat)\n .map((spec) => spec.model_size_in_billions),\n ),\n ];\n setSizeOptions(sizes);\n }\n }, [modelFormat, modelData]);\n\n useEffect(() => {\n if (modelFormat && modelSize && modelData) {\n const modelFamily = modelData.model_specs;\n const quants = [\n ...new Set(\n modelFamily\n .filter(\n (spec) =>\n spec.model_format === modelFormat &&\n spec.model_size_in_billions === parseFloat(modelSize),\n )\n .flatMap((spec) => spec.quantizations),\n ),\n ];\n setQuantizationOptions(quants);\n }\n }, [modelFormat, modelSize, modelData]);\n\n const launchModel = (url) => {\n if (isCallingApi || isUpdatingModel) {\n return;\n }\n\n setIsCallingApi(true);\n\n const uuid = uuidv1();\n const modelDataWithID = {\n model_uid: uuid,\n model_name: modelData.model_name,\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantization: quantization,\n };\n\n // First fetch request to initiate the model\n fetch(url + \"/v1/models\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(modelDataWithID),\n })\n .then((response) => {\n if (!response.ok) {\n // Assuming the server returns error details in JSON format\n return response.json().then((errorData) => {\n throw new Error(\n `Server error: ${response.status} - ${\n errorData.detail || \"Unknown error\"\n }`,\n );\n });\n }\n return response.json(); // Also return the promise from response.json() for successful responses\n })\n .then(() => {\n window.open(url + \"/ui/#/running_models\", \"_blank\", \"noreferrer\");\n setIsCallingApi(false);\n })\n .catch((error) => {\n console.error(\"Error:\", error);\n setIsCallingApi(false);\n });\n };\n\n const styles = {\n container: {\n display: \"block\",\n position: \"relative\",\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: \"1px solid #ddd\",\n borderRadius: \"20px\",\n background: \"white\",\n overflow: \"hidden\",\n },\n containerSelected: {\n display: \"block\",\n position: \"relative\",\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: \"1px solid #ddd\",\n borderRadius: \"20px\",\n background: \"white\",\n overflow: \"hidden\",\n boxShadow: \"0 0 2px #00000099\",\n },\n descriptionCard: {\n position: \"relative\",\n top: \"-1px\",\n left: \"-1px\",\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: \"1px solid #ddd\",\n padding: \"20px\",\n borderRadius: \"20px\",\n background: \"white\",\n },\n parameterCard: {\n position: \"relative\",\n top: `-${CARD_HEIGHT + 1}px`,\n left: \"-1px\",\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: \"1px solid #ddd\",\n padding: \"20px\",\n borderRadius: \"20px\",\n background: \"white\",\n },\n img: {\n display: \"block\",\n margin: \"0 auto\",\n width: \"180px\",\n height: \"180px\",\n objectFit: \"cover\",\n borderRadius: \"10px\",\n },\n h2: {\n margin: \"10px 10px\",\n fontSize: \"20px\",\n },\n p: {\n minHeight: \"140px\",\n fontSize: \"14px\",\n padding: \"0px 10px 15px 10px\",\n },\n buttonsContainer: {\n display: \"flex\",\n margin: \"0 auto\",\n marginTop: \"30px\",\n border: \"none\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n buttonContainer: {\n width: \"45%\",\n borderWidth: \"0px\",\n backgroundColor: \"transparent\",\n paddingLeft: \"0px\",\n paddingRight: \"0px\",\n },\n buttonItem: {\n width: \"100%\",\n margin: \"0 auto\",\n padding: \"5px\",\n display: \"flex\",\n justifyContent: \"center\",\n borderRadius: \"4px\",\n border: \"1px solid #e5e7eb\",\n borderWidth: \"1px\",\n borderColor: \"#e5e7eb\",\n },\n instructionText: {\n fontSize: \"12px\",\n color: \"#666666\",\n fontStyle: \"italic\",\n margin: \"10px 0\",\n textAlign: \"center\",\n },\n slideIn: {\n transform: \"translateX(0%)\",\n transition: \"transform 0.2s ease-in-out\",\n },\n slideOut: {\n transform: \"translateX(100%)\",\n transition: \"transform 0.2s ease-in-out\",\n },\n iconRow: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n iconItem: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n margin: \"20px\",\n },\n boldIconText: {\n fontWeight: \"bold\",\n fontSize: \"1.2em\",\n },\n muiIcon: {\n fontSize: \"1.5em\",\n },\n smallText: {\n fontSize: \"0.8em\",\n },\n tagRow: {\n margin: \"2px 5px\",\n },\n };\n\n // Set two different states based on mouse hover\n return (\n <Box\n style={hover ? styles.containerSelected : styles.container}\n onMouseEnter={() => setHover(true)}\n onMouseLeave={() => setHover(false)}\n onClick={() => {\n if (!selected) {\n setSelected(true);\n }\n }}\n >\n {/* First state: show description page */}\n <Box style={styles.descriptionCard}>\n <h2 style={styles.h2}>{modelData.model_name}</h2>\n <div style={styles.tagRow}>\n {(() => {\n if (modelData.model_lang.includes(\"en\")) {\n return <Chip label=\"EN\" variant=\"outlined\" size=\"small\" />;\n }\n })()}\n {(() => {\n if (modelData.model_lang.includes(\"zh\")) {\n return (\n <Chip\n label=\"ZH\"\n variant=\"outlined\"\n size=\"small\"\n sx={{ marginLeft: \"10px\" }}\n />\n );\n }\n })()}\n {(() => {\n if (modelData.model_specs.some((spec) => isCached(spec))) {\n return (\n <Chip\n label=\"Cached\"\n variant=\"outlined\"\n size=\"small\"\n sx={{ marginLeft: \"10px\" }}\n />\n );\n }\n })()}\n </div>\n <p style={styles.p}>{modelData.model_description}</p>\n\n <div style={styles.iconRow}>\n <div style={styles.iconItem}>\n <span style={styles.boldIconText}>\n {Math.floor(modelData.context_length / 1000)}K\n </span>\n <small style={styles.smallText}>context length</small>\n </div>\n {(() => {\n if (modelData.model_ability.includes(\"chat\")) {\n return (\n <div style={styles.iconItem}>\n <ChatOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>chat model</small>\n </div>\n );\n } else if (modelData.model_ability.includes(\"generate\")) {\n return (\n <div style={styles.iconItem}>\n <EditNoteOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>generate model</small>\n </div>\n );\n } else {\n return (\n <div style={styles.iconItem}>\n <HelpCenterOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>other model</small>\n </div>\n );\n }\n })()}\n </div>\n {hover ? (\n <p style={styles.instructionText}>\n Click with mouse to launch the model\n </p>\n ) : (\n <p style={styles.instructionText}></p>\n )}\n </Box>\n {/* Second state: show parameter selection page */}\n <Box\n style={\n selected\n ? { ...styles.parameterCard, ...styles.slideIn }\n : { ...styles.parameterCard, ...styles.slideOut }\n }\n >\n <h2 style={styles.h2}>{modelData.model_name}</h2>\n <Box display=\"flex\" flexDirection=\"column\" width=\"80%\" mx=\"auto\">\n <FormControl variant=\"outlined\" margin=\"normal\" size=\"small\">\n <InputLabel id=\"modelFormat-label\">Model Format</InputLabel>\n <Select\n labelId=\"modelFormat-label\"\n value={modelFormat}\n onChange={(e) => setModelFormat(e.target.value)}\n label=\"Model Format\"\n >\n {formatOptions.map((format) => {\n const specs = modelData.model_specs.filter(\n (spec) => spec.model_format === format,\n );\n const cached = specs.some((spec) => isCached(spec));\n const displayedFormat = cached ? format + \" (cached)\" : format;\n\n return (\n <MenuItem key={format} value={format}>\n {displayedFormat}\n </MenuItem>\n );\n })}\n </Select>\n </FormControl>\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n size=\"small\"\n disabled={!modelFormat}\n >\n <InputLabel id=\"modelSize-label\">Model Size</InputLabel>\n <Select\n labelId=\"modelSize-label\"\n value={modelSize}\n onChange={(e) => setModelSize(e.target.value)}\n label=\"Model Size\"\n >\n {sizeOptions.map((size) => {\n const specs = modelData.model_specs\n .filter((spec) => spec.model_format === modelFormat)\n .filter((spec) => spec.model_size_in_billions === size);\n const cached = specs.some((spec) => isCached(spec));\n const displayedSize = cached ? size + \" (cached)\" : size;\n\n return (\n <MenuItem key={size} value={size}>\n {displayedSize}\n </MenuItem>\n );\n })}\n </Select>\n </FormControl>\n {(modelData.is_builtin || modelFormat === \"pytorch\") && (\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n size=\"small\"\n disabled={!modelFormat || !modelSize}\n >\n <InputLabel id=\"quantization-label\">Quantization</InputLabel>\n <Select\n labelId=\"quantization-label\"\n value={quantization}\n onChange={(e) => setQuantization(e.target.value)}\n label=\"Quantization\"\n >\n {quantizationOptions.map((quant, index) => {\n const specs = modelData.model_specs\n .filter((spec) => spec.model_format === modelFormat)\n .filter(\n (spec) => spec.model_size_in_billions === modelSize,\n );\n\n const cached =\n modelFormat === \"pytorch\"\n ? specs[0].cache_status && specs[0].cache_status === true\n : specs[0].cache_status &&\n specs[0].cache_status[index] === true;\n const displayedQuant = cached ? quant + \" (cached)\" : quant;\n\n return (\n <MenuItem key={quant} value={quant}>\n {displayedQuant}\n </MenuItem>\n );\n })}\n </Select>\n </FormControl>\n )}\n </Box>\n <Box style={styles.buttonsContainer}>\n <button\n title=\"Launch\"\n style={styles.buttonContainer}\n onClick={() => launchModel(url, modelData)}\n disabled={\n isCallingApi ||\n isUpdatingModel ||\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== \"pytorch\"))\n )\n }\n >\n {(() => {\n if (isCallingApi || isUpdatingModel) {\n return (\n <Box\n style={{ ...styles.buttonItem, backgroundColor: \"#f2f2f2\" }}\n >\n <CircularProgress\n size=\"20px\"\n sx={{\n color: \"#000000\",\n }}\n />\n </Box>\n );\n } else if (\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== \"pytorch\"))\n )\n ) {\n return (\n <Box\n style={{ ...styles.buttonItem, backgroundColor: \"#f2f2f2\" }}\n >\n <RocketLaunchOutlined size=\"20px\" />\n </Box>\n );\n } else {\n return (\n <Box style={styles.buttonItem}>\n <RocketLaunchOutlined color=\"#000000\" size=\"20px\" />\n </Box>\n );\n }\n })()}\n </button>\n <button\n title=\"Go Back\"\n style={styles.buttonContainer}\n onClick={() => setSelected(false)}\n >\n <Box style={styles.buttonItem}>\n <UndoOutlined color=\"#000000\" size=\"20px\" />\n </Box>\n </button>\n </Box>\n </Box>\n </Box>\n );\n};\n\nexport default ModelCard;\n"],"mappings":"8aAAA,MAAO,CAAAA,KAAK,EAAIC,QAAQ,CAAEC,UAAU,CAAEC,SAAS,KAAQ,OAAO,CAC9D,OAASC,EAAE,GAAI,CAAAC,MAAM,KAAQ,MAAM,CACnC,OAASC,UAAU,KAAQ,6BAA6B,CACxD,OACEC,WAAW,CACXC,UAAU,CACVC,MAAM,CACNC,QAAQ,CACRC,GAAG,CACHC,I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AACqK,UAAU,EAAIpJ,WAAW,GAAK,SAAU,CAAC,CACxD,CACD,CACA,mBACEzB,IAAA,CAACT,GAAG,EACFuJ,KAAK,CAAAiB,aAAA,CAAAA,aAAA,IAAOpE,MAAM,CAACiC,UAAU,MAAEH,eAAe,CAAE,SAAS,EAAG,CAAAyB,QAAA,cAE5DlJ,IAAA,CAACF,oBAAoB,EAACyJ,IAAI,CAAC,MAAM,CAAE,CAAC,CACjC,CAAC,CAEV,CAAC,IAAM,CACL,mBACEvJ,IAAA,CAACT,GAAG,EAACuJ,KAAK,CAAEnD,MAAM,CAACiC,UAAW,CAAAsB,QAAA,cAC5BlJ,IAAA,CAACF,oBAAoB,EAACiI,KAAK,CAAC,SAAS,CAACwB,IAAI,CAAC,MAAM,CAAE,CAAC,CACjD,CAAC,CAEV,CACF,CAAC,CAAE,CAAC,CACE,CAAC,cACTvJ,IAAA,WACEiL,KAAK,CAAC,SAAS,CACfnC,KAAK,CAAEnD,MAAM,CAAC4B,eAAgB,CAC9B0B,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAAhI,WAAW,CAAC,KAAK,CAAC,EAAC,CAAAiI,QAAA,cAElClJ,IAAA,CAACT,GAAG,EAACuJ,KAAK,CAAEnD,MAAM,CAACiC,UAAW,CAAAsB,QAAA,cAC5BlJ,IAAA,CAACH,YAAY,EAACkI,KAAK,CAAC,SAAS,CAACwB,IAAI,CAAC,MAAM,CAAE,CAAC,CACzC,CAAC,CACA,CAAC,EACN,CAAC,EACH,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAlJ,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React,{useContext,useState,useEffect}from\"react\";import EmbeddingCard from\"./embeddingCard\";import{Box,TextField,FormControl}from\"@mui/material\";import{ApiContext}from\"../../components/apiContext\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchEmbedding=function LaunchEmbedding(){var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;// States used for filtering\nvar _useState3=useState(\"\"),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var handleChange=function handleChange(event){setSearchTerm(event.target.value);};var filter=function filter(registration){if(!registration||typeof searchTerm!==\"string\")return false;var modelName=registration.model_name?registration.model_name.toLowerCase():\"\";if(!modelName.includes(searchTerm.toLowerCase())){return false;}return true;};var update=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var response,registrations,newRegistrationData;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context2.next=2;break;}return _context2.abrupt(\"return\");case 2:_context2.prev=2;setIsCallingApi(true);_context2.next=6;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/embedding\"),{method:\"GET\"});case 6:response=_context2.sent;_context2.next=9;return response.json();case 9:registrations=_context2.sent;_context2.next=12;return Promise.all(registrations.map(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/embedding/\").concat(registration.model_name),{method:\"GET\"});case 2:desc=_context.sent;_context.t0=_objectSpread;_context.t1=_objectSpread;_context.t2={};_context.next=8;return desc.json();case 8:_context.t3=_context.sent;_context.t4=(0,_context.t1)(_context.t2,_context.t3);_context.t5={};_context.t6={is_builtin:registration.is_builtin};return _context.abrupt(\"return\",(0,_context.t0)(_context.t4,_context.t5,_context.t6));case 13:case\"end\":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}()));case 12:newRegistrationData=_context2.sent;setRegistrationData(newRegistrationData);_context2.next=19;break;case 16:_context2.prev=16;_context2.t0=_context2[\"catch\"](2);console.error(\"Error:\",_context2.t0);case 19:_context2.prev=19;setIsCallingApi(false);return _context2.finish(19);case 22:case\"end\":return _context2.stop();}},_callee2,null,[[2,16,19,22]]);}));return function update(){return _ref.apply(this,arguments);};}();useEffect(function(){update();// eslint-disable-next-line\n},[]);var style={display:\"grid\",gridTemplateColumns:\"repeat(auto-fill, minmax(300px, 1fr))\",paddingLeft:\"2rem\",gridGap:\"2rem 0rem\"};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"grid\",gridTemplateColumns:\"1fr\",margin:\"30px 2rem\"},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(TextField,{id:\"search\",type:\"search\",label:\"Search for embedding model name\",value:searchTerm,onChange:handleChange,size:\"small\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(EmbeddingCard,{url:endPoint,modelData:filteredRegistration});})})]});};export default LaunchEmbedding;","map":{"version":3,"names":["React","useContext","useState","useEffect","EmbeddingCard","Box","TextField","FormControl","ApiContext","jsx","_jsx","jsxs","_jsxs","LaunchEmbedding","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState3","_useState4","searchTerm","setSearchTerm","handleChange","event","target","value","filter","registration","modelName","model_name","toLowerCase","includes","update","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee2","response","registrations","newRegistrationData","wrap","_callee2$","_context2","prev","next","abrupt","fetch","concat","method","sent","json","Promise","all","map","_ref2","_callee","desc","_callee$","_context","t0","_objectSpread","t1","t2","t3","t4","t5","t6","is_builtin","stop","_x","apply","arguments","console","error","finish","style","display","gridTemplateColumns","paddingLeft","gridGap","m","children","margin","variant","id","type","label","onChange","size","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchEmbedding.js"],"sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport EmbeddingCard from \"./embeddingCard\";\nimport { Box, TextField, FormControl } from \"@mui/material\";\nimport { ApiContext } from \"../../components/apiContext\";\n\nconst LaunchEmbedding = () => {\n let endPoint = useContext(ApiContext).endPoint;\n const [registrationData, setRegistrationData] = useState([]);\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext);\n const { isUpdatingModel } = useContext(ApiContext);\n\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState(\"\");\n\n const handleChange = (event) => {\n setSearchTerm(event.target.value);\n };\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== \"string\") return false;\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : \"\";\n if (!modelName.includes(searchTerm.toLowerCase())) {\n return false;\n }\n return true;\n };\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return;\n\n try {\n setIsCallingApi(true);\n\n const response = await fetch(\n `${endPoint}/v1/model_registrations/embedding`,\n {\n method: \"GET\",\n },\n );\n\n const registrations = await response.json();\n const newRegistrationData = await Promise.all(\n registrations.map(async (registration) => {\n const desc = await fetch(\n `${endPoint}/v1/model_registrations/embedding/${registration.model_name}`,\n {\n method: \"GET\",\n },\n );\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n };\n }),\n );\n\n setRegistrationData(newRegistrationData);\n } catch (error) {\n console.error(\"Error:\", error);\n } finally {\n setIsCallingApi(false);\n }\n };\n\n useEffect(() => {\n update();\n // eslint-disable-next-line\n }, []);\n\n const style = {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fill, minmax(300px, 1fr))\",\n paddingLeft: \"2rem\",\n gridGap: \"2rem 0rem\",\n };\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n margin: \"30px 2rem\",\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <TextField\n id=\"search\"\n type=\"search\"\n label=\"Search for embedding model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <EmbeddingCard url={endPoint} modelData={filteredRegistration} />\n ))}\n </div>\n </Box>\n );\n};\n\nexport default LaunchEmbedding;\n"],"mappings":"mkBAAA,MAAO,CAAAA,KAAK,EAAIC,UAAU,CAAEC,QAAQ,CAAEC,SAAS,KAAQ,OAAO,CAC9D,MAAO,CAAAC,aAAa,KAAM,iBAAiB,CAC3C,OAASC,GAAG,CAAEC,SAAS,CAAEC,WAAW,KAAQ,eAAe,CAC3D,OAASC,UAAU,KAAQ,6BAA6B,CAAC,OAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEzD,GAAM,CAAAC,eAAe,CAAG,QAAlB,CAAAA,eAAeA,CAAA,CAAS,CAC5B,GAAI,CAAAC,QAAQ,CAAGb,UAAU,CAACO,UAAU,CAAC,CAACM,QAAQ,CAC9C,IAAAC,SAAA,CAAgDb,QAAQ,CAAC,EAAE,CAAC,CAA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