xinference 0.16.2__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xinference might be problematic. Click here for more details.
- xinference/_version.py +3 -3
- xinference/api/restful_api.py +62 -11
- xinference/client/restful/restful_client.py +8 -2
- xinference/conftest.py +0 -8
- xinference/constants.py +2 -0
- xinference/core/model.py +44 -5
- xinference/core/supervisor.py +13 -7
- xinference/core/utils.py +76 -12
- xinference/core/worker.py +5 -4
- xinference/deploy/cmdline.py +5 -0
- xinference/deploy/utils.py +7 -4
- xinference/model/audio/model_spec.json +2 -2
- xinference/model/image/stable_diffusion/core.py +5 -2
- xinference/model/llm/core.py +1 -3
- xinference/model/llm/llm_family.json +263 -4
- xinference/model/llm/llm_family_modelscope.json +302 -0
- xinference/model/llm/mlx/core.py +45 -2
- xinference/model/llm/vllm/core.py +2 -1
- xinference/model/rerank/core.py +11 -4
- xinference/thirdparty/fish_speech/fish_speech/conversation.py +254 -0
- xinference/thirdparty/fish_speech/fish_speech/i18n/locale/en_US.json +2 -1
- xinference/thirdparty/fish_speech/fish_speech/i18n/locale/es_ES.json +2 -1
- xinference/thirdparty/fish_speech/fish_speech/i18n/locale/ja_JP.json +2 -2
- xinference/thirdparty/fish_speech/fish_speech/i18n/locale/ko_KR.json +123 -0
- xinference/thirdparty/fish_speech/fish_speech/i18n/locale/zh_CN.json +2 -1
- xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/llama.py +76 -11
- xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/firefly.py +9 -9
- xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/fsq.py +1 -1
- xinference/thirdparty/fish_speech/fish_speech/text/clean.py +32 -1
- xinference/thirdparty/fish_speech/fish_speech/utils/__init__.py +2 -1
- xinference/thirdparty/fish_speech/fish_speech/utils/utils.py +22 -0
- xinference/thirdparty/fish_speech/fish_speech/webui/launch_utils.py +1 -1
- xinference/thirdparty/fish_speech/fish_speech/webui/manage.py +1 -1
- xinference/thirdparty/fish_speech/tools/api.py +578 -75
- xinference/thirdparty/fish_speech/tools/e2e_webui.py +232 -0
- xinference/thirdparty/fish_speech/tools/fish_e2e.py +298 -0
- xinference/thirdparty/fish_speech/tools/llama/generate.py +393 -9
- xinference/thirdparty/fish_speech/tools/msgpack_api.py +90 -29
- xinference/thirdparty/fish_speech/tools/post_api.py +37 -15
- xinference/thirdparty/fish_speech/tools/schema.py +187 -0
- xinference/thirdparty/fish_speech/tools/vqgan/extract_vq.py +7 -1
- xinference/thirdparty/fish_speech/tools/vqgan/inference.py +2 -3
- xinference/thirdparty/fish_speech/tools/webui.py +138 -75
- {xinference-0.16.2.dist-info → xinference-1.0.0.dist-info}/METADATA +26 -3
- {xinference-0.16.2.dist-info → xinference-1.0.0.dist-info}/RECORD +49 -56
- {xinference-0.16.2.dist-info → xinference-1.0.0.dist-info}/WHEEL +1 -1
- xinference/thirdparty/fish_speech/fish_speech/configs/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/configs/lora/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/datasets/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/datasets/protos/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/i18n/locale/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/models/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/__init__.py +0 -0
- xinference/thirdparty/fish_speech/fish_speech/webui/__init__.py +0 -0
- xinference/thirdparty/fish_speech/tools/commons.py +0 -35
- xinference/thirdparty/fish_speech/tools/llama/__init__.py +0 -0
- xinference/thirdparty/fish_speech/tools/vqgan/__init__.py +0 -0
- {xinference-0.16.2.dist-info → xinference-1.0.0.dist-info}/LICENSE +0 -0
- {xinference-0.16.2.dist-info → xinference-1.0.0.dist-info}/entry_points.txt +0 -0
- {xinference-0.16.2.dist-info → xinference-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import re
|
|
2
2
|
|
|
3
3
|
SYMBOLS_MAPPING = {
|
|
4
|
+
"\n": "",
|
|
5
|
+
"…": ".",
|
|
4
6
|
"“": "'",
|
|
5
7
|
"”": "'",
|
|
6
8
|
"‘": "'",
|
|
@@ -13,7 +15,19 @@ SYMBOLS_MAPPING = {
|
|
|
13
15
|
")": "",
|
|
14
16
|
"(": "",
|
|
15
17
|
")": "",
|
|
16
|
-
"・": "
|
|
18
|
+
"・": "",
|
|
19
|
+
"·": "",
|
|
20
|
+
"「": "'",
|
|
21
|
+
"」": "'",
|
|
22
|
+
"《": "'",
|
|
23
|
+
"》": "'",
|
|
24
|
+
"—": "",
|
|
25
|
+
"~": "",
|
|
26
|
+
"~": "",
|
|
27
|
+
":": ",",
|
|
28
|
+
";": ",",
|
|
29
|
+
";": ",",
|
|
30
|
+
":": ",",
|
|
17
31
|
}
|
|
18
32
|
|
|
19
33
|
REPLACE_SYMBOL_REGEX = re.compile(
|
|
@@ -21,6 +35,17 @@ REPLACE_SYMBOL_REGEX = re.compile(
|
|
|
21
35
|
)
|
|
22
36
|
|
|
23
37
|
|
|
38
|
+
EMOJI_REGEX = re.compile(
|
|
39
|
+
"["
|
|
40
|
+
"\U0001F600-\U0001F64F" # emoticons
|
|
41
|
+
"\U0001F300-\U0001F5FF" # symbols & pictographs
|
|
42
|
+
"\U0001F680-\U0001F6FF" # transport & map symbols
|
|
43
|
+
"\U0001F1E0-\U0001F1FF" # flags (iOS)
|
|
44
|
+
"]+",
|
|
45
|
+
flags=re.UNICODE,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
24
49
|
def clean_text(text):
|
|
25
50
|
# Clean the text
|
|
26
51
|
text = text.strip()
|
|
@@ -28,4 +53,10 @@ def clean_text(text):
|
|
|
28
53
|
# Replace all chinese symbols with their english counterparts
|
|
29
54
|
text = REPLACE_SYMBOL_REGEX.sub(lambda x: SYMBOLS_MAPPING[x.group()], text)
|
|
30
55
|
|
|
56
|
+
# Remove emojis
|
|
57
|
+
text = EMOJI_REGEX.sub(r"", text)
|
|
58
|
+
|
|
59
|
+
# Remove continuous periods (...) and commas (,,,)
|
|
60
|
+
text = re.sub(r"[.,]{2,}", lambda m: m.group()[0], text)
|
|
61
|
+
|
|
31
62
|
return text
|
|
@@ -5,7 +5,7 @@ from .instantiators import instantiate_callbacks, instantiate_loggers
|
|
|
5
5
|
from .logger import RankedLogger
|
|
6
6
|
from .logging_utils import log_hyperparameters
|
|
7
7
|
from .rich_utils import enforce_tags, print_config_tree
|
|
8
|
-
from .utils import extras, get_metric_value, task_wrapper
|
|
8
|
+
from .utils import extras, get_metric_value, set_seed, task_wrapper
|
|
9
9
|
|
|
10
10
|
__all__ = [
|
|
11
11
|
"enforce_tags",
|
|
@@ -20,4 +20,5 @@ __all__ = [
|
|
|
20
20
|
"braceexpand",
|
|
21
21
|
"get_latest_checkpoint",
|
|
22
22
|
"autocast_exclude_mps",
|
|
23
|
+
"set_seed",
|
|
23
24
|
]
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import random
|
|
1
2
|
import warnings
|
|
2
3
|
from importlib.util import find_spec
|
|
3
4
|
from typing import Callable
|
|
4
5
|
|
|
6
|
+
import numpy as np
|
|
7
|
+
import torch
|
|
5
8
|
from omegaconf import DictConfig
|
|
6
9
|
|
|
7
10
|
from .logger import RankedLogger
|
|
@@ -112,3 +115,22 @@ def get_metric_value(metric_dict: dict, metric_name: str) -> float:
|
|
|
112
115
|
log.info(f"Retrieved metric value! <{metric_name}={metric_value}>")
|
|
113
116
|
|
|
114
117
|
return metric_value
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def set_seed(seed: int):
|
|
121
|
+
if seed < 0:
|
|
122
|
+
seed = -seed
|
|
123
|
+
if seed > (1 << 31):
|
|
124
|
+
seed = 1 << 31
|
|
125
|
+
|
|
126
|
+
random.seed(seed)
|
|
127
|
+
np.random.seed(seed)
|
|
128
|
+
torch.manual_seed(seed)
|
|
129
|
+
|
|
130
|
+
if torch.cuda.is_available():
|
|
131
|
+
torch.cuda.manual_seed(seed)
|
|
132
|
+
torch.cuda.manual_seed_all(seed)
|
|
133
|
+
|
|
134
|
+
if torch.backends.cudnn.is_available():
|
|
135
|
+
torch.backends.cudnn.deterministic = True
|
|
136
|
+
torch.backends.cudnn.benchmark = False
|
|
@@ -114,7 +114,7 @@ class Seafoam(Base):
|
|
|
114
114
|
block_title_text_weight="600",
|
|
115
115
|
block_border_width="3px",
|
|
116
116
|
block_shadow="*shadow_drop_lg",
|
|
117
|
-
button_shadow="*shadow_drop_lg",
|
|
117
|
+
# button_shadow="*shadow_drop_lg",
|
|
118
118
|
button_small_padding="0px",
|
|
119
119
|
button_large_padding="3px",
|
|
120
120
|
)
|