xinference 1.2.0__py3-none-any.whl → 1.2.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 +4 -7
- xinference/client/handlers.py +3 -0
- xinference/core/chat_interface.py +6 -1
- xinference/core/model.py +2 -0
- xinference/core/scheduler.py +4 -7
- xinference/core/supervisor.py +114 -23
- xinference/core/worker.py +70 -4
- xinference/deploy/local.py +2 -1
- xinference/model/audio/core.py +11 -0
- xinference/model/audio/cosyvoice.py +16 -5
- xinference/model/audio/kokoro.py +139 -0
- xinference/model/audio/melotts.py +110 -0
- xinference/model/audio/model_spec.json +80 -0
- xinference/model/audio/model_spec_modelscope.json +18 -0
- xinference/model/audio/whisper.py +35 -10
- xinference/model/llm/llama_cpp/core.py +21 -14
- xinference/model/llm/llm_family.json +527 -1
- xinference/model/llm/llm_family.py +4 -1
- xinference/model/llm/llm_family_modelscope.json +495 -3
- xinference/model/llm/memory.py +1 -1
- xinference/model/llm/mlx/core.py +24 -6
- xinference/model/llm/transformers/core.py +9 -1
- xinference/model/llm/transformers/qwen2_audio.py +3 -1
- xinference/model/llm/transformers/qwen2_vl.py +20 -3
- xinference/model/llm/transformers/utils.py +22 -11
- xinference/model/llm/utils.py +115 -1
- xinference/model/llm/vllm/core.py +14 -4
- xinference/model/llm/vllm/xavier/block.py +3 -4
- xinference/model/llm/vllm/xavier/block_tracker.py +71 -58
- xinference/model/llm/vllm/xavier/collective.py +74 -0
- xinference/model/llm/vllm/xavier/collective_manager.py +147 -0
- xinference/model/llm/vllm/xavier/executor.py +18 -16
- xinference/model/llm/vllm/xavier/scheduler.py +79 -63
- xinference/model/llm/vllm/xavier/test/test_xavier.py +60 -35
- xinference/model/llm/vllm/xavier/transfer.py +53 -32
- xinference/thirdparty/cosyvoice/bin/spk2info.pt +0 -0
- xinference/thirdparty/melo/__init__.py +0 -0
- xinference/thirdparty/melo/api.py +135 -0
- xinference/thirdparty/melo/app.py +61 -0
- xinference/thirdparty/melo/attentions.py +459 -0
- xinference/thirdparty/melo/commons.py +160 -0
- xinference/thirdparty/melo/configs/config.json +94 -0
- xinference/thirdparty/melo/data/example/metadata.list +20 -0
- xinference/thirdparty/melo/data_utils.py +413 -0
- xinference/thirdparty/melo/download_utils.py +67 -0
- xinference/thirdparty/melo/infer.py +25 -0
- xinference/thirdparty/melo/init_downloads.py +14 -0
- xinference/thirdparty/melo/losses.py +58 -0
- xinference/thirdparty/melo/main.py +36 -0
- xinference/thirdparty/melo/mel_processing.py +174 -0
- xinference/thirdparty/melo/models.py +1030 -0
- xinference/thirdparty/melo/modules.py +598 -0
- xinference/thirdparty/melo/monotonic_align/__init__.py +16 -0
- xinference/thirdparty/melo/monotonic_align/core.py +46 -0
- xinference/thirdparty/melo/preprocess_text.py +135 -0
- xinference/thirdparty/melo/split_utils.py +174 -0
- xinference/thirdparty/melo/text/__init__.py +35 -0
- xinference/thirdparty/melo/text/chinese.py +199 -0
- xinference/thirdparty/melo/text/chinese_bert.py +107 -0
- xinference/thirdparty/melo/text/chinese_mix.py +253 -0
- xinference/thirdparty/melo/text/cleaner.py +36 -0
- xinference/thirdparty/melo/text/cleaner_multiling.py +110 -0
- xinference/thirdparty/melo/text/cmudict.rep +129530 -0
- xinference/thirdparty/melo/text/cmudict_cache.pickle +0 -0
- xinference/thirdparty/melo/text/english.py +284 -0
- xinference/thirdparty/melo/text/english_bert.py +39 -0
- xinference/thirdparty/melo/text/english_utils/__init__.py +0 -0
- xinference/thirdparty/melo/text/english_utils/abbreviations.py +35 -0
- xinference/thirdparty/melo/text/english_utils/number_norm.py +97 -0
- xinference/thirdparty/melo/text/english_utils/time_norm.py +47 -0
- xinference/thirdparty/melo/text/es_phonemizer/__init__.py +0 -0
- xinference/thirdparty/melo/text/es_phonemizer/base.py +140 -0
- xinference/thirdparty/melo/text/es_phonemizer/cleaner.py +109 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_symbols.json +79 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_symbols.txt +1 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_symbols_v2.json +83 -0
- xinference/thirdparty/melo/text/es_phonemizer/es_to_ipa.py +12 -0
- xinference/thirdparty/melo/text/es_phonemizer/example_ipa.txt +400 -0
- xinference/thirdparty/melo/text/es_phonemizer/gruut_wrapper.py +253 -0
- xinference/thirdparty/melo/text/es_phonemizer/punctuation.py +174 -0
- xinference/thirdparty/melo/text/es_phonemizer/spanish_symbols.txt +1 -0
- xinference/thirdparty/melo/text/es_phonemizer/test.ipynb +124 -0
- xinference/thirdparty/melo/text/fr_phonemizer/__init__.py +0 -0
- xinference/thirdparty/melo/text/fr_phonemizer/base.py +140 -0
- xinference/thirdparty/melo/text/fr_phonemizer/cleaner.py +122 -0
- xinference/thirdparty/melo/text/fr_phonemizer/en_symbols.json +78 -0
- xinference/thirdparty/melo/text/fr_phonemizer/example_ipa.txt +1 -0
- xinference/thirdparty/melo/text/fr_phonemizer/fr_symbols.json +89 -0
- xinference/thirdparty/melo/text/fr_phonemizer/fr_to_ipa.py +30 -0
- xinference/thirdparty/melo/text/fr_phonemizer/french_abbreviations.py +48 -0
- xinference/thirdparty/melo/text/fr_phonemizer/french_symbols.txt +1 -0
- xinference/thirdparty/melo/text/fr_phonemizer/gruut_wrapper.py +258 -0
- xinference/thirdparty/melo/text/fr_phonemizer/punctuation.py +172 -0
- xinference/thirdparty/melo/text/french.py +94 -0
- xinference/thirdparty/melo/text/french_bert.py +39 -0
- xinference/thirdparty/melo/text/japanese.py +647 -0
- xinference/thirdparty/melo/text/japanese_bert.py +49 -0
- xinference/thirdparty/melo/text/ko_dictionary.py +44 -0
- xinference/thirdparty/melo/text/korean.py +192 -0
- xinference/thirdparty/melo/text/opencpop-strict.txt +429 -0
- xinference/thirdparty/melo/text/spanish.py +122 -0
- xinference/thirdparty/melo/text/spanish_bert.py +39 -0
- xinference/thirdparty/melo/text/symbols.py +290 -0
- xinference/thirdparty/melo/text/tone_sandhi.py +769 -0
- xinference/thirdparty/melo/train.py +635 -0
- xinference/thirdparty/melo/train.sh +19 -0
- xinference/thirdparty/melo/transforms.py +209 -0
- xinference/thirdparty/melo/utils.py +424 -0
- xinference/types.py +2 -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.1eb206d1.js → main.b0936c54.js} +3 -3
- xinference/web/ui/build/static/js/main.b0936c54.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/a3ff866acddf34917a7ee399e0e571a4dfd8ba66d5057db885f243e16a6eb17d.json +1 -0
- {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/METADATA +37 -27
- {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/RECORD +122 -45
- xinference/web/ui/build/static/js/main.1eb206d1.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/2213d49de260e1f67c888081b18f120f5225462b829ae57c9e05a05cec83689d.json +0 -1
- /xinference/web/ui/build/static/js/{main.1eb206d1.js.LICENSE.txt → main.b0936c54.js.LICENSE.txt} +0 -0
- {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/LICENSE +0 -0
- {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/WHEEL +0 -0
- {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/entry_points.txt +0 -0
- {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""Set of default text cleaners"""
|
|
2
|
+
# TODO: pick the cleaner for languages dynamically
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
|
|
6
|
+
# Regular expression matching whitespace:
|
|
7
|
+
_whitespace_re = re.compile(r"\s+")
|
|
8
|
+
|
|
9
|
+
rep_map = {
|
|
10
|
+
":": ",",
|
|
11
|
+
";": ",",
|
|
12
|
+
",": ",",
|
|
13
|
+
"。": ".",
|
|
14
|
+
"!": "!",
|
|
15
|
+
"?": "?",
|
|
16
|
+
"\n": ".",
|
|
17
|
+
"·": ",",
|
|
18
|
+
"、": ",",
|
|
19
|
+
"...": ".",
|
|
20
|
+
"…": ".",
|
|
21
|
+
"$": ".",
|
|
22
|
+
"“": "'",
|
|
23
|
+
"”": "'",
|
|
24
|
+
"‘": "'",
|
|
25
|
+
"’": "'",
|
|
26
|
+
"(": "'",
|
|
27
|
+
")": "'",
|
|
28
|
+
"(": "'",
|
|
29
|
+
")": "'",
|
|
30
|
+
"《": "'",
|
|
31
|
+
"》": "'",
|
|
32
|
+
"【": "'",
|
|
33
|
+
"】": "'",
|
|
34
|
+
"[": "'",
|
|
35
|
+
"]": "'",
|
|
36
|
+
"—": "",
|
|
37
|
+
"~": "-",
|
|
38
|
+
"~": "-",
|
|
39
|
+
"「": "'",
|
|
40
|
+
"」": "'",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
def replace_punctuation(text):
|
|
44
|
+
pattern = re.compile("|".join(re.escape(p) for p in rep_map.keys()))
|
|
45
|
+
replaced_text = pattern.sub(lambda x: rep_map[x.group()], text)
|
|
46
|
+
return replaced_text
|
|
47
|
+
|
|
48
|
+
def lowercase(text):
|
|
49
|
+
return text.lower()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def collapse_whitespace(text):
|
|
53
|
+
return re.sub(_whitespace_re, " ", text).strip()
|
|
54
|
+
|
|
55
|
+
def remove_punctuation_at_begin(text):
|
|
56
|
+
return re.sub(r'^[,.!?]+', '', text)
|
|
57
|
+
|
|
58
|
+
def remove_aux_symbols(text):
|
|
59
|
+
text = re.sub(r"[\<\>\(\)\[\]\"\«\»\']+", "", text)
|
|
60
|
+
return text
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def replace_symbols(text, lang="en"):
|
|
64
|
+
"""Replace symbols based on the lenguage tag.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
text:
|
|
68
|
+
Input text.
|
|
69
|
+
lang:
|
|
70
|
+
Lenguage identifier. ex: "en", "fr", "pt", "ca".
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
The modified text
|
|
74
|
+
example:
|
|
75
|
+
input args:
|
|
76
|
+
text: "si l'avi cau, diguem-ho"
|
|
77
|
+
lang: "ca"
|
|
78
|
+
Output:
|
|
79
|
+
text: "si lavi cau, diguemho"
|
|
80
|
+
"""
|
|
81
|
+
text = text.replace(";", ",")
|
|
82
|
+
text = text.replace("-", " ") if lang != "ca" else text.replace("-", "")
|
|
83
|
+
text = text.replace(":", ",")
|
|
84
|
+
if lang == "en":
|
|
85
|
+
text = text.replace("&", " and ")
|
|
86
|
+
elif lang == "fr":
|
|
87
|
+
text = text.replace("&", " et ")
|
|
88
|
+
elif lang == "pt":
|
|
89
|
+
text = text.replace("&", " e ")
|
|
90
|
+
elif lang == "ca":
|
|
91
|
+
text = text.replace("&", " i ")
|
|
92
|
+
text = text.replace("'", "")
|
|
93
|
+
elif lang== "es":
|
|
94
|
+
text=text.replace("&","y")
|
|
95
|
+
text = text.replace("'", "")
|
|
96
|
+
return text
|
|
97
|
+
|
|
98
|
+
def spanish_cleaners(text):
|
|
99
|
+
"""Basic pipeline for Portuguese text. There is no need to expand abbreviation and
|
|
100
|
+
numbers, phonemizer already does that"""
|
|
101
|
+
text = lowercase(text)
|
|
102
|
+
text = replace_symbols(text, lang="es")
|
|
103
|
+
text = replace_punctuation(text)
|
|
104
|
+
text = remove_aux_symbols(text)
|
|
105
|
+
text = remove_punctuation_at_begin(text)
|
|
106
|
+
text = collapse_whitespace(text)
|
|
107
|
+
text = re.sub(r'([^\.,!\?\-…])$', r'\1.', text)
|
|
108
|
+
return text
|
|
109
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"symbols": [
|
|
3
|
+
"_",
|
|
4
|
+
",",
|
|
5
|
+
".",
|
|
6
|
+
"!",
|
|
7
|
+
"?",
|
|
8
|
+
"-",
|
|
9
|
+
"~",
|
|
10
|
+
"\u2026",
|
|
11
|
+
"N",
|
|
12
|
+
"Q",
|
|
13
|
+
"a",
|
|
14
|
+
"b",
|
|
15
|
+
"d",
|
|
16
|
+
"e",
|
|
17
|
+
"f",
|
|
18
|
+
"g",
|
|
19
|
+
"h",
|
|
20
|
+
"i",
|
|
21
|
+
"j",
|
|
22
|
+
"k",
|
|
23
|
+
"l",
|
|
24
|
+
"m",
|
|
25
|
+
"n",
|
|
26
|
+
"o",
|
|
27
|
+
"p",
|
|
28
|
+
"s",
|
|
29
|
+
"t",
|
|
30
|
+
"u",
|
|
31
|
+
"v",
|
|
32
|
+
"w",
|
|
33
|
+
"x",
|
|
34
|
+
"y",
|
|
35
|
+
"z",
|
|
36
|
+
"\u0251",
|
|
37
|
+
"\u00e6",
|
|
38
|
+
"\u0283",
|
|
39
|
+
"\u0291",
|
|
40
|
+
"\u00e7",
|
|
41
|
+
"\u026f",
|
|
42
|
+
"\u026a",
|
|
43
|
+
"\u0254",
|
|
44
|
+
"\u025b",
|
|
45
|
+
"\u0279",
|
|
46
|
+
"\u00f0",
|
|
47
|
+
"\u0259",
|
|
48
|
+
"\u026b",
|
|
49
|
+
"\u0265",
|
|
50
|
+
"\u0278",
|
|
51
|
+
"\u028a",
|
|
52
|
+
"\u027e",
|
|
53
|
+
"\u0292",
|
|
54
|
+
"\u03b8",
|
|
55
|
+
"\u03b2",
|
|
56
|
+
"\u014b",
|
|
57
|
+
"\u0266",
|
|
58
|
+
"\u207c",
|
|
59
|
+
"\u02b0",
|
|
60
|
+
"`",
|
|
61
|
+
"^",
|
|
62
|
+
"#",
|
|
63
|
+
"*",
|
|
64
|
+
"=",
|
|
65
|
+
"\u02c8",
|
|
66
|
+
"\u02cc",
|
|
67
|
+
"\u2192",
|
|
68
|
+
"\u2193",
|
|
69
|
+
"\u2191",
|
|
70
|
+
" ",
|
|
71
|
+
"\u0263",
|
|
72
|
+
"\u0261",
|
|
73
|
+
"r",
|
|
74
|
+
"\u0272",
|
|
75
|
+
"\u029d",
|
|
76
|
+
"\u028e",
|
|
77
|
+
"\u02d0"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
_,.!?-~…NQabdefghijklmnopstuvwxyzɑæʃʑçɯɪɔɛɹðəɫɥɸʊɾʒθβŋɦ⁼ʰ`^#*=ˈˌ→↓↑ ɡrɲʝɣʎː—¿¡
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"symbols": [
|
|
3
|
+
"_",
|
|
4
|
+
",",
|
|
5
|
+
".",
|
|
6
|
+
"!",
|
|
7
|
+
"?",
|
|
8
|
+
"-",
|
|
9
|
+
"~",
|
|
10
|
+
"\u2026",
|
|
11
|
+
"N",
|
|
12
|
+
"Q",
|
|
13
|
+
"a",
|
|
14
|
+
"b",
|
|
15
|
+
"d",
|
|
16
|
+
"e",
|
|
17
|
+
"f",
|
|
18
|
+
"g",
|
|
19
|
+
"h",
|
|
20
|
+
"i",
|
|
21
|
+
"j",
|
|
22
|
+
"k",
|
|
23
|
+
"l",
|
|
24
|
+
"m",
|
|
25
|
+
"n",
|
|
26
|
+
"o",
|
|
27
|
+
"p",
|
|
28
|
+
"s",
|
|
29
|
+
"t",
|
|
30
|
+
"u",
|
|
31
|
+
"v",
|
|
32
|
+
"w",
|
|
33
|
+
"x",
|
|
34
|
+
"y",
|
|
35
|
+
"z",
|
|
36
|
+
"\u0251",
|
|
37
|
+
"\u00e6",
|
|
38
|
+
"\u0283",
|
|
39
|
+
"\u0291",
|
|
40
|
+
"\u00e7",
|
|
41
|
+
"\u026f",
|
|
42
|
+
"\u026a",
|
|
43
|
+
"\u0254",
|
|
44
|
+
"\u025b",
|
|
45
|
+
"\u0279",
|
|
46
|
+
"\u00f0",
|
|
47
|
+
"\u0259",
|
|
48
|
+
"\u026b",
|
|
49
|
+
"\u0265",
|
|
50
|
+
"\u0278",
|
|
51
|
+
"\u028a",
|
|
52
|
+
"\u027e",
|
|
53
|
+
"\u0292",
|
|
54
|
+
"\u03b8",
|
|
55
|
+
"\u03b2",
|
|
56
|
+
"\u014b",
|
|
57
|
+
"\u0266",
|
|
58
|
+
"\u207c",
|
|
59
|
+
"\u02b0",
|
|
60
|
+
"`",
|
|
61
|
+
"^",
|
|
62
|
+
"#",
|
|
63
|
+
"*",
|
|
64
|
+
"=",
|
|
65
|
+
"\u02c8",
|
|
66
|
+
"\u02cc",
|
|
67
|
+
"\u2192",
|
|
68
|
+
"\u2193",
|
|
69
|
+
"\u2191",
|
|
70
|
+
" ",
|
|
71
|
+
"\u0261",
|
|
72
|
+
"r",
|
|
73
|
+
"\u0272",
|
|
74
|
+
"\u029d",
|
|
75
|
+
"\u0263",
|
|
76
|
+
"\u028e",
|
|
77
|
+
"\u02d0",
|
|
78
|
+
|
|
79
|
+
"\u2014",
|
|
80
|
+
"\u00bf",
|
|
81
|
+
"\u00a1"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from .cleaner import spanish_cleaners
|
|
2
|
+
from .gruut_wrapper import Gruut
|
|
3
|
+
|
|
4
|
+
def es2ipa(text):
|
|
5
|
+
e = Gruut(language="es-es", keep_puncs=True, keep_stress=True, use_espeak_phonemes=True)
|
|
6
|
+
# text = spanish_cleaners(text)
|
|
7
|
+
phonemes = e.phonemize(text, separator="")
|
|
8
|
+
return phonemes
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
if __name__ == '__main__':
|
|
12
|
+
print(es2ipa('¿Y a quién echaría de menos, en el mundo si no fuese a vos?'))
|