xinference 0.11.3__py3-none-any.whl → 0.12.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (75) hide show
  1. xinference/_version.py +3 -3
  2. xinference/api/restful_api.py +143 -6
  3. xinference/client/restful/restful_client.py +144 -5
  4. xinference/constants.py +5 -0
  5. xinference/core/cache_tracker.py +48 -28
  6. xinference/core/model.py +160 -19
  7. xinference/core/scheduler.py +446 -0
  8. xinference/core/supervisor.py +99 -24
  9. xinference/core/worker.py +68 -2
  10. xinference/deploy/cmdline.py +86 -2
  11. xinference/deploy/test/test_cmdline.py +19 -10
  12. xinference/isolation.py +9 -2
  13. xinference/model/audio/__init__.py +14 -1
  14. xinference/model/audio/chattts.py +84 -0
  15. xinference/model/audio/core.py +22 -4
  16. xinference/model/audio/custom.py +6 -4
  17. xinference/model/audio/model_spec.json +20 -0
  18. xinference/model/audio/model_spec_modelscope.json +20 -0
  19. xinference/model/llm/__init__.py +38 -2
  20. xinference/model/llm/llm_family.json +509 -1
  21. xinference/model/llm/llm_family.py +86 -1
  22. xinference/model/llm/llm_family_csghub.json +66 -0
  23. xinference/model/llm/llm_family_modelscope.json +411 -2
  24. xinference/model/llm/pytorch/chatglm.py +20 -13
  25. xinference/model/llm/pytorch/cogvlm2.py +76 -17
  26. xinference/model/llm/pytorch/core.py +141 -6
  27. xinference/model/llm/pytorch/glm4v.py +268 -0
  28. xinference/model/llm/pytorch/minicpmv25.py +232 -0
  29. xinference/model/llm/pytorch/qwen_vl.py +1 -1
  30. xinference/model/llm/pytorch/utils.py +405 -8
  31. xinference/model/llm/utils.py +14 -13
  32. xinference/model/llm/vllm/core.py +16 -4
  33. xinference/model/utils.py +8 -2
  34. xinference/thirdparty/ChatTTS/__init__.py +1 -0
  35. xinference/thirdparty/ChatTTS/core.py +200 -0
  36. xinference/thirdparty/ChatTTS/experimental/__init__.py +0 -0
  37. xinference/thirdparty/ChatTTS/experimental/llm.py +40 -0
  38. xinference/thirdparty/ChatTTS/infer/__init__.py +0 -0
  39. xinference/thirdparty/ChatTTS/infer/api.py +125 -0
  40. xinference/thirdparty/ChatTTS/model/__init__.py +0 -0
  41. xinference/thirdparty/ChatTTS/model/dvae.py +155 -0
  42. xinference/thirdparty/ChatTTS/model/gpt.py +265 -0
  43. xinference/thirdparty/ChatTTS/utils/__init__.py +0 -0
  44. xinference/thirdparty/ChatTTS/utils/gpu_utils.py +23 -0
  45. xinference/thirdparty/ChatTTS/utils/infer_utils.py +141 -0
  46. xinference/thirdparty/ChatTTS/utils/io_utils.py +14 -0
  47. xinference/types.py +3 -0
  48. xinference/web/ui/build/asset-manifest.json +6 -6
  49. xinference/web/ui/build/index.html +1 -1
  50. xinference/web/ui/build/static/css/main.074e2b31.css +2 -0
  51. xinference/web/ui/build/static/css/main.074e2b31.css.map +1 -0
  52. xinference/web/ui/build/static/js/main.a58ff436.js +3 -0
  53. xinference/web/ui/build/static/js/main.a58ff436.js.map +1 -0
  54. xinference/web/ui/node_modules/.cache/babel-loader/10262a281dec3bc2b185f4385ceb6846626f52d41cb4d46c7c649e719f979d4d.json +1 -0
  55. xinference/web/ui/node_modules/.cache/babel-loader/762a75a62daf3bec2cfc97ec8612798493fb34ef87087dcad6aad64ab7f14345.json +1 -0
  56. xinference/web/ui/node_modules/.cache/babel-loader/7f3bdb3a48fa00c046c8b185acd4da6f2e2940a20dbd77f9373d60de3fd6633e.json +1 -0
  57. xinference/web/ui/node_modules/.cache/babel-loader/f2f73bfdc13b12b02c8cbc4769b0b8e6367e9b6d8331c322d94318491a0b3653.json +1 -0
  58. xinference/web/ui/node_modules/.cache/babel-loader/f51bf63ddaa7afd125ef2254a105789333eecc1c94fdf5157a9b88ef7ad0a5bd.json +1 -0
  59. {xinference-0.11.3.dist-info → xinference-0.12.1.dist-info}/METADATA +26 -9
  60. {xinference-0.11.3.dist-info → xinference-0.12.1.dist-info}/RECORD +65 -47
  61. xinference/web/ui/build/static/css/main.54bca460.css +0 -2
  62. xinference/web/ui/build/static/css/main.54bca460.css.map +0 -1
  63. xinference/web/ui/build/static/js/main.551aa479.js +0 -3
  64. xinference/web/ui/build/static/js/main.551aa479.js.map +0 -1
  65. xinference/web/ui/node_modules/.cache/babel-loader/1e86938a0cdf706d21e99b21f5d868fa247c0c88b26807047e26dcdc4d9a9db3.json +0 -1
  66. xinference/web/ui/node_modules/.cache/babel-loader/1fa824d82b2af519de7700c594e50bde4bbca60d13bd3fabff576802e4070304.json +0 -1
  67. xinference/web/ui/node_modules/.cache/babel-loader/3e737bcdbcbc407ccd65b90e199ef0c3214b261e8e41dbf14d921384a717d9ee.json +0 -1
  68. xinference/web/ui/node_modules/.cache/babel-loader/46b6dd1f6d1109cd0e2455a0ea0be3e9bda1097cd4ebec9c4040070372671cfc.json +0 -1
  69. xinference/web/ui/node_modules/.cache/babel-loader/59ce49eae0f486af4c5034d4d2f9ca77c3ec3a32ecc560085caf5ef482b5f4c9.json +0 -1
  70. xinference/web/ui/node_modules/.cache/babel-loader/a6da6bc3d0d2191adebee87fb58ecebe82d071087bd2f7f3a9c7fdd2ada130f2.json +0 -1
  71. /xinference/web/ui/build/static/js/{main.551aa479.js.LICENSE.txt → main.a58ff436.js.LICENSE.txt} +0 -0
  72. {xinference-0.11.3.dist-info → xinference-0.12.1.dist-info}/LICENSE +0 -0
  73. {xinference-0.11.3.dist-info → xinference-0.12.1.dist-info}/WHEEL +0 -0
  74. {xinference-0.11.3.dist-info → xinference-0.12.1.dist-info}/entry_points.txt +0 -0
  75. {xinference-0.11.3.dist-info → xinference-0.12.1.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,7 @@
4
4
  "model_family": "whisper",
5
5
  "model_id": "openai/whisper-tiny",
6
6
  "model_revision": "167c219b21f11ef214220b8fdb7536b8a88c2475",
7
+ "ability": "audio-to-text",
7
8
  "multilingual": true
8
9
  },
9
10
  {
@@ -11,6 +12,7 @@
11
12
  "model_family": "whisper",
12
13
  "model_id": "openai/whisper-tiny.en",
13
14
  "model_revision": "87c7102498dcde7456f24cfd30239ca606ed9063",
15
+ "ability": "audio-to-text",
14
16
  "multilingual": false
15
17
  },
16
18
  {
@@ -18,6 +20,7 @@
18
20
  "model_family": "whisper",
19
21
  "model_id": "openai/whisper-base",
20
22
  "model_revision": "8c1db9b51951100007a96a525d83a8ec81b3c237",
23
+ "ability": "audio-to-text",
21
24
  "multilingual": true
22
25
  },
23
26
  {
@@ -25,6 +28,7 @@
25
28
  "model_family": "whisper",
26
29
  "model_id": "openai/whisper-base.en",
27
30
  "model_revision": "911407f4214e0e1d82085af863093ec0b66f9cd6",
31
+ "ability": "audio-to-text",
28
32
  "multilingual": false
29
33
  },
30
34
  {
@@ -32,6 +36,7 @@
32
36
  "model_family": "whisper",
33
37
  "model_id": "openai/whisper-small",
34
38
  "model_revision": "998cb1a777c20db53d6033a61b977ed4c3792cac",
39
+ "ability": "audio-to-text",
35
40
  "multilingual": true
36
41
  },
37
42
  {
@@ -39,6 +44,7 @@
39
44
  "model_family": "whisper",
40
45
  "model_id": "openai/whisper-small.en",
41
46
  "model_revision": "e8727524f962ee844a7319d92be39ac1bd25655a",
47
+ "ability": "audio-to-text",
42
48
  "multilingual": false
43
49
  },
44
50
  {
@@ -46,6 +52,7 @@
46
52
  "model_family": "whisper",
47
53
  "model_id": "openai/whisper-medium",
48
54
  "model_revision": "16688beb1294bedd0a6f5cd86fe7eec57bce41ed",
55
+ "ability": "audio-to-text",
49
56
  "multilingual": true
50
57
  },
51
58
  {
@@ -53,6 +60,7 @@
53
60
  "model_family": "whisper",
54
61
  "model_id": "openai/whisper-medium.en",
55
62
  "model_revision": "2e98eb6279edf5095af0c8dedb36bdec0acd172b",
63
+ "ability": "audio-to-text",
56
64
  "multilingual": false
57
65
  },
58
66
  {
@@ -60,6 +68,7 @@
60
68
  "model_family": "whisper",
61
69
  "model_id": "openai/whisper-large-v3",
62
70
  "model_revision": "6cdf07a7e3ec3806e5d55f787915b85d4cd020b1",
71
+ "ability": "audio-to-text",
63
72
  "multilingual": true
64
73
  },
65
74
  {
@@ -67,6 +76,7 @@
67
76
  "model_family": "whisper",
68
77
  "model_id": "BELLE-2/Belle-distilwhisper-large-v2-zh",
69
78
  "model_revision": "ed25d13498fa5bac758b2fc479435b698532dfe8",
79
+ "ability": "audio-to-text",
70
80
  "multilingual": false
71
81
  },
72
82
  {
@@ -74,6 +84,7 @@
74
84
  "model_family": "whisper",
75
85
  "model_id": "BELLE-2/Belle-whisper-large-v2-zh",
76
86
  "model_revision": "ec5bd5d78598545b7585814edde86dac2002b5b9",
87
+ "ability": "audio-to-text",
77
88
  "multilingual": false
78
89
  },
79
90
  {
@@ -81,6 +92,15 @@
81
92
  "model_family": "whisper",
82
93
  "model_id": "BELLE-2/Belle-whisper-large-v3-zh",
83
94
  "model_revision": "3bebc7247696b39f5ab9ed22db426943ac33f600",
95
+ "ability": "audio-to-text",
84
96
  "multilingual": false
97
+ },
98
+ {
99
+ "model_name": "ChatTTS",
100
+ "model_family": "ChatTTS",
101
+ "model_id": "2Noise/ChatTTS",
102
+ "model_revision": "ce5913842aebd78e4a01a02d47244b8d62ac4ee3",
103
+ "ability": "text-to-audio",
104
+ "multilingual": true
85
105
  }
86
106
  ]
@@ -0,0 +1,20 @@
1
+ [
2
+ {
3
+ "model_name": "whisper-large-v3",
4
+ "model_family": "whisper",
5
+ "model_hub": "modelscope",
6
+ "model_id": "AI-ModelScope/whisper-large-v3",
7
+ "model_revision": "master",
8
+ "ability": "audio-to-text",
9
+ "multilingual": true
10
+ },
11
+ {
12
+ "model_name": "ChatTTS",
13
+ "model_family": "ChatTTS",
14
+ "model_hub": "modelscope",
15
+ "model_id": "pzc163/chatTTS",
16
+ "model_revision": "master",
17
+ "ability": "text-to-audio",
18
+ "multilingual": true
19
+ }
20
+ ]
@@ -25,6 +25,7 @@ from .core import (
25
25
  get_llm_model_descriptions,
26
26
  )
27
27
  from .llm_family import (
28
+ BUILTIN_CSGHUB_LLM_FAMILIES,
28
29
  BUILTIN_LLM_FAMILIES,
29
30
  BUILTIN_LLM_MODEL_CHAT_FAMILIES,
30
31
  BUILTIN_LLM_MODEL_GENERATE_FAMILIES,
@@ -117,9 +118,11 @@ def _install():
117
118
  from .pytorch.core import PytorchChatModel, PytorchModel
118
119
  from .pytorch.deepseek_vl import DeepSeekVLChatModel
119
120
  from .pytorch.falcon import FalconPytorchChatModel, FalconPytorchModel
121
+ from .pytorch.glm4v import Glm4VModel
120
122
  from .pytorch.intern_vl import InternVLChatModel
121
123
  from .pytorch.internlm2 import Internlm2PytorchChatModel
122
124
  from .pytorch.llama_2 import LlamaPytorchChatModel, LlamaPytorchModel
125
+ from .pytorch.minicpmv25 import MiniCPMV25Model
123
126
  from .pytorch.qwen_vl import QwenVLChatModel
124
127
  from .pytorch.vicuna import VicunaPytorchChatModel
125
128
  from .pytorch.yi_vl import YiVLChatModel
@@ -161,6 +164,8 @@ def _install():
161
164
  InternVLChatModel,
162
165
  PytorchModel,
163
166
  CogVLM2Model,
167
+ MiniCPMV25Model,
168
+ Glm4VModel,
164
169
  ]
165
170
  )
166
171
  if OmniLMMModel: # type: ignore
@@ -217,13 +222,44 @@ def _install():
217
222
  if "tools" in model_spec.model_ability:
218
223
  BUILTIN_LLM_MODEL_TOOL_CALL_FAMILIES.add(model_spec.model_name)
219
224
 
220
- for llm_specs in [BUILTIN_LLM_FAMILIES, BUILTIN_MODELSCOPE_LLM_FAMILIES]:
225
+ csghub_json_path = os.path.join(
226
+ os.path.dirname(os.path.abspath(__file__)), "llm_family_csghub.json"
227
+ )
228
+ for json_obj in json.load(codecs.open(csghub_json_path, "r", encoding="utf-8")):
229
+ model_spec = LLMFamilyV1.parse_obj(json_obj)
230
+ BUILTIN_CSGHUB_LLM_FAMILIES.append(model_spec)
231
+
232
+ # register prompt style, in case that we have something missed
233
+ # if duplicated with huggingface json, keep it as the huggingface style
234
+ if (
235
+ "chat" in model_spec.model_ability
236
+ and isinstance(model_spec.prompt_style, PromptStyleV1)
237
+ and model_spec.model_name not in BUILTIN_LLM_PROMPT_STYLE
238
+ ):
239
+ BUILTIN_LLM_PROMPT_STYLE[model_spec.model_name] = model_spec.prompt_style
240
+ # register model family
241
+ if "chat" in model_spec.model_ability:
242
+ BUILTIN_LLM_MODEL_CHAT_FAMILIES.add(model_spec.model_name)
243
+ else:
244
+ BUILTIN_LLM_MODEL_GENERATE_FAMILIES.add(model_spec.model_name)
245
+ if "tools" in model_spec.model_ability:
246
+ BUILTIN_LLM_MODEL_TOOL_CALL_FAMILIES.add(model_spec.model_name)
247
+
248
+ for llm_specs in [
249
+ BUILTIN_LLM_FAMILIES,
250
+ BUILTIN_MODELSCOPE_LLM_FAMILIES,
251
+ BUILTIN_CSGHUB_LLM_FAMILIES,
252
+ ]:
221
253
  for llm_spec in llm_specs:
222
254
  if llm_spec.model_name not in LLM_MODEL_DESCRIPTIONS:
223
255
  LLM_MODEL_DESCRIPTIONS.update(generate_llm_description(llm_spec))
224
256
 
225
257
  # traverse all families and add engine parameters corresponding to the model name
226
- for families in [BUILTIN_LLM_FAMILIES, BUILTIN_MODELSCOPE_LLM_FAMILIES]:
258
+ for families in [
259
+ BUILTIN_LLM_FAMILIES,
260
+ BUILTIN_MODELSCOPE_LLM_FAMILIES,
261
+ BUILTIN_CSGHUB_LLM_FAMILIES,
262
+ ]:
227
263
  for family in families:
228
264
  generate_engine_config_by_model_family(family)
229
265