xinference 0.10.1__py3-none-any.whl → 0.10.2__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 +9 -9
- xinference/client/restful/restful_client.py +32 -16
- xinference/core/supervisor.py +32 -9
- xinference/core/worker.py +13 -8
- xinference/deploy/cmdline.py +22 -9
- xinference/model/audio/__init__.py +40 -1
- xinference/model/audio/core.py +25 -45
- xinference/model/audio/custom.py +148 -0
- xinference/model/core.py +6 -9
- xinference/model/embedding/model_spec.json +24 -0
- xinference/model/embedding/model_spec_modelscope.json +24 -0
- xinference/model/image/core.py +12 -4
- xinference/model/image/stable_diffusion/core.py +8 -7
- xinference/model/llm/core.py +9 -14
- xinference/model/llm/llm_family.json +263 -0
- xinference/model/llm/llm_family.py +26 -4
- xinference/model/llm/llm_family_modelscope.json +160 -0
- xinference/model/llm/pytorch/baichuan.py +4 -3
- xinference/model/llm/pytorch/chatglm.py +3 -2
- xinference/model/llm/pytorch/core.py +15 -13
- xinference/model/llm/pytorch/falcon.py +6 -5
- xinference/model/llm/pytorch/internlm2.py +3 -2
- xinference/model/llm/pytorch/llama_2.py +6 -5
- xinference/model/llm/pytorch/vicuna.py +4 -3
- xinference/model/llm/vllm/core.py +3 -0
- xinference/model/rerank/core.py +23 -12
- xinference/model/rerank/model_spec.json +24 -0
- xinference/model/rerank/model_spec_modelscope.json +25 -1
- xinference/model/utils.py +12 -1
- xinference/types.py +55 -0
- xinference/utils.py +1 -0
- xinference/web/ui/build/asset-manifest.json +3 -3
- xinference/web/ui/build/index.html +1 -1
- xinference/web/ui/build/static/js/main.26fdbfbe.js +3 -0
- xinference/web/ui/build/static/js/main.26fdbfbe.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/1870cd6f7054d04e049e363c0a85526584fe25519378609d2838e28d7492bbf1.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/1e86938a0cdf706d21e99b21f5d868fa247c0c88b26807047e26dcdc4d9a9db3.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/f4d5d1a41892a754c1ee0237450d804b20612d1b657945b59e564161ea47aa7a.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/f9290c0738db50065492ceedc6a4af25083fe18399b7c44d942273349ad9e643.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/fad4cd70de36ef6e6d5f8fd74a10ded58d964a8a91ef7681693fbb8376552da7.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/feabb04b4aa507102da0a64398a40818e878fd1df9b75dda8461b3e1e7ff3f11.json +1 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.dist-info}/METADATA +4 -1
- {xinference-0.10.1.dist-info → xinference-0.10.2.dist-info}/RECORD +49 -46
- xinference/web/ui/build/static/js/main.76ef2b17.js +0 -3
- xinference/web/ui/build/static/js/main.76ef2b17.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/35d0e4a317e5582cbb79d901302e9d706520ac53f8a734c2fd8bfde6eb5a4f02.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/d076fd56cf3b15ed2433e3744b98c6b4e4410a19903d1db4de5bba0e1a1b3347.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/daad8131d91134f6d7aef895a0c9c32e1cb928277cb5aa66c01028126d215be0.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/f16aec63602a77bd561d0e67fa00b76469ac54b8033754bba114ec5eb3257964.json +0 -1
- /xinference/web/ui/build/static/js/{main.76ef2b17.js.LICENSE.txt → main.26fdbfbe.js.LICENSE.txt} +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.dist-info}/LICENSE +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.dist-info}/WHEEL +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.dist-info}/entry_points.txt +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"model_name": "bge-reranker-base",
|
|
4
|
+
"type": "normal",
|
|
4
5
|
"language": ["en", "zh"],
|
|
5
6
|
"model_id": "Xorbits/bge-reranker-base",
|
|
6
7
|
"model_revision": "v0.0.1",
|
|
@@ -8,16 +9,39 @@
|
|
|
8
9
|
},
|
|
9
10
|
{
|
|
10
11
|
"model_name": "bge-reranker-large",
|
|
12
|
+
"type": "normal",
|
|
11
13
|
"language": ["en", "zh"],
|
|
12
14
|
"model_id": "Xorbits/bge-reranker-large",
|
|
13
15
|
"model_revision": "v0.0.1",
|
|
14
16
|
"model_hub": "modelscope"
|
|
15
17
|
},
|
|
16
|
-
|
|
18
|
+
{
|
|
17
19
|
"model_name": "bce-reranker-base_v1",
|
|
20
|
+
"type": "normal",
|
|
18
21
|
"language": ["en", "zh"],
|
|
19
22
|
"model_id": "maidalun/bce-reranker-base_v1",
|
|
20
23
|
"model_revision": "v0.0.1",
|
|
21
24
|
"model_hub": "modelscope"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"model_name": "bge-reranker-v2-m3",
|
|
28
|
+
"type": "normal",
|
|
29
|
+
"language": ["en", "zh", "multilingual"],
|
|
30
|
+
"model_id": "AI-ModelScope/bge-reranker-v2-m3",
|
|
31
|
+
"model_hub": "modelscope"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"model_name": "bge-reranker-v2-gemma",
|
|
35
|
+
"type": "LLM-based",
|
|
36
|
+
"language": ["en", "zh", "multilingual"],
|
|
37
|
+
"model_id": "AI-ModelScope/bge-reranker-v2-gemma",
|
|
38
|
+
"model_hub": "modelscope"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"model_name": "bge-reranker-v2-minicpm-layerwise",
|
|
42
|
+
"type": "LLM-based layerwise",
|
|
43
|
+
"language": ["en", "zh", "multilingual"],
|
|
44
|
+
"model_id": "zfffff/bge-reranker-v2-minicpm-layerwise",
|
|
45
|
+
"model_hub": "modelscope"
|
|
22
46
|
}
|
|
23
47
|
]
|
xinference/model/utils.py
CHANGED
|
@@ -17,7 +17,7 @@ import os
|
|
|
17
17
|
import shutil
|
|
18
18
|
from json import JSONDecodeError
|
|
19
19
|
from pathlib import Path
|
|
20
|
-
from typing import Any, Callable, Dict, Optional, Tuple
|
|
20
|
+
from typing import Any, Callable, Dict, Optional, Tuple, Union
|
|
21
21
|
|
|
22
22
|
from fsspec import AbstractFileSystem
|
|
23
23
|
|
|
@@ -415,3 +415,14 @@ def select_device(device):
|
|
|
415
415
|
raise ValueError(f"{device} is unavailable in your environment")
|
|
416
416
|
|
|
417
417
|
return device
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def convert_float_to_int_or_str(model_size: float) -> Union[int, str]:
|
|
421
|
+
"""convert float to int or string
|
|
422
|
+
|
|
423
|
+
if float can be presented as int, convert it to int, otherwise convert it to string
|
|
424
|
+
"""
|
|
425
|
+
if int(model_size) == model_size:
|
|
426
|
+
return int(model_size)
|
|
427
|
+
else:
|
|
428
|
+
return str(model_size)
|
xinference/types.py
CHANGED
|
@@ -450,3 +450,58 @@ class CreateChatCompletion(
|
|
|
450
450
|
CreateChatCompletionOpenAI,
|
|
451
451
|
):
|
|
452
452
|
pass
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
class LoRA:
|
|
456
|
+
def __init__(self, lora_name: str, local_path: str):
|
|
457
|
+
self.lora_name = lora_name
|
|
458
|
+
self.local_path = local_path
|
|
459
|
+
|
|
460
|
+
def to_dict(self):
|
|
461
|
+
return {
|
|
462
|
+
"lora_name": self.lora_name,
|
|
463
|
+
"local_path": self.local_path,
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
@classmethod
|
|
467
|
+
def from_dict(cls, data: Dict):
|
|
468
|
+
return cls(
|
|
469
|
+
lora_name=data["lora_name"],
|
|
470
|
+
local_path=data["local_path"],
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
class PeftModelConfig:
|
|
475
|
+
def __init__(
|
|
476
|
+
self,
|
|
477
|
+
peft_model: Optional[List[LoRA]] = None,
|
|
478
|
+
image_lora_load_kwargs: Optional[Dict] = None,
|
|
479
|
+
image_lora_fuse_kwargs: Optional[Dict] = None,
|
|
480
|
+
):
|
|
481
|
+
self.peft_model = peft_model
|
|
482
|
+
self.image_lora_load_kwargs = image_lora_load_kwargs
|
|
483
|
+
self.image_lora_fuse_kwargs = image_lora_fuse_kwargs
|
|
484
|
+
|
|
485
|
+
def to_dict(self):
|
|
486
|
+
return {
|
|
487
|
+
"lora_list": [lora.to_dict() for lora in self.peft_model]
|
|
488
|
+
if self.peft_model
|
|
489
|
+
else None,
|
|
490
|
+
"image_lora_load_kwargs": self.image_lora_load_kwargs,
|
|
491
|
+
"image_lora_fuse_kwargs": self.image_lora_fuse_kwargs,
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
@classmethod
|
|
495
|
+
def from_dict(cls, data: Dict):
|
|
496
|
+
peft_model_list = data.get("lora_list", None)
|
|
497
|
+
peft_model = (
|
|
498
|
+
[LoRA.from_dict(lora_dict) for lora_dict in peft_model_list]
|
|
499
|
+
if peft_model_list is not None
|
|
500
|
+
else None
|
|
501
|
+
)
|
|
502
|
+
|
|
503
|
+
return cls(
|
|
504
|
+
peft_model=peft_model,
|
|
505
|
+
image_lora_load_kwargs=data.get("image_lora_load_kwargs"),
|
|
506
|
+
image_lora_fuse_kwargs=data.get("image_lora_fuse_kwargs"),
|
|
507
|
+
)
|
xinference/utils.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.js": "./static/js/main.
|
|
3
|
+
"main.js": "./static/js/main.26fdbfbe.js",
|
|
4
4
|
"static/media/icon.webp": "./static/media/icon.4603d52c63041e5dfbfd.webp",
|
|
5
5
|
"index.html": "./index.html",
|
|
6
|
-
"main.
|
|
6
|
+
"main.26fdbfbe.js.map": "./static/js/main.26fdbfbe.js.map"
|
|
7
7
|
},
|
|
8
8
|
"entrypoints": [
|
|
9
|
-
"static/js/main.
|
|
9
|
+
"static/js/main.26fdbfbe.js"
|
|
10
10
|
]
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.svg"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>Xinference</title><script defer="defer" src="./static/js/main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.svg"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>Xinference</title><script defer="defer" src="./static/js/main.26fdbfbe.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|