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.

Files changed (124) hide show
  1. xinference/_version.py +3 -3
  2. xinference/api/restful_api.py +4 -7
  3. xinference/client/handlers.py +3 -0
  4. xinference/core/chat_interface.py +6 -1
  5. xinference/core/model.py +2 -0
  6. xinference/core/scheduler.py +4 -7
  7. xinference/core/supervisor.py +114 -23
  8. xinference/core/worker.py +70 -4
  9. xinference/deploy/local.py +2 -1
  10. xinference/model/audio/core.py +11 -0
  11. xinference/model/audio/cosyvoice.py +16 -5
  12. xinference/model/audio/kokoro.py +139 -0
  13. xinference/model/audio/melotts.py +110 -0
  14. xinference/model/audio/model_spec.json +80 -0
  15. xinference/model/audio/model_spec_modelscope.json +18 -0
  16. xinference/model/audio/whisper.py +35 -10
  17. xinference/model/llm/llama_cpp/core.py +21 -14
  18. xinference/model/llm/llm_family.json +527 -1
  19. xinference/model/llm/llm_family.py +4 -1
  20. xinference/model/llm/llm_family_modelscope.json +495 -3
  21. xinference/model/llm/memory.py +1 -1
  22. xinference/model/llm/mlx/core.py +24 -6
  23. xinference/model/llm/transformers/core.py +9 -1
  24. xinference/model/llm/transformers/qwen2_audio.py +3 -1
  25. xinference/model/llm/transformers/qwen2_vl.py +20 -3
  26. xinference/model/llm/transformers/utils.py +22 -11
  27. xinference/model/llm/utils.py +115 -1
  28. xinference/model/llm/vllm/core.py +14 -4
  29. xinference/model/llm/vllm/xavier/block.py +3 -4
  30. xinference/model/llm/vllm/xavier/block_tracker.py +71 -58
  31. xinference/model/llm/vllm/xavier/collective.py +74 -0
  32. xinference/model/llm/vllm/xavier/collective_manager.py +147 -0
  33. xinference/model/llm/vllm/xavier/executor.py +18 -16
  34. xinference/model/llm/vllm/xavier/scheduler.py +79 -63
  35. xinference/model/llm/vllm/xavier/test/test_xavier.py +60 -35
  36. xinference/model/llm/vllm/xavier/transfer.py +53 -32
  37. xinference/thirdparty/cosyvoice/bin/spk2info.pt +0 -0
  38. xinference/thirdparty/melo/__init__.py +0 -0
  39. xinference/thirdparty/melo/api.py +135 -0
  40. xinference/thirdparty/melo/app.py +61 -0
  41. xinference/thirdparty/melo/attentions.py +459 -0
  42. xinference/thirdparty/melo/commons.py +160 -0
  43. xinference/thirdparty/melo/configs/config.json +94 -0
  44. xinference/thirdparty/melo/data/example/metadata.list +20 -0
  45. xinference/thirdparty/melo/data_utils.py +413 -0
  46. xinference/thirdparty/melo/download_utils.py +67 -0
  47. xinference/thirdparty/melo/infer.py +25 -0
  48. xinference/thirdparty/melo/init_downloads.py +14 -0
  49. xinference/thirdparty/melo/losses.py +58 -0
  50. xinference/thirdparty/melo/main.py +36 -0
  51. xinference/thirdparty/melo/mel_processing.py +174 -0
  52. xinference/thirdparty/melo/models.py +1030 -0
  53. xinference/thirdparty/melo/modules.py +598 -0
  54. xinference/thirdparty/melo/monotonic_align/__init__.py +16 -0
  55. xinference/thirdparty/melo/monotonic_align/core.py +46 -0
  56. xinference/thirdparty/melo/preprocess_text.py +135 -0
  57. xinference/thirdparty/melo/split_utils.py +174 -0
  58. xinference/thirdparty/melo/text/__init__.py +35 -0
  59. xinference/thirdparty/melo/text/chinese.py +199 -0
  60. xinference/thirdparty/melo/text/chinese_bert.py +107 -0
  61. xinference/thirdparty/melo/text/chinese_mix.py +253 -0
  62. xinference/thirdparty/melo/text/cleaner.py +36 -0
  63. xinference/thirdparty/melo/text/cleaner_multiling.py +110 -0
  64. xinference/thirdparty/melo/text/cmudict.rep +129530 -0
  65. xinference/thirdparty/melo/text/cmudict_cache.pickle +0 -0
  66. xinference/thirdparty/melo/text/english.py +284 -0
  67. xinference/thirdparty/melo/text/english_bert.py +39 -0
  68. xinference/thirdparty/melo/text/english_utils/__init__.py +0 -0
  69. xinference/thirdparty/melo/text/english_utils/abbreviations.py +35 -0
  70. xinference/thirdparty/melo/text/english_utils/number_norm.py +97 -0
  71. xinference/thirdparty/melo/text/english_utils/time_norm.py +47 -0
  72. xinference/thirdparty/melo/text/es_phonemizer/__init__.py +0 -0
  73. xinference/thirdparty/melo/text/es_phonemizer/base.py +140 -0
  74. xinference/thirdparty/melo/text/es_phonemizer/cleaner.py +109 -0
  75. xinference/thirdparty/melo/text/es_phonemizer/es_symbols.json +79 -0
  76. xinference/thirdparty/melo/text/es_phonemizer/es_symbols.txt +1 -0
  77. xinference/thirdparty/melo/text/es_phonemizer/es_symbols_v2.json +83 -0
  78. xinference/thirdparty/melo/text/es_phonemizer/es_to_ipa.py +12 -0
  79. xinference/thirdparty/melo/text/es_phonemizer/example_ipa.txt +400 -0
  80. xinference/thirdparty/melo/text/es_phonemizer/gruut_wrapper.py +253 -0
  81. xinference/thirdparty/melo/text/es_phonemizer/punctuation.py +174 -0
  82. xinference/thirdparty/melo/text/es_phonemizer/spanish_symbols.txt +1 -0
  83. xinference/thirdparty/melo/text/es_phonemizer/test.ipynb +124 -0
  84. xinference/thirdparty/melo/text/fr_phonemizer/__init__.py +0 -0
  85. xinference/thirdparty/melo/text/fr_phonemizer/base.py +140 -0
  86. xinference/thirdparty/melo/text/fr_phonemizer/cleaner.py +122 -0
  87. xinference/thirdparty/melo/text/fr_phonemizer/en_symbols.json +78 -0
  88. xinference/thirdparty/melo/text/fr_phonemizer/example_ipa.txt +1 -0
  89. xinference/thirdparty/melo/text/fr_phonemizer/fr_symbols.json +89 -0
  90. xinference/thirdparty/melo/text/fr_phonemizer/fr_to_ipa.py +30 -0
  91. xinference/thirdparty/melo/text/fr_phonemizer/french_abbreviations.py +48 -0
  92. xinference/thirdparty/melo/text/fr_phonemizer/french_symbols.txt +1 -0
  93. xinference/thirdparty/melo/text/fr_phonemizer/gruut_wrapper.py +258 -0
  94. xinference/thirdparty/melo/text/fr_phonemizer/punctuation.py +172 -0
  95. xinference/thirdparty/melo/text/french.py +94 -0
  96. xinference/thirdparty/melo/text/french_bert.py +39 -0
  97. xinference/thirdparty/melo/text/japanese.py +647 -0
  98. xinference/thirdparty/melo/text/japanese_bert.py +49 -0
  99. xinference/thirdparty/melo/text/ko_dictionary.py +44 -0
  100. xinference/thirdparty/melo/text/korean.py +192 -0
  101. xinference/thirdparty/melo/text/opencpop-strict.txt +429 -0
  102. xinference/thirdparty/melo/text/spanish.py +122 -0
  103. xinference/thirdparty/melo/text/spanish_bert.py +39 -0
  104. xinference/thirdparty/melo/text/symbols.py +290 -0
  105. xinference/thirdparty/melo/text/tone_sandhi.py +769 -0
  106. xinference/thirdparty/melo/train.py +635 -0
  107. xinference/thirdparty/melo/train.sh +19 -0
  108. xinference/thirdparty/melo/transforms.py +209 -0
  109. xinference/thirdparty/melo/utils.py +424 -0
  110. xinference/types.py +2 -0
  111. xinference/web/ui/build/asset-manifest.json +3 -3
  112. xinference/web/ui/build/index.html +1 -1
  113. xinference/web/ui/build/static/js/{main.1eb206d1.js → main.b0936c54.js} +3 -3
  114. xinference/web/ui/build/static/js/main.b0936c54.js.map +1 -0
  115. xinference/web/ui/node_modules/.cache/babel-loader/a3ff866acddf34917a7ee399e0e571a4dfd8ba66d5057db885f243e16a6eb17d.json +1 -0
  116. {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/METADATA +37 -27
  117. {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/RECORD +122 -45
  118. xinference/web/ui/build/static/js/main.1eb206d1.js.map +0 -1
  119. xinference/web/ui/node_modules/.cache/babel-loader/2213d49de260e1f67c888081b18f120f5225462b829ae57c9e05a05cec83689d.json +0 -1
  120. /xinference/web/ui/build/static/js/{main.1eb206d1.js.LICENSE.txt → main.b0936c54.js.LICENSE.txt} +0 -0
  121. {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/LICENSE +0 -0
  122. {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/WHEEL +0 -0
  123. {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/entry_points.txt +0 -0
  124. {xinference-1.2.0.dist-info → xinference-1.2.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,122 @@
1
+ """Set of default text cleaners"""
2
+ # TODO: pick the cleaner for languages dynamically
3
+
4
+ import re
5
+ from .french_abbreviations import abbreviations_fr
6
+
7
+ # Regular expression matching whitespace:
8
+ _whitespace_re = re.compile(r"\s+")
9
+
10
+
11
+ rep_map = {
12
+ ":": ",",
13
+ ";": ",",
14
+ ",": ",",
15
+ "。": ".",
16
+ "!": "!",
17
+ "?": "?",
18
+ "\n": ".",
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
+ "¿" : "",
44
+ "¡" : ""
45
+ }
46
+
47
+
48
+ def replace_punctuation(text):
49
+ pattern = re.compile("|".join(re.escape(p) for p in rep_map.keys()))
50
+ replaced_text = pattern.sub(lambda x: rep_map[x.group()], text)
51
+ return replaced_text
52
+
53
+ def expand_abbreviations(text, lang="fr"):
54
+ if lang == "fr":
55
+ _abbreviations = abbreviations_fr
56
+ for regex, replacement in _abbreviations:
57
+ text = re.sub(regex, replacement, text)
58
+ return text
59
+
60
+
61
+ def lowercase(text):
62
+ return text.lower()
63
+
64
+
65
+ def collapse_whitespace(text):
66
+ return re.sub(_whitespace_re, " ", text).strip()
67
+
68
+ def remove_punctuation_at_begin(text):
69
+ return re.sub(r'^[,.!?]+', '', text)
70
+
71
+ def remove_aux_symbols(text):
72
+ text = re.sub(r"[\<\>\(\)\[\]\"\«\»]+", "", text)
73
+ return text
74
+
75
+
76
+ def replace_symbols(text, lang="en"):
77
+ """Replace symbols based on the lenguage tag.
78
+
79
+ Args:
80
+ text:
81
+ Input text.
82
+ lang:
83
+ Lenguage identifier. ex: "en", "fr", "pt", "ca".
84
+
85
+ Returns:
86
+ The modified text
87
+ example:
88
+ input args:
89
+ text: "si l'avi cau, diguem-ho"
90
+ lang: "ca"
91
+ Output:
92
+ text: "si lavi cau, diguemho"
93
+ """
94
+ text = text.replace(";", ",")
95
+ text = text.replace("-", " ") if lang != "ca" else text.replace("-", "")
96
+ text = text.replace(":", ",")
97
+ if lang == "en":
98
+ text = text.replace("&", " and ")
99
+ elif lang == "fr":
100
+ text = text.replace("&", " et ")
101
+ elif lang == "pt":
102
+ text = text.replace("&", " e ")
103
+ elif lang == "ca":
104
+ text = text.replace("&", " i ")
105
+ text = text.replace("'", "")
106
+ elif lang== "es":
107
+ text=text.replace("&","y")
108
+ text = text.replace("'", "")
109
+ return text
110
+
111
+ def french_cleaners(text):
112
+ """Pipeline for French text. There is no need to expand numbers, phonemizer already does that"""
113
+ text = expand_abbreviations(text, lang="fr")
114
+ # text = lowercase(text) # as we use the cased bert
115
+ text = replace_punctuation(text)
116
+ text = replace_symbols(text, lang="fr")
117
+ text = remove_aux_symbols(text)
118
+ text = remove_punctuation_at_begin(text)
119
+ text = collapse_whitespace(text)
120
+ text = re.sub(r'([^\.,!\?\-…])$', r'\1.', text)
121
+ return text
122
+
@@ -0,0 +1,78 @@
1
+ {"symbols": [
2
+ "_",
3
+ ",",
4
+ ".",
5
+ "!",
6
+ "?",
7
+ "-",
8
+ "~",
9
+ "\u2026",
10
+ "N",
11
+ "Q",
12
+ "a",
13
+ "b",
14
+ "d",
15
+ "e",
16
+ "f",
17
+ "g",
18
+ "h",
19
+ "i",
20
+ "j",
21
+ "k",
22
+ "l",
23
+ "m",
24
+ "n",
25
+ "o",
26
+ "p",
27
+ "s",
28
+ "t",
29
+ "u",
30
+ "v",
31
+ "w",
32
+ "x",
33
+ "y",
34
+ "z",
35
+ "\u0251",
36
+ "\u00e6",
37
+ "\u0283",
38
+ "\u0291",
39
+ "\u00e7",
40
+ "\u026f",
41
+ "\u026a",
42
+ "\u0254",
43
+ "\u025b",
44
+ "\u0279",
45
+ "\u00f0",
46
+ "\u0259",
47
+ "\u026b",
48
+ "\u0265",
49
+ "\u0278",
50
+ "\u028a",
51
+ "\u027e",
52
+ "\u0292",
53
+ "\u03b8",
54
+ "\u03b2",
55
+ "\u014b",
56
+ "\u0266",
57
+ "\u207c",
58
+ "\u02b0",
59
+ "`",
60
+ "^",
61
+ "#",
62
+ "*",
63
+ "=",
64
+ "\u02c8",
65
+ "\u02cc",
66
+ "\u2192",
67
+ "\u2193",
68
+ "\u2191",
69
+ " ",
70
+ "ɣ",
71
+ "ɡ",
72
+ "r",
73
+ "ɲ",
74
+ "ʝ",
75
+ "ʎ",
76
+ "ː"
77
+ ]
78
+ }