xinference 0.16.3__py3-none-any.whl → 1.0.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 (69) hide show
  1. xinference/_compat.py +22 -2
  2. xinference/_version.py +3 -3
  3. xinference/api/restful_api.py +148 -12
  4. xinference/client/restful/restful_client.py +47 -2
  5. xinference/constants.py +1 -0
  6. xinference/core/model.py +45 -15
  7. xinference/core/supervisor.py +8 -2
  8. xinference/core/utils.py +67 -2
  9. xinference/model/audio/__init__.py +12 -0
  10. xinference/model/audio/core.py +21 -4
  11. xinference/model/audio/fish_speech.py +70 -35
  12. xinference/model/audio/model_spec.json +81 -1
  13. xinference/model/audio/whisper_mlx.py +208 -0
  14. xinference/model/embedding/core.py +259 -4
  15. xinference/model/embedding/model_spec.json +1 -1
  16. xinference/model/embedding/model_spec_modelscope.json +1 -1
  17. xinference/model/image/stable_diffusion/core.py +5 -2
  18. xinference/model/llm/__init__.py +2 -0
  19. xinference/model/llm/llm_family.json +485 -6
  20. xinference/model/llm/llm_family_modelscope.json +519 -0
  21. xinference/model/llm/mlx/core.py +45 -3
  22. xinference/model/llm/sglang/core.py +1 -0
  23. xinference/model/llm/transformers/core.py +1 -0
  24. xinference/model/llm/transformers/glm_edge_v.py +230 -0
  25. xinference/model/llm/utils.py +19 -0
  26. xinference/model/llm/vllm/core.py +84 -2
  27. xinference/model/rerank/core.py +11 -4
  28. xinference/thirdparty/fish_speech/fish_speech/conversation.py +254 -0
  29. xinference/thirdparty/fish_speech/fish_speech/i18n/locale/en_US.json +2 -1
  30. xinference/thirdparty/fish_speech/fish_speech/i18n/locale/es_ES.json +2 -1
  31. xinference/thirdparty/fish_speech/fish_speech/i18n/locale/ja_JP.json +2 -2
  32. xinference/thirdparty/fish_speech/fish_speech/i18n/locale/ko_KR.json +123 -0
  33. xinference/thirdparty/fish_speech/fish_speech/i18n/locale/zh_CN.json +2 -1
  34. xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/llama.py +76 -11
  35. xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/firefly.py +9 -9
  36. xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/fsq.py +1 -1
  37. xinference/thirdparty/fish_speech/fish_speech/text/clean.py +32 -1
  38. xinference/thirdparty/fish_speech/fish_speech/utils/__init__.py +2 -1
  39. xinference/thirdparty/fish_speech/fish_speech/utils/utils.py +22 -0
  40. xinference/thirdparty/fish_speech/fish_speech/webui/launch_utils.py +1 -1
  41. xinference/thirdparty/fish_speech/fish_speech/webui/manage.py +1 -1
  42. xinference/thirdparty/fish_speech/tools/api.py +578 -75
  43. xinference/thirdparty/fish_speech/tools/e2e_webui.py +232 -0
  44. xinference/thirdparty/fish_speech/tools/fish_e2e.py +298 -0
  45. xinference/thirdparty/fish_speech/tools/llama/generate.py +393 -9
  46. xinference/thirdparty/fish_speech/tools/msgpack_api.py +90 -29
  47. xinference/thirdparty/fish_speech/tools/post_api.py +37 -15
  48. xinference/thirdparty/fish_speech/tools/schema.py +187 -0
  49. xinference/thirdparty/fish_speech/tools/vqgan/extract_vq.py +7 -1
  50. xinference/thirdparty/fish_speech/tools/vqgan/inference.py +2 -3
  51. xinference/thirdparty/fish_speech/tools/webui.py +138 -75
  52. xinference/types.py +2 -1
  53. {xinference-0.16.3.dist-info → xinference-1.0.1.dist-info}/METADATA +30 -6
  54. {xinference-0.16.3.dist-info → xinference-1.0.1.dist-info}/RECORD +58 -63
  55. {xinference-0.16.3.dist-info → xinference-1.0.1.dist-info}/WHEEL +1 -1
  56. xinference/thirdparty/fish_speech/fish_speech/configs/__init__.py +0 -0
  57. xinference/thirdparty/fish_speech/fish_speech/configs/lora/__init__.py +0 -0
  58. xinference/thirdparty/fish_speech/fish_speech/datasets/__init__.py +0 -0
  59. xinference/thirdparty/fish_speech/fish_speech/datasets/protos/__init__.py +0 -0
  60. xinference/thirdparty/fish_speech/fish_speech/i18n/locale/__init__.py +0 -0
  61. xinference/thirdparty/fish_speech/fish_speech/models/__init__.py +0 -0
  62. xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/__init__.py +0 -0
  63. xinference/thirdparty/fish_speech/fish_speech/webui/__init__.py +0 -0
  64. xinference/thirdparty/fish_speech/tools/commons.py +0 -35
  65. xinference/thirdparty/fish_speech/tools/llama/__init__.py +0 -0
  66. xinference/thirdparty/fish_speech/tools/vqgan/__init__.py +0 -0
  67. {xinference-0.16.3.dist-info → xinference-1.0.1.dist-info}/LICENSE +0 -0
  68. {xinference-0.16.3.dist-info → xinference-1.0.1.dist-info}/entry_points.txt +0 -0
  69. {xinference-0.16.3.dist-info → xinference-1.0.1.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
  )
@@ -794,7 +794,7 @@ with gr.Blocks(
794
794
  value="VQGAN",
795
795
  )
796
796
  with gr.Row():
797
- with gr.Tabs():
797
+ with gr.Column():
798
798
  with gr.Tab(label=i18n("VQGAN Configuration")) as vqgan_page:
799
799
  gr.HTML("You don't need to train this model!")
800
800