Text-to-Speech
Transformers
ONNX
Safetensors
English
Chinese
bailing_moe_v3_audio
feature-extraction
audio
speech
automatic-speech-recognition
audio-understanding
audio-reasoning
speech-to-text
conversational
mixture-of-experts
custom_code
Instructions to use inclusionAI/Ming-3.0-audio-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/Ming-3.0-audio-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="inclusionAI/Ming-3.0-audio-tiny", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("inclusionAI/Ming-3.0-audio-tiny", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +10 -0
- chat_template.jinja +55 -67
- config.json +9 -11
- configuration_bailing_moe_v3_audio.py +2 -10
- generation_config.json +7 -0
- model-00001-of-00002.safetensors +2 -2
- model-00002-of-00002.safetensors +1 -1
- model.safetensors.index.json +62 -399
- modeling_bailing_moe_v3.py +34 -8
- modeling_bailing_moe_v3_audio.py +34 -15
- processing_bailing_moe_v3_audio.py +36 -8
- processor_config.json +6 -0
- talker/AudioVAE/__init__.py +0 -0
- talker/AudioVAE/__pycache__/__init__.cpython-312.pyc +0 -0
- talker/AudioVAE/__pycache__/configuration_audio_vae.cpython-312.pyc +0 -0
- talker/AudioVAE/__pycache__/istft.cpython-312.pyc +0 -0
- talker/AudioVAE/__pycache__/modeling_audio_vae.cpython-312.pyc +0 -0
- talker/AudioVAE/__pycache__/vae_modules.cpython-312.pyc +0 -0
- talker/AudioVAE/configuration_audio_vae.py +19 -0
- talker/AudioVAE/istft.py +181 -0
- talker/AudioVAE/modeling_audio_vae.py +80 -0
- talker/AudioVAE/vae_modules.py +204 -0
- talker/__init__.py +5 -0
- talker/__pycache__/__init__.cpython-312.pyc +0 -0
- talker/__pycache__/configuration_bailing_talker.cpython-312.pyc +0 -0
- talker/__pycache__/inference.cpython-312.pyc +0 -0
- talker/__pycache__/tts_prompt.cpython-312.pyc +0 -0
- talker/campplus.onnx +3 -0
- talker/config.json +35 -0
- talker/configuration_bailing_talker.py +20 -0
- talker/data/lid.176.LICENSE.md +10 -0
- talker/data/lid.176.ftz +3 -0
- talker/front/__init__.py +0 -0
- talker/front/__pycache__/__init__.cpython-312.pyc +0 -0
- talker/front/__pycache__/number_en.cpython-312.pyc +0 -0
- talker/front/__pycache__/text_segment_cut.cpython-312.pyc +0 -0
- talker/front/__pycache__/toolkit.cpython-312.pyc +0 -0
- talker/front/number_en.py +343 -0
- talker/front/text_segment_cut.py +388 -0
- talker/front/toolkit.py +240 -0
- talker/inference.py +443 -0
- talker/llm/added_tokens.json +75 -0
- talker/llm/config.json +27 -0
- talker/llm/generation_config.json +14 -0
- talker/llm/merges.txt +0 -0
- talker/llm/special_tokens_map.json +137 -0
- talker/llm/tokenizer.json +3 -0
- talker/llm/tokenizer_config.json +619 -0
- talker/llm/vocab.json +0 -0
- talker/model.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model-00001-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
model-00002-of-00002.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
talker/campplus.onnx filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
talker/data/lid.176.ftz filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
talker/llm/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
talker/model.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
talker/talker_tn/en_tn_tagger.fst filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
talker/talker_tn/en_tn_verbalizer.fst filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
talker/talker_tn/zh_tn_tagger.fst filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
talker/vae/model.safetensors filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
CHANGED
|
@@ -1,49 +1,34 @@
|
|
| 1 |
-
{#- Bailing V3
|
| 2 |
-
{#- Supports:
|
| 3 |
|
| 4 |
-
{#- ==================== thinking
|
| 5 |
-
{%- if enable_thinking is defined %}
|
| 6 |
-
{%-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
{%-
|
| 12 |
-
{%- set thinking_option = 'off' %}
|
| 13 |
{%- endif %}
|
| 14 |
|
| 15 |
-
{#- ====================
|
| 16 |
-
{%-
|
| 17 |
-
{%- set
|
|
|
|
| 18 |
|
| 19 |
{#- ==================== render_content macro ==================== -#}
|
| 20 |
-
{%- macro render_content(content
|
| 21 |
{%- if content is string %}
|
| 22 |
{{- content }}
|
| 23 |
{%- elif content is iterable and content is not mapping %}
|
| 24 |
{%- for item in content %}
|
| 25 |
-
{%-
|
| 26 |
-
|
| 27 |
-
{%- set image_count.value = image_count.value + 1 %}
|
| 28 |
-
{%- endif %}
|
| 29 |
-
{%- if add_vision_id is defined and add_vision_id %}
|
| 30 |
-
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 31 |
-
{%- endif %}
|
| 32 |
-
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 33 |
-
{%- elif item.type == 'audio' or 'audio' in item or 'audio_url' in item %}
|
| 34 |
{{- '<|audio_start|><|audio_pad|><|audio_end|>' }}
|
| 35 |
-
{%- elif
|
| 36 |
-
{%- if do_vision_count %}
|
| 37 |
-
{%- set video_count.value = video_count.value + 1 %}
|
| 38 |
-
{%- endif %}
|
| 39 |
-
{%- if add_vision_id is defined and add_vision_id %}
|
| 40 |
-
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 41 |
-
{%- endif %}
|
| 42 |
-
{{- '<|video_start|><|video_pad|><|video_end|>' }}
|
| 43 |
-
{%- elif item.type == 'text' or 'text' in item %}
|
| 44 |
{{- item.text }}
|
| 45 |
{%- else %}
|
| 46 |
-
{{- raise_exception('Unexpected item type in content list: each item must have type
|
| 47 |
{%- endif %}
|
| 48 |
{%- endfor %}
|
| 49 |
{%- elif content is none or content is undefined %}
|
|
@@ -60,14 +45,17 @@
|
|
| 60 |
|
| 61 |
{#- ==================== system message ==================== -#}
|
| 62 |
{{- '<role>SYSTEM</role>' }}
|
|
|
|
| 63 |
{%- if messages[0].role == 'system' %}
|
| 64 |
-
{%- set system_content = render_content(messages[0].content
|
|
|
|
|
|
|
|
|
|
| 65 |
{{- system_content }}
|
| 66 |
-
{%- if system_content and system_content[-1] != '\n' %}
|
| 67 |
{{- '\n' }}
|
| 68 |
{%- endif %}
|
| 69 |
{%- endif %}
|
| 70 |
-
{#- tools -#}
|
| 71 |
{%- if tools %}
|
| 72 |
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 73 |
{%- for tool in tools %}
|
|
@@ -76,19 +64,17 @@
|
|
| 76 |
{%- endfor %}
|
| 77 |
{{- "\n</tools>\n\nIf none of the functions can be used, point it out. If the given question lacks the parameters required by the function, also point it out.\nIf you need to use a function, for each function call, output the function name and arguments within the following XML format:\n<tool_call>{function-name}\n<arg_key>{arg-key-1}</arg_key>\n<arg_value>{arg-value-1}</arg_value>\n<arg_key>{arg-key-2}</arg_key>\n<arg_value>{arg-value-2}</arg_value>\n...\n</tool_call>\n" }}
|
| 78 |
{%- endif %}
|
| 79 |
-
{
|
| 80 |
-
{
|
| 81 |
-
{{- '<|role_end|>' }}
|
| 82 |
-
{%- else %}
|
| 83 |
-
{{- 'detailed thinking ' + thinking_option + '<|role_end|>' }}
|
| 84 |
{%- endif %}
|
|
|
|
| 85 |
|
| 86 |
{#- ==================== multi_step_tool: find last real user query ==================== -#}
|
| 87 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 88 |
{%- for message in messages[::-1] %}
|
| 89 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 90 |
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 91 |
-
{%- set user_content = render_content(message.content
|
| 92 |
{%- if not(user_content.startswith('<tool_response>') and user_content.endswith('</tool_response>')) %}
|
| 93 |
{%- set ns.multi_step_tool = false %}
|
| 94 |
{%- set ns.last_query_index = index %}
|
|
@@ -98,52 +84,52 @@
|
|
| 98 |
|
| 99 |
{#- ==================== message loop ==================== -#}
|
| 100 |
{%- for message in messages %}
|
| 101 |
-
{%- set content = render_content(message.content, true) %}
|
| 102 |
{%- if message.role == "user" %}
|
|
|
|
| 103 |
{{- '<role>HUMAN</role>' + content + '<|role_end|>' }}
|
| 104 |
{%- elif message.role == "system" %}
|
| 105 |
{%- if not loop.first %}
|
| 106 |
-
{
|
|
|
|
| 107 |
{%- endif %}
|
| 108 |
-
{#- system already rendered above; skip -#}
|
| 109 |
{%- elif message.role == "assistant" %}
|
|
|
|
| 110 |
{%- set reasoning_content = '' %}
|
| 111 |
-
{%- if
|
| 112 |
-
{%-
|
| 113 |
-
{%- set reasoning_content = message.reasoning_content %}
|
| 114 |
-
{%- else %}
|
| 115 |
-
{%- if '</think>' in content %}
|
| 116 |
-
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 117 |
-
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 118 |
-
{%- endif %}
|
| 119 |
-
{%- endif %}
|
| 120 |
{%- else %}
|
| 121 |
{%- if '</think>' in content %}
|
|
|
|
| 122 |
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 123 |
{%- endif %}
|
| 124 |
{%- endif %}
|
| 125 |
-
{%- if
|
| 126 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
{%- else %}
|
| 128 |
-
{{- '<role>ASSISTANT</role>' + content }}
|
| 129 |
{%- endif %}
|
| 130 |
{%- if message.tool_calls %}
|
| 131 |
{%- for tool_call in message.tool_calls %}
|
| 132 |
{%- if (loop.first and content) or (not loop.first) %}
|
| 133 |
{{- '\n' }}
|
| 134 |
{%- endif %}
|
|
|
|
| 135 |
{%- if tool_call.function %}
|
| 136 |
-
{%- set
|
| 137 |
{%- endif %}
|
| 138 |
-
{{- '<tool_call>' +
|
| 139 |
-
{%- set _args =
|
| 140 |
{%- for k, v in _args.items() %}
|
| 141 |
{{- '\n<arg_key>' + k + '</arg_key>' }}
|
| 142 |
{{- '\n<arg_value>' }}
|
| 143 |
{%- if v is string %}
|
| 144 |
{{- v }}
|
| 145 |
{%- else %}
|
| 146 |
-
{{- v | tojson }}
|
| 147 |
{%- endif %}
|
| 148 |
{{- '</arg_value>' }}
|
| 149 |
{%- endfor %}
|
|
@@ -152,6 +138,7 @@
|
|
| 152 |
{%- endif %}
|
| 153 |
{{- '<|role_end|>' }}
|
| 154 |
{%- elif message.role == "tool" %}
|
|
|
|
| 155 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 156 |
{{- '<role>OBSERVATION</role>' }}
|
| 157 |
{%- endif %}
|
|
@@ -162,16 +149,17 @@
|
|
| 162 |
{{- '<|role_end|>' }}
|
| 163 |
{%- endif %}
|
| 164 |
{%- else %}
|
| 165 |
-
{
|
|
|
|
| 166 |
{%- endif %}
|
| 167 |
{%- endfor %}
|
| 168 |
|
| 169 |
{#- ==================== generation prompt ==================== -#}
|
| 170 |
{%- if add_generation_prompt %}
|
| 171 |
{{- '<role>ASSISTANT</role>' }}
|
| 172 |
-
{%- if
|
| 173 |
-
{{- '\n<think>
|
| 174 |
-
{%-
|
| 175 |
-
{{- '<think>
|
| 176 |
{%- endif %}
|
| 177 |
{%- endif %}
|
|
|
|
| 1 |
+
{#- Bailing V3 audio and text chat template -#}
|
| 2 |
+
{#- Supports: audio/text content, enable_thinking, preserved thinking, tool calling -#}
|
| 3 |
|
| 4 |
+
{#- ==================== thinking normalization ==================== -#}
|
| 5 |
+
{%- if enable_thinking is not defined %}
|
| 6 |
+
{%- set enable_thinking = false %}
|
| 7 |
+
{%- endif %}
|
| 8 |
+
{%- if enable_thinking %}
|
| 9 |
+
{%- set thinking_instruction = 'detailed thinking on' %}
|
| 10 |
+
{%- else %}
|
| 11 |
+
{%- set thinking_instruction = 'detailed thinking off' %}
|
|
|
|
| 12 |
{%- endif %}
|
| 13 |
|
| 14 |
+
{#- ==================== preserved thinking normalization ==================== -#}
|
| 15 |
+
{%- if preserve_thinking is not defined %}
|
| 16 |
+
{%- set preserve_thinking = true %}
|
| 17 |
+
{%- endif %}
|
| 18 |
|
| 19 |
{#- ==================== render_content macro ==================== -#}
|
| 20 |
+
{%- macro render_content(content) %}
|
| 21 |
{%- if content is string %}
|
| 22 |
{{- content }}
|
| 23 |
{%- elif content is iterable and content is not mapping %}
|
| 24 |
{%- for item in content %}
|
| 25 |
+
{%- set item_type = item.type if item.type is defined else '' %}
|
| 26 |
+
{%- if item_type == 'audio' or (not item_type and ('audio' in item or 'audio_url' in item)) %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
{{- '<|audio_start|><|audio_pad|><|audio_end|>' }}
|
| 28 |
+
{%- elif item_type == 'text' or (not item_type and 'text' in item) %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
{{- item.text }}
|
| 30 |
{%- else %}
|
| 31 |
+
{{- raise_exception('Unexpected item type in content list: each item must have type audio/text.') }}
|
| 32 |
{%- endif %}
|
| 33 |
{%- endfor %}
|
| 34 |
{%- elif content is none or content is undefined %}
|
|
|
|
| 45 |
|
| 46 |
{#- ==================== system message ==================== -#}
|
| 47 |
{{- '<role>SYSTEM</role>' }}
|
| 48 |
+
{%- set has_thinking_instruction = false %}
|
| 49 |
{%- if messages[0].role == 'system' %}
|
| 50 |
+
{%- set system_content = render_content(messages[0].content) %}
|
| 51 |
+
{%- if 'detailed thinking on' in system_content or 'detailed thinking off' in system_content %}
|
| 52 |
+
{%- set has_thinking_instruction = true %}
|
| 53 |
+
{%- endif %}
|
| 54 |
{{- system_content }}
|
| 55 |
+
{%- if (tools or not has_thinking_instruction) and system_content and system_content[-1] != '\n' %}
|
| 56 |
{{- '\n' }}
|
| 57 |
{%- endif %}
|
| 58 |
{%- endif %}
|
|
|
|
| 59 |
{%- if tools %}
|
| 60 |
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 61 |
{%- for tool in tools %}
|
|
|
|
| 64 |
{%- endfor %}
|
| 65 |
{{- "\n</tools>\n\nIf none of the functions can be used, point it out. If the given question lacks the parameters required by the function, also point it out.\nIf you need to use a function, for each function call, output the function name and arguments within the following XML format:\n<tool_call>{function-name}\n<arg_key>{arg-key-1}</arg_key>\n<arg_value>{arg-value-1}</arg_value>\n<arg_key>{arg-key-2}</arg_key>\n<arg_value>{arg-value-2}</arg_value>\n...\n</tool_call>\n" }}
|
| 66 |
{%- endif %}
|
| 67 |
+
{%- if not has_thinking_instruction %}
|
| 68 |
+
{{- thinking_instruction }}
|
|
|
|
|
|
|
|
|
|
| 69 |
{%- endif %}
|
| 70 |
+
{{- '<|role_end|>' }}
|
| 71 |
|
| 72 |
{#- ==================== multi_step_tool: find last real user query ==================== -#}
|
| 73 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 74 |
{%- for message in messages[::-1] %}
|
| 75 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 76 |
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 77 |
+
{%- set user_content = render_content(message.content) %}
|
| 78 |
{%- if not(user_content.startswith('<tool_response>') and user_content.endswith('</tool_response>')) %}
|
| 79 |
{%- set ns.multi_step_tool = false %}
|
| 80 |
{%- set ns.last_query_index = index %}
|
|
|
|
| 84 |
|
| 85 |
{#- ==================== message loop ==================== -#}
|
| 86 |
{%- for message in messages %}
|
|
|
|
| 87 |
{%- if message.role == "user" %}
|
| 88 |
+
{%- set content = render_content(message.content) %}
|
| 89 |
{{- '<role>HUMAN</role>' + content + '<|role_end|>' }}
|
| 90 |
{%- elif message.role == "system" %}
|
| 91 |
{%- if not loop.first %}
|
| 92 |
+
{%- set content = render_content(message.content) %}
|
| 93 |
+
{{- '<role>SYSTEM</role>' + content + '<|role_end|>' }}
|
| 94 |
{%- endif %}
|
|
|
|
| 95 |
{%- elif message.role == "assistant" %}
|
| 96 |
+
{%- set content = render_content(message.content) %}
|
| 97 |
{%- set reasoning_content = '' %}
|
| 98 |
+
{%- if message.reasoning_content is string and message.reasoning_content != '' %}
|
| 99 |
+
{%- set reasoning_content = message.reasoning_content %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
{%- else %}
|
| 101 |
{%- if '</think>' in content %}
|
| 102 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 103 |
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 104 |
{%- endif %}
|
| 105 |
{%- endif %}
|
| 106 |
+
{%- if preserve_thinking or loop.index0 > ns.last_query_index %}
|
| 107 |
+
{%- if reasoning_content != '' %}
|
| 108 |
+
{{- '<role>ASSISTANT</role>' + '\n<think>' + reasoning_content.strip('\n') + '</think>' + content.lstrip('\n') }}
|
| 109 |
+
{%- else %}
|
| 110 |
+
{{- '<role>ASSISTANT</role>\n<think></think>' + content }}
|
| 111 |
+
{%- endif %}
|
| 112 |
{%- else %}
|
| 113 |
+
{{- '<role>ASSISTANT</role>\n<think></think>' + content }}
|
| 114 |
{%- endif %}
|
| 115 |
{%- if message.tool_calls %}
|
| 116 |
{%- for tool_call in message.tool_calls %}
|
| 117 |
{%- if (loop.first and content) or (not loop.first) %}
|
| 118 |
{{- '\n' }}
|
| 119 |
{%- endif %}
|
| 120 |
+
{%- set tc = tool_call %}
|
| 121 |
{%- if tool_call.function %}
|
| 122 |
+
{%- set tc = tool_call.function %}
|
| 123 |
{%- endif %}
|
| 124 |
+
{{- '<tool_call>' + tc.name }}
|
| 125 |
+
{%- set _args = tc.arguments %}
|
| 126 |
{%- for k, v in _args.items() %}
|
| 127 |
{{- '\n<arg_key>' + k + '</arg_key>' }}
|
| 128 |
{{- '\n<arg_value>' }}
|
| 129 |
{%- if v is string %}
|
| 130 |
{{- v }}
|
| 131 |
{%- else %}
|
| 132 |
+
{{- v | tojson(ensure_ascii=False) }}
|
| 133 |
{%- endif %}
|
| 134 |
{{- '</arg_value>' }}
|
| 135 |
{%- endfor %}
|
|
|
|
| 138 |
{%- endif %}
|
| 139 |
{{- '<|role_end|>' }}
|
| 140 |
{%- elif message.role == "tool" %}
|
| 141 |
+
{%- set content = render_content(message.content) %}
|
| 142 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 143 |
{{- '<role>OBSERVATION</role>' }}
|
| 144 |
{%- endif %}
|
|
|
|
| 149 |
{{- '<|role_end|>' }}
|
| 150 |
{%- endif %}
|
| 151 |
{%- else %}
|
| 152 |
+
{%- set content = render_content(message.content) %}
|
| 153 |
+
{{- '<role>' + message.role + '</role>' + content + '<|role_end|>' }}
|
| 154 |
{%- endif %}
|
| 155 |
{%- endfor %}
|
| 156 |
|
| 157 |
{#- ==================== generation prompt ==================== -#}
|
| 158 |
{%- if add_generation_prompt %}
|
| 159 |
{{- '<role>ASSISTANT</role>' }}
|
| 160 |
+
{%- if enable_thinking %}
|
| 161 |
+
{{- '\n<think>' }}
|
| 162 |
+
{%- else %}
|
| 163 |
+
{{- '\n<think></think>' }}
|
| 164 |
{%- endif %}
|
| 165 |
{%- endif %}
|
config.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
| 13 |
2,
|
| 14 |
2
|
| 15 |
],
|
| 16 |
-
"model_type": "
|
| 17 |
"n_audio_ctx": 3000,
|
| 18 |
"n_audio_head": 20,
|
| 19 |
"n_audio_layer": 32,
|
|
@@ -23,14 +23,16 @@
|
|
| 23 |
"audio_token_id": 157168,
|
| 24 |
"auto_map": {
|
| 25 |
"AutoConfig": "configuration_bailing_moe_v3_audio.BailingMoeV3AudioConfig",
|
| 26 |
-
"
|
|
|
|
|
|
|
| 27 |
},
|
| 28 |
"dtype": "bfloat16",
|
| 29 |
"model_type": "bailing_moe_v3_audio",
|
| 30 |
"norm_query_embeds": true,
|
| 31 |
"text_config": {
|
| 32 |
-
"attention_dropout": 0,
|
| 33 |
-
"embedding_dropout": 0,
|
| 34 |
"expert_swiglu_limit_list": null,
|
| 35 |
"first_k_dense_replace": 1,
|
| 36 |
"gated_attention_proj_granularity_type": "head_wise",
|
|
@@ -38,8 +40,6 @@
|
|
| 38 |
"head_dim": 128,
|
| 39 |
"hidden_act": "silu",
|
| 40 |
"hidden_size": 1536,
|
| 41 |
-
"image_patch_token": null,
|
| 42 |
-
"image_start_token": null,
|
| 43 |
"initializer_range": 0.02,
|
| 44 |
"intermediate_size": 4608,
|
| 45 |
"kda_lower_bound": -5,
|
|
@@ -47,7 +47,7 @@
|
|
| 47 |
"kv_lora_rank": 512,
|
| 48 |
"layer_group_size": 4,
|
| 49 |
"linear_silu": true,
|
| 50 |
-
"max_position_embeddings":
|
| 51 |
"max_window_layers": 20,
|
| 52 |
"model_type": "",
|
| 53 |
"moe_intermediate_size": 512,
|
|
@@ -66,7 +66,7 @@
|
|
| 66 |
"num_kv_heads_for_linear_attn": 0,
|
| 67 |
"num_nextn_predict_layers": 1,
|
| 68 |
"num_shared_experts": 1,
|
| 69 |
-
"output_dropout": 0,
|
| 70 |
"output_router_logits": false,
|
| 71 |
"partial_rotary_factor": 0.5,
|
| 72 |
"q_lora_rank": 256,
|
|
@@ -98,11 +98,9 @@
|
|
| 98 |
"use_qkv_bias": false,
|
| 99 |
"v_head_dim": 128,
|
| 100 |
"value_norm": false,
|
| 101 |
-
"video_patch_token": 157175,
|
| 102 |
-
"video_start_token": null,
|
| 103 |
"vocab_size": 157184
|
| 104 |
},
|
| 105 |
"tie_word_embeddings": false,
|
| 106 |
-
"transformers_version": "
|
| 107 |
"torch_dtype": "bfloat16"
|
| 108 |
}
|
|
|
|
| 13 |
2,
|
| 14 |
2
|
| 15 |
],
|
| 16 |
+
"model_type": "bailing_moe_v3_audio",
|
| 17 |
"n_audio_ctx": 3000,
|
| 18 |
"n_audio_head": 20,
|
| 19 |
"n_audio_layer": 32,
|
|
|
|
| 23 |
"audio_token_id": 157168,
|
| 24 |
"auto_map": {
|
| 25 |
"AutoConfig": "configuration_bailing_moe_v3_audio.BailingMoeV3AudioConfig",
|
| 26 |
+
"AutoModel": "modeling_bailing_moe_v3_audio.BailingMoeV3AudioForConditionalGeneration",
|
| 27 |
+
"AutoModelForCausalLM": "modeling_bailing_moe_v3_audio.BailingMoeV3AudioForConditionalGeneration",
|
| 28 |
+
"AutoProcessor": "processing_bailing_moe_v3_audio.BailingMoeV3AudioProcessor"
|
| 29 |
},
|
| 30 |
"dtype": "bfloat16",
|
| 31 |
"model_type": "bailing_moe_v3_audio",
|
| 32 |
"norm_query_embeds": true,
|
| 33 |
"text_config": {
|
| 34 |
+
"attention_dropout": 0.0,
|
| 35 |
+
"embedding_dropout": 0.0,
|
| 36 |
"expert_swiglu_limit_list": null,
|
| 37 |
"first_k_dense_replace": 1,
|
| 38 |
"gated_attention_proj_granularity_type": "head_wise",
|
|
|
|
| 40 |
"head_dim": 128,
|
| 41 |
"hidden_act": "silu",
|
| 42 |
"hidden_size": 1536,
|
|
|
|
|
|
|
| 43 |
"initializer_range": 0.02,
|
| 44 |
"intermediate_size": 4608,
|
| 45 |
"kda_lower_bound": -5,
|
|
|
|
| 47 |
"kv_lora_rank": 512,
|
| 48 |
"layer_group_size": 4,
|
| 49 |
"linear_silu": true,
|
| 50 |
+
"max_position_embeddings": 131072,
|
| 51 |
"max_window_layers": 20,
|
| 52 |
"model_type": "",
|
| 53 |
"moe_intermediate_size": 512,
|
|
|
|
| 66 |
"num_kv_heads_for_linear_attn": 0,
|
| 67 |
"num_nextn_predict_layers": 1,
|
| 68 |
"num_shared_experts": 1,
|
| 69 |
+
"output_dropout": 0.0,
|
| 70 |
"output_router_logits": false,
|
| 71 |
"partial_rotary_factor": 0.5,
|
| 72 |
"q_lora_rank": 256,
|
|
|
|
| 98 |
"use_qkv_bias": false,
|
| 99 |
"v_head_dim": 128,
|
| 100 |
"value_norm": false,
|
|
|
|
|
|
|
| 101 |
"vocab_size": 157184
|
| 102 |
},
|
| 103 |
"tie_word_embeddings": false,
|
| 104 |
+
"transformers_version": "5.14.1",
|
| 105 |
"torch_dtype": "bfloat16"
|
| 106 |
}
|
configuration_bailing_moe_v3_audio.py
CHANGED
|
@@ -180,7 +180,6 @@ class BailingMoeV3AudioEncoderConfig(PretrainedConfig):
|
|
| 180 |
|
| 181 |
@classmethod
|
| 182 |
def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.PathLike], **kwargs) -> "PretrainedConfig":
|
| 183 |
-
cls._set_token_in_kwargs(kwargs)
|
| 184 |
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
|
| 185 |
if "audio_config" in config_dict:
|
| 186 |
config_dict = config_dict["audio_config"]
|
|
@@ -195,6 +194,7 @@ class BailingMoeV3AudioConfig(PretrainedConfig):
|
|
| 195 |
text_config=None,
|
| 196 |
audio_config=None,
|
| 197 |
audio_token_id=157168,
|
|
|
|
| 198 |
tie_word_embeddings=False,
|
| 199 |
**kwargs,
|
| 200 |
):
|
|
@@ -211,6 +211,7 @@ class BailingMoeV3AudioConfig(PretrainedConfig):
|
|
| 211 |
self.text_config = text_config
|
| 212 |
self.audio_config = audio_config
|
| 213 |
self.audio_token_id = audio_token_id
|
|
|
|
| 214 |
|
| 215 |
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
|
| 216 |
|
|
@@ -218,17 +219,8 @@ class BailingMoeV3AudioConfig(PretrainedConfig):
|
|
| 218 |
def from_pretrained(
|
| 219 |
cls, pretrained_model_name_or_path: Union[str, os.PathLike], **kwargs
|
| 220 |
) -> "BailingMoeV3AudioConfig":
|
| 221 |
-
cls._set_token_in_kwargs(kwargs)
|
| 222 |
config_dict, kwargs = cls.get_config_dict(
|
| 223 |
pretrained_model_name_or_path, **kwargs
|
| 224 |
)
|
| 225 |
-
config_dict = {
|
| 226 |
-
key: value
|
| 227 |
-
for key, value in config_dict.items()
|
| 228 |
-
if not (
|
| 229 |
-
key.startswith(("vision", "image_", "video_"))
|
| 230 |
-
or key == "mrope_section"
|
| 231 |
-
)
|
| 232 |
-
}
|
| 233 |
config_dict["model_type"] = cls.model_type
|
| 234 |
return cls.from_dict(config_dict, **kwargs)
|
|
|
|
| 180 |
|
| 181 |
@classmethod
|
| 182 |
def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.PathLike], **kwargs) -> "PretrainedConfig":
|
|
|
|
| 183 |
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
|
| 184 |
if "audio_config" in config_dict:
|
| 185 |
config_dict = config_dict["audio_config"]
|
|
|
|
| 194 |
text_config=None,
|
| 195 |
audio_config=None,
|
| 196 |
audio_token_id=157168,
|
| 197 |
+
norm_query_embeds=False,
|
| 198 |
tie_word_embeddings=False,
|
| 199 |
**kwargs,
|
| 200 |
):
|
|
|
|
| 211 |
self.text_config = text_config
|
| 212 |
self.audio_config = audio_config
|
| 213 |
self.audio_token_id = audio_token_id
|
| 214 |
+
self.norm_query_embeds = norm_query_embeds
|
| 215 |
|
| 216 |
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
|
| 217 |
|
|
|
|
| 219 |
def from_pretrained(
|
| 220 |
cls, pretrained_model_name_or_path: Union[str, os.PathLike], **kwargs
|
| 221 |
) -> "BailingMoeV3AudioConfig":
|
|
|
|
| 222 |
config_dict, kwargs = cls.get_config_dict(
|
| 223 |
pretrained_model_name_or_path, **kwargs
|
| 224 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
config_dict["model_type"] = cls.model_type
|
| 226 |
return cls.from_dict(config_dict, **kwargs)
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eos_token_id": [
|
| 3 |
+
156892,
|
| 4 |
+
156895
|
| 5 |
+
],
|
| 6 |
+
"pad_token_id": 156892
|
| 7 |
+
}
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53b7663c7c52aa36e487977d6e9bb2f5666b7aaa543bd5d5dd4e96ec88cfd957
|
| 3 |
+
size 9551820960
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 8192122649
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08d9e7bd9d885a0d6608953c6bbe40dbfb67f673a0cce9382414b55a9380053a
|
| 3 |
size 8192122649
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"model.audio.blocks.28.attn.query.weight": "model-00001-of-00002.safetensors",
|
|
@@ -8,12 +8,6 @@
|
|
| 8 |
"model.layers.23.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 9 |
"model.layers.23.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 10 |
"linear_proj_audio.2.weight": "model-00001-of-00002.safetensors",
|
| 11 |
-
"model.audio.blocks.20.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 12 |
-
"model.audio.blocks.23.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 13 |
-
"model.layers.2.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 14 |
-
"model.layers.7.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 15 |
-
"model.layers.13.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 16 |
-
"model.layers.13.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 17 |
"model.audio.blocks.20.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 18 |
"model.audio.blocks.24.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 19 |
"model.layers.2.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -41,12 +35,12 @@
|
|
| 41 |
"model.layers.9.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 42 |
"model.layers.15.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 43 |
"model.layers.15.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 44 |
-
"model.audio.blocks.28.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 45 |
-
"model.layers.5.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 46 |
-
"linear_proj_audio.4.weight": "model-00001-of-00002.safetensors",
|
| 47 |
"model.audio.blocks.21.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 48 |
"model.audio.blocks.26.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 49 |
"model.layers.20.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 50 |
"model.audio.blocks.22.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 51 |
"model.audio.blocks.27.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 52 |
"model.layers.9.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -72,17 +66,17 @@
|
|
| 72 |
"model.layers.16.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 73 |
"model.layers.20.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 74 |
"model.layers.24.attention.q_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 75 |
-
"model.audio.blocks.29.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 76 |
-
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 77 |
-
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 78 |
-
"model.layers.5.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 79 |
-
"model.layers.23.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 80 |
"model.audio.conv1.weight": "model-00001-of-00002.safetensors",
|
| 81 |
"model.audio.blocks.23.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 82 |
"model.audio.blocks.29.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 83 |
"model.layers.17.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 84 |
"model.layers.17.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 85 |
"model.layers.21.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
"model.audio.blocks.3.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 87 |
"model.audio.blocks.23.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 88 |
"model.layers.11.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -107,28 +101,19 @@
|
|
| 107 |
"model.layers.3.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
| 108 |
"model.layers.18.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 109 |
"model.layers.21.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 110 |
-
"model.audio.blocks.29.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 111 |
-
"model.layers.5.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 112 |
-
"model.layers.23.attention.q_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 113 |
"model.audio.blocks.24.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 114 |
"model.audio.blocks.31.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 115 |
"model.layers.7.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
| 116 |
"model.layers.19.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 117 |
"model.layers.19.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 118 |
"model.layers.22.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 119 |
"model.audio.blocks.4.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 120 |
"model.audio.blocks.25.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 121 |
"model.layers.22.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 122 |
"model.layers.24.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
| 123 |
-
"model.visual.patch_embed.proj.bias": "model-00001-of-00002.safetensors",
|
| 124 |
-
"model.visual.blocks.0.norm1.bias": "model-00001-of-00002.safetensors",
|
| 125 |
-
"model.visual.blocks.5.norm2.weight": "model-00001-of-00002.safetensors",
|
| 126 |
-
"model.visual.blocks.10.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 127 |
-
"model.visual.blocks.12.norm2.weight": "model-00001-of-00002.safetensors",
|
| 128 |
-
"model.visual.blocks.14.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 129 |
-
"model.visual.blocks.17.norm1.bias": "model-00001-of-00002.safetensors",
|
| 130 |
-
"model.visual.blocks.20.norm2.weight": "model-00001-of-00002.safetensors",
|
| 131 |
-
"model.visual.blocks.25.norm1.bias": "model-00001-of-00002.safetensors",
|
| 132 |
"model.audio.blocks.4.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 133 |
"model.audio.blocks.4.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 134 |
"model.audio.blocks.7.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
@@ -148,14 +133,6 @@
|
|
| 148 |
"model.layers.22.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 149 |
"model.norm.weight": "model-00001-of-00002.safetensors",
|
| 150 |
"model.layers.24.final_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 151 |
-
"model.visual.blocks.0.norm1.weight": "model-00001-of-00002.safetensors",
|
| 152 |
-
"model.visual.blocks.6.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 153 |
-
"model.visual.blocks.11.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 154 |
-
"model.visual.blocks.13.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 155 |
-
"model.visual.blocks.15.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 156 |
-
"model.visual.blocks.17.norm1.weight": "model-00001-of-00002.safetensors",
|
| 157 |
-
"model.visual.blocks.21.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 158 |
-
"model.visual.blocks.25.norm1.weight": "model-00001-of-00002.safetensors",
|
| 159 |
"model.audio.blocks.4.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 160 |
"model.audio.blocks.5.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 161 |
"model.audio.blocks.7.attn_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -177,14 +154,6 @@
|
|
| 177 |
"model.layers.22.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 178 |
"model.layers.24.hnorm.weight": "model-00001-of-00002.safetensors",
|
| 179 |
"model.layers.24.attention.kv_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 180 |
-
"model.visual.blocks.0.norm2.bias": "model-00001-of-00002.safetensors",
|
| 181 |
-
"model.visual.blocks.6.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 182 |
-
"model.visual.blocks.12.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 183 |
-
"model.visual.blocks.13.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 184 |
-
"model.visual.blocks.16.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 185 |
-
"model.visual.blocks.17.norm2.bias": "model-00001-of-00002.safetensors",
|
| 186 |
-
"model.visual.blocks.21.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 187 |
-
"model.visual.blocks.25.norm2.bias": "model-00001-of-00002.safetensors",
|
| 188 |
"model.audio.blocks.3.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 189 |
"model.audio.blocks.4.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 190 |
"model.audio.blocks.5.mlp.2.weight": "model-00001-of-00002.safetensors",
|
|
@@ -208,14 +177,6 @@
|
|
| 208 |
"model.layers.20.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 209 |
"model.layers.22.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 210 |
"model.layers.24.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 211 |
-
"model.visual.blocks.0.norm2.weight": "model-00001-of-00002.safetensors",
|
| 212 |
-
"model.visual.blocks.6.norm1.bias": "model-00001-of-00002.safetensors",
|
| 213 |
-
"model.visual.blocks.13.norm1.bias": "model-00001-of-00002.safetensors",
|
| 214 |
-
"model.visual.blocks.13.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 215 |
-
"model.visual.blocks.17.norm2.weight": "model-00001-of-00002.safetensors",
|
| 216 |
-
"model.visual.blocks.17.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 217 |
-
"model.visual.blocks.21.norm1.bias": "model-00001-of-00002.safetensors",
|
| 218 |
-
"model.visual.blocks.25.norm2.weight": "model-00001-of-00002.safetensors",
|
| 219 |
"model.audio.blocks.3.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 220 |
"model.audio.blocks.4.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 221 |
"model.audio.blocks.6.mlp.0.weight": "model-00001-of-00002.safetensors",
|
|
@@ -237,19 +198,6 @@
|
|
| 237 |
"model.layers.20.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 238 |
"model.layers.22.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 239 |
"model.layers.24.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 240 |
-
"model.audio.blocks.29.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 241 |
-
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 242 |
-
"model.layers.3.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 243 |
-
"model.layers.3.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 244 |
-
"model.layers.5.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 245 |
-
"model.visual.blocks.2.norm1.bias": "model-00001-of-00002.safetensors",
|
| 246 |
-
"model.visual.blocks.4.norm1.bias": "model-00001-of-00002.safetensors",
|
| 247 |
-
"model.visual.blocks.8.norm2.weight": "model-00001-of-00002.safetensors",
|
| 248 |
-
"model.visual.blocks.11.norm1.bias": "model-00001-of-00002.safetensors",
|
| 249 |
-
"model.visual.blocks.14.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 250 |
-
"model.visual.blocks.15.norm2.weight": "model-00001-of-00002.safetensors",
|
| 251 |
-
"model.visual.blocks.18.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 252 |
-
"model.visual.blocks.23.norm2.weight": "model-00001-of-00002.safetensors",
|
| 253 |
"model.audio.blocks.0.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 254 |
"model.audio.blocks.6.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 255 |
"model.audio.blocks.6.mlp.2.weight": "model-00001-of-00002.safetensors",
|
|
@@ -270,14 +218,11 @@
|
|
| 270 |
"model.layers.13.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 271 |
"model.layers.21.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 272 |
"model.layers.23.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 273 |
-
"model.
|
| 274 |
-
"model.
|
| 275 |
-
"model.
|
| 276 |
-
"model.
|
| 277 |
-
"model.
|
| 278 |
-
"model.visual.blocks.16.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 279 |
-
"model.visual.blocks.19.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 280 |
-
"model.visual.blocks.24.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 281 |
"model.audio.blocks.0.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 282 |
"model.audio.blocks.2.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 283 |
"model.audio.blocks.6.attn.value.bias": "model-00001-of-00002.safetensors",
|
|
@@ -299,14 +244,6 @@
|
|
| 299 |
"model.layers.20.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 300 |
"model.layers.20.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 301 |
"model.layers.21.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 302 |
-
"model.visual.blocks.2.norm2.bias": "model-00001-of-00002.safetensors",
|
| 303 |
-
"model.visual.blocks.2.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 304 |
-
"model.visual.blocks.4.norm2.bias": "model-00001-of-00002.safetensors",
|
| 305 |
-
"model.visual.blocks.9.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 306 |
-
"model.visual.blocks.11.norm2.bias": "model-00001-of-00002.safetensors",
|
| 307 |
-
"model.visual.blocks.16.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 308 |
-
"model.visual.blocks.16.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 309 |
-
"model.visual.blocks.24.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 310 |
"model.audio.blocks.0.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 311 |
"model.audio.blocks.2.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 312 |
"model.audio.blocks.6.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
@@ -326,14 +263,6 @@
|
|
| 326 |
"model.layers.15.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 327 |
"model.layers.16.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 328 |
"model.layers.22.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 329 |
-
"model.visual.blocks.2.norm2.weight": "model-00001-of-00002.safetensors",
|
| 330 |
-
"model.visual.blocks.4.norm2.weight": "model-00001-of-00002.safetensors",
|
| 331 |
-
"model.visual.blocks.9.norm1.bias": "model-00001-of-00002.safetensors",
|
| 332 |
-
"model.visual.blocks.11.norm2.weight": "model-00001-of-00002.safetensors",
|
| 333 |
-
"model.visual.blocks.16.norm1.bias": "model-00001-of-00002.safetensors",
|
| 334 |
-
"model.visual.blocks.17.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 335 |
-
"model.visual.blocks.20.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 336 |
-
"model.visual.blocks.24.norm1.bias": "model-00001-of-00002.safetensors",
|
| 337 |
"model.audio.blocks.0.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 338 |
"model.audio.blocks.2.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 339 |
"model.audio.blocks.6.attn_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -354,14 +283,6 @@
|
|
| 354 |
"model.layers.17.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 355 |
"model.layers.20.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 356 |
"model.layers.22.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 357 |
-
"model.visual.blocks.5.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 358 |
-
"model.visual.blocks.9.norm1.weight": "model-00001-of-00002.safetensors",
|
| 359 |
-
"model.visual.blocks.12.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 360 |
-
"model.visual.blocks.16.norm1.weight": "model-00001-of-00002.safetensors",
|
| 361 |
-
"model.visual.blocks.18.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 362 |
-
"model.visual.blocks.20.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 363 |
-
"model.visual.blocks.21.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 364 |
-
"model.visual.blocks.24.norm1.weight": "model-00001-of-00002.safetensors",
|
| 365 |
"model.audio.conv1.bias": "model-00001-of-00002.safetensors",
|
| 366 |
"model.audio.blocks.0.attn_ln.weight": "model-00001-of-00002.safetensors",
|
| 367 |
"model.audio.blocks.2.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
@@ -383,14 +304,6 @@
|
|
| 383 |
"model.layers.21.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 384 |
"model.layers.21.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 385 |
"model.layers.23.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 386 |
-
"model.visual.blocks.5.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 387 |
-
"model.visual.blocks.9.norm2.bias": "model-00001-of-00002.safetensors",
|
| 388 |
-
"model.visual.blocks.12.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 389 |
-
"model.visual.blocks.16.norm2.bias": "model-00001-of-00002.safetensors",
|
| 390 |
-
"model.visual.blocks.19.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 391 |
-
"model.visual.blocks.20.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 392 |
-
"model.visual.blocks.22.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 393 |
-
"model.visual.blocks.24.norm2.bias": "model-00001-of-00002.safetensors",
|
| 394 |
"model.audio.conv2.bias": "model-00001-of-00002.safetensors",
|
| 395 |
"model.audio.blocks.0.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 396 |
"model.audio.blocks.2.attn_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -410,18 +323,6 @@
|
|
| 410 |
"model.layers.18.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 411 |
"model.layers.23.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 412 |
"model.layers.24.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 413 |
-
"model.visual.blocks.22.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 414 |
-
"model.audio.blocks.0.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 415 |
-
"model.audio.blocks.13.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 416 |
-
"model.layers.12.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 417 |
-
"model.visual.blocks.2.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 418 |
-
"model.visual.blocks.5.norm1.bias": "model-00001-of-00002.safetensors",
|
| 419 |
-
"model.visual.blocks.9.norm2.weight": "model-00001-of-00002.safetensors",
|
| 420 |
-
"model.visual.blocks.12.norm1.bias": "model-00001-of-00002.safetensors",
|
| 421 |
-
"model.visual.blocks.16.norm2.weight": "model-00001-of-00002.safetensors",
|
| 422 |
-
"model.visual.blocks.20.norm1.bias": "model-00001-of-00002.safetensors",
|
| 423 |
-
"model.visual.blocks.23.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 424 |
-
"model.visual.blocks.24.norm2.weight": "model-00001-of-00002.safetensors",
|
| 425 |
"model.audio.blocks.0.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 426 |
"model.audio.blocks.2.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 427 |
"model.audio.blocks.6.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -442,18 +343,12 @@
|
|
| 442 |
"model.layers.20.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 443 |
"model.layers.21.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 444 |
"model.layers.24.attention.q_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 445 |
"model.audio.blocks.7.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 446 |
"model.audio.blocks.12.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 447 |
"model.layers.12.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 448 |
-
"linear_proj.0.weight": "model-00001-of-00002.safetensors",
|
| 449 |
-
"model.visual.blocks.5.norm1.weight": "model-00001-of-00002.safetensors",
|
| 450 |
-
"model.visual.blocks.12.norm1.weight": "model-00001-of-00002.safetensors",
|
| 451 |
-
"model.visual.blocks.17.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 452 |
-
"model.visual.blocks.20.norm1.weight": "model-00001-of-00002.safetensors",
|
| 453 |
-
"model.visual.blocks.20.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 454 |
-
"model.visual.blocks.24.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 455 |
-
"model.visual.blocks.25.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 456 |
-
"model.visual.merger.norm.bias": "model-00001-of-00002.safetensors",
|
| 457 |
"model.audio.blocks.0.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 458 |
"model.audio.blocks.2.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 459 |
"model.audio.blocks.5.attn.key.weight": "model-00001-of-00002.safetensors",
|
|
@@ -474,14 +369,6 @@
|
|
| 474 |
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 475 |
"model.layers.21.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 476 |
"linear_proj_audio.0.weight": "model-00001-of-00002.safetensors",
|
| 477 |
-
"model.visual.blocks.0.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 478 |
-
"model.visual.blocks.1.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 479 |
-
"model.visual.blocks.6.norm1.weight": "model-00001-of-00002.safetensors",
|
| 480 |
-
"model.visual.blocks.9.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 481 |
-
"model.visual.blocks.13.norm1.weight": "model-00001-of-00002.safetensors",
|
| 482 |
-
"model.visual.blocks.18.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 483 |
-
"model.visual.blocks.21.norm1.weight": "model-00001-of-00002.safetensors",
|
| 484 |
-
"model.visual.blocks.26.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 485 |
"model.audio.blocks.3.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 486 |
"model.audio.blocks.4.attn_ln.weight": "model-00001-of-00002.safetensors",
|
| 487 |
"model.audio.blocks.7.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -496,15 +383,6 @@
|
|
| 496 |
"model.layers.22.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 497 |
"model.layers.22.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 498 |
"model.layers.23.attention.kv_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 499 |
-
"model.visual.blocks.0.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 500 |
-
"model.visual.blocks.1.norm2.bias": "model-00001-of-00002.safetensors",
|
| 501 |
-
"model.visual.blocks.7.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 502 |
-
"model.visual.blocks.14.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 503 |
-
"model.visual.blocks.18.norm2.bias": "model-00001-of-00002.safetensors",
|
| 504 |
-
"model.visual.blocks.21.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 505 |
-
"model.visual.blocks.22.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 506 |
-
"model.visual.blocks.25.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 507 |
-
"model.visual.blocks.26.norm2.bias": "model-00001-of-00002.safetensors",
|
| 508 |
"model.audio.conv2.weight": "model-00001-of-00002.safetensors",
|
| 509 |
"model.audio.blocks.1.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 510 |
"model.audio.blocks.3.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
|
@@ -529,157 +407,87 @@
|
|
| 529 |
"model.layers.22.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 530 |
"model.layers.22.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 531 |
"model.layers.22.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 532 |
-
"model.visual.blocks.1.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 533 |
-
"model.visual.blocks.21.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 534 |
"model.audio.blocks.12.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 535 |
"model.layers.24.eh_proj.weight": "model-00001-of-00002.safetensors",
|
| 536 |
-
"model.visual.blocks.23.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 537 |
"model.audio.blocks.0.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 538 |
"model.audio.blocks.13.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 539 |
"model.layers.13.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 540 |
-
"model.visual.blocks.0.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 541 |
-
"model.visual.blocks.1.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 542 |
-
"model.visual.blocks.2.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 543 |
-
"linear_proj.2.weight": "model-00001-of-00002.safetensors",
|
| 544 |
-
"model.visual.blocks.1.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 545 |
-
"model.visual.blocks.10.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 546 |
-
"model.visual.blocks.20.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 547 |
"linear_proj_audio.7.weight": "model-00001-of-00002.safetensors",
|
| 548 |
-
"model.visual.blocks.10.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 549 |
-
"model.visual.blocks.10.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 550 |
"model.audio.blocks.5.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 551 |
"model.layers.11.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 552 |
-
"model.visual.blocks.11.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 553 |
-
"model.visual.blocks.11.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 554 |
"model.audio.blocks.5.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 555 |
"model.layers.15.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 556 |
-
"model.visual.blocks.11.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 557 |
-
"model.visual.blocks.12.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 558 |
"model.audio.blocks.6.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 559 |
"model.layers.19.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 560 |
-
"model.visual.blocks.12.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 561 |
-
"model.visual.blocks.13.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 562 |
"model.audio.blocks.6.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 563 |
"model.layers.23.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 564 |
-
"model.
|
|
|
|
| 565 |
"model.audio.blocks.1.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 566 |
"model.audio.blocks.13.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 567 |
"model.layers.13.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 568 |
-
"model.visual.blocks.12.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 569 |
-
"model.visual.blocks.14.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 570 |
-
"model.audio.blocks.6.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 571 |
-
"model.layers.3.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 572 |
-
"model.visual.blocks.13.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 573 |
-
"model.visual.blocks.15.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 574 |
"model.audio.blocks.6.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 575 |
"model.layers.7.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 576 |
-
"model.visual.blocks.13.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 577 |
-
"model.visual.blocks.16.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 578 |
"model.audio.blocks.7.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 579 |
"model.layers.24.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 580 |
-
"model.visual.patch_embed.proj.weight": "model-00001-of-00002.safetensors",
|
| 581 |
-
"model.visual.blocks.0.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 582 |
-
"model.visual.blocks.5.norm2.bias": "model-00001-of-00002.safetensors",
|
| 583 |
-
"model.visual.blocks.12.norm2.bias": "model-00001-of-00002.safetensors",
|
| 584 |
-
"model.visual.blocks.14.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 585 |
-
"model.visual.blocks.17.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 586 |
-
"model.visual.blocks.17.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 587 |
-
"model.visual.blocks.20.norm2.bias": "model-00001-of-00002.safetensors",
|
| 588 |
-
"model.visual.blocks.25.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 589 |
-
"model.visual.merger.norm.weight": "model-00001-of-00002.safetensors",
|
| 590 |
"model.audio.blocks.5.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 591 |
"model.audio.blocks.7.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 592 |
"model.layers.12.attention.A_log": "model-00001-of-00002.safetensors",
|
| 593 |
"model.layers.16.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 594 |
"model.layers.17.attention.A_log": "model-00001-of-00002.safetensors",
|
| 595 |
-
"model.visual.blocks.14.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 596 |
-
"model.visual.blocks.18.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 597 |
"model.audio.blocks.0.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 598 |
"model.audio.blocks.29.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 599 |
"model.layers.2.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 600 |
-
"model.visual.blocks.15.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 601 |
-
"model.visual.blocks.19.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 602 |
"model.audio.blocks.0.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 603 |
"model.audio.blocks.3.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 604 |
"model.layers.20.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 605 |
"model.audio.blocks.20.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 606 |
"model.audio.blocks.23.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 607 |
"model.layers.7.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 608 |
"model.layers.7.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 609 |
"model.layers.19.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 610 |
"model.audio.blocks.2.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 611 |
"model.audio.blocks.22.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 612 |
"model.layers.12.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 613 |
"model.layers.18.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 614 |
-
"model.visual.blocks.2.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 615 |
-
"model.visual.blocks.15.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 616 |
-
"model.audio.blocks.0.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 617 |
-
"model.audio.blocks.3.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 618 |
-
"model.layers.21.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 619 |
-
"model.visual.blocks.16.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 620 |
-
"model.visual.blocks.20.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 621 |
"model.audio.blocks.0.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 622 |
"model.audio.blocks.3.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 623 |
"model.layers.22.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 624 |
-
"model.visual.blocks.16.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 625 |
-
"model.visual.blocks.21.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 626 |
"model.audio.blocks.1.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 627 |
"model.audio.blocks.3.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 628 |
"model.layers.23.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 629 |
-
"model.visual.blocks.17.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 630 |
-
"model.visual.blocks.22.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 631 |
"model.audio.blocks.1.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 632 |
"model.audio.blocks.30.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 633 |
"model.layers.3.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 634 |
-
"model.visual.blocks.17.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 635 |
-
"model.visual.blocks.23.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 636 |
"model.audio.blocks.1.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 637 |
"model.audio.blocks.30.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 638 |
"model.layers.4.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 639 |
-
"model.visual.blocks.18.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 640 |
-
"model.visual.blocks.24.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 641 |
"model.audio.blocks.1.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 642 |
"model.audio.blocks.30.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 643 |
"model.layers.5.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 644 |
-
"model.visual.blocks.25.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 645 |
-
"model.audio.blocks.1.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 646 |
-
"model.audio.blocks.13.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 647 |
-
"model.layers.13.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 648 |
-
"model.visual.blocks.18.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 649 |
-
"model.visual.blocks.25.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 650 |
"model.audio.blocks.10.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 651 |
"model.audio.blocks.30.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 652 |
"model.layers.6.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 653 |
-
"model.
|
| 654 |
-
"model.
|
|
|
|
| 655 |
"model.audio.blocks.10.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 656 |
"model.audio.blocks.31.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 657 |
"model.layers.7.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 658 |
-
"model.visual.blocks.3.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 659 |
-
"model.visual.blocks.19.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 660 |
"model.audio.blocks.10.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 661 |
"model.audio.blocks.31.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 662 |
"model.layers.8.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 663 |
-
"model.visual.blocks.2.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 664 |
-
"model.visual.blocks.4.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 665 |
"model.audio.blocks.10.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 666 |
"model.audio.blocks.31.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 667 |
"model.layers.9.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 668 |
-
"model.visual.blocks.2.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 669 |
-
"model.visual.blocks.5.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 670 |
"model.audio.blocks.11.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 671 |
"model.audio.blocks.31.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 672 |
"model.layers.24.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 673 |
-
"model.visual.blocks.1.norm2.weight": "model-00001-of-00002.safetensors",
|
| 674 |
-
"model.visual.blocks.6.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 675 |
-
"model.visual.blocks.7.norm1.bias": "model-00001-of-00002.safetensors",
|
| 676 |
-
"model.visual.blocks.14.norm1.bias": "model-00001-of-00002.safetensors",
|
| 677 |
-
"model.visual.blocks.18.norm2.weight": "model-00001-of-00002.safetensors",
|
| 678 |
-
"model.visual.blocks.20.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 679 |
-
"model.visual.blocks.22.norm1.bias": "model-00001-of-00002.safetensors",
|
| 680 |
-
"model.visual.blocks.22.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 681 |
-
"model.visual.blocks.26.norm2.weight": "model-00001-of-00002.safetensors",
|
| 682 |
-
"model.visual.blocks.26.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 683 |
"model.audio.blocks.1.attn_ln.weight": "model-00001-of-00002.safetensors",
|
| 684 |
"model.audio.blocks.3.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 685 |
"model.audio.blocks.3.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -706,20 +514,6 @@
|
|
| 706 |
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 707 |
"model.layers.20.attention.q_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 708 |
"model.layers.24.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 709 |
-
"model.visual.blocks.26.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 710 |
-
"model.audio.blocks.10.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 711 |
-
"model.audio.blocks.14.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 712 |
-
"model.layers.13.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 713 |
-
"model.visual.blocks.3.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 714 |
-
"model.visual.blocks.3.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 715 |
-
"model.visual.blocks.7.norm1.weight": "model-00001-of-00002.safetensors",
|
| 716 |
-
"model.visual.blocks.7.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 717 |
-
"model.visual.blocks.10.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 718 |
-
"model.visual.blocks.14.norm1.weight": "model-00001-of-00002.safetensors",
|
| 719 |
-
"model.visual.blocks.19.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 720 |
-
"model.visual.blocks.20.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 721 |
-
"model.visual.blocks.22.norm1.weight": "model-00001-of-00002.safetensors",
|
| 722 |
-
"model.visual.blocks.23.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 723 |
"model.audio.blocks.1.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 724 |
"model.audio.blocks.4.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 725 |
"model.audio.blocks.5.attn.value.bias": "model-00001-of-00002.safetensors",
|
|
@@ -748,16 +542,9 @@
|
|
| 748 |
"model.layers.16.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 749 |
"model.layers.20.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 750 |
"model.layers.20.attention.v_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 751 |
-
"model.
|
| 752 |
-
"model.
|
| 753 |
-
"model.
|
| 754 |
-
"model.visual.blocks.8.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 755 |
-
"model.visual.blocks.10.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 756 |
-
"model.visual.blocks.14.norm2.bias": "model-00001-of-00002.safetensors",
|
| 757 |
-
"model.visual.blocks.19.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 758 |
-
"model.visual.blocks.21.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 759 |
-
"model.visual.blocks.22.norm2.bias": "model-00001-of-00002.safetensors",
|
| 760 |
-
"model.visual.blocks.24.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 761 |
"model.audio.blocks.1.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 762 |
"model.audio.blocks.2.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 763 |
"model.audio.blocks.4.attn.query.weight": "model-00001-of-00002.safetensors",
|
|
@@ -786,16 +573,6 @@
|
|
| 786 |
"model.layers.17.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 787 |
"model.layers.21.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 788 |
"model.layers.21.attention.k_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 789 |
-
"model.visual.blocks.3.norm1.bias": "model-00001-of-00002.safetensors",
|
| 790 |
-
"model.visual.blocks.5.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 791 |
-
"model.visual.blocks.7.norm2.weight": "model-00001-of-00002.safetensors",
|
| 792 |
-
"model.visual.blocks.9.attn.qkv.weight": "model-00001-of-00002.safetensors",
|
| 793 |
-
"model.visual.blocks.10.norm1.bias": "model-00001-of-00002.safetensors",
|
| 794 |
-
"model.visual.blocks.14.norm2.weight": "model-00001-of-00002.safetensors",
|
| 795 |
-
"model.visual.blocks.19.norm1.bias": "model-00001-of-00002.safetensors",
|
| 796 |
-
"model.visual.blocks.21.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 797 |
-
"model.visual.blocks.22.norm2.weight": "model-00001-of-00002.safetensors",
|
| 798 |
-
"model.visual.blocks.25.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 799 |
"model.audio.blocks.1.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 800 |
"model.audio.blocks.4.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 801 |
"model.audio.blocks.4.mlp.0.bias": "model-00001-of-00002.safetensors",
|
|
@@ -827,17 +604,6 @@
|
|
| 827 |
"model.layers.20.attention.A_log": "model-00001-of-00002.safetensors",
|
| 828 |
"model.layers.21.attention.q_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 829 |
"model.layers.22.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 830 |
-
"model.visual.pos_embed.weight": "model-00001-of-00002.safetensors",
|
| 831 |
-
"model.visual.blocks.1.norm1.bias": "model-00001-of-00002.safetensors",
|
| 832 |
-
"model.visual.blocks.1.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 833 |
-
"model.visual.blocks.6.norm2.weight": "model-00001-of-00002.safetensors",
|
| 834 |
-
"model.visual.blocks.9.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 835 |
-
"model.visual.blocks.13.norm2.weight": "model-00001-of-00002.safetensors",
|
| 836 |
-
"model.visual.blocks.13.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 837 |
-
"model.visual.blocks.18.norm1.bias": "model-00001-of-00002.safetensors",
|
| 838 |
-
"model.visual.blocks.21.norm2.weight": "model-00001-of-00002.safetensors",
|
| 839 |
-
"model.visual.blocks.22.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 840 |
-
"model.visual.blocks.26.norm1.bias": "model-00001-of-00002.safetensors",
|
| 841 |
"model.audio.positional_embedding": "model-00001-of-00002.safetensors",
|
| 842 |
"model.audio.blocks.1.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 843 |
"model.audio.blocks.1.mlp.0.bias": "model-00001-of-00002.safetensors",
|
|
@@ -862,131 +628,67 @@
|
|
| 862 |
"model.layers.20.attention.k_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 863 |
"model.layers.23.attention.q_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 864 |
"linear_proj_audio.2.bias": "model-00001-of-00002.safetensors",
|
| 865 |
-
"model.visual.blocks.22.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 866 |
"model.audio.blocks.7.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 867 |
"model.layers.0.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 868 |
"model.layers.5.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 869 |
-
"model.visual.blocks.23.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 870 |
"model.audio.blocks.7.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 871 |
"model.layers.0.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 872 |
"model.layers.5.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 873 |
-
"model.visual.blocks.3.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 874 |
-
"model.audio.blocks.10.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 875 |
-
"model.audio.blocks.14.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 876 |
-
"model.layers.13.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 877 |
-
"model.visual.blocks.23.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 878 |
"model.audio.blocks.8.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 879 |
"model.layers.0.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 880 |
"model.layers.6.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 881 |
-
"model.
|
|
|
|
|
|
|
| 882 |
"model.audio.blocks.8.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 883 |
"model.layers.0.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 884 |
"model.layers.6.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 885 |
-
"model.visual.blocks.24.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 886 |
"model.audio.blocks.8.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 887 |
"model.layers.0.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 888 |
"model.layers.6.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 889 |
-
"model.visual.blocks.25.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 890 |
"model.audio.blocks.8.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 891 |
"model.layers.0.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 892 |
"model.layers.6.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 893 |
-
"model.visual.blocks.25.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 894 |
"model.audio.blocks.9.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 895 |
"model.layers.1.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 896 |
"model.layers.6.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 897 |
-
"model.visual.blocks.26.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 898 |
"model.audio.blocks.9.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 899 |
"model.layers.1.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 900 |
"model.layers.6.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 901 |
-
"model.visual.blocks.4.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 902 |
-
"model.audio.blocks.11.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 903 |
-
"model.audio.blocks.14.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 904 |
-
"model.layers.13.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 905 |
-
"model.visual.blocks.26.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 906 |
"model.audio.blocks.9.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 907 |
"model.layers.1.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 908 |
"model.layers.7.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 909 |
-
"model.
|
|
|
|
|
|
|
| 910 |
"model.audio.blocks.9.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 911 |
"model.layers.1.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 912 |
"model.layers.8.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 913 |
-
"model.visual.blocks.0.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 914 |
-
"model.visual.blocks.3.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 915 |
"model.layers.1.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 916 |
"model.layers.8.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 917 |
-
"model.visual.blocks.1.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 918 |
-
"model.visual.blocks.4.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 919 |
"model.layers.1.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 920 |
"model.layers.8.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 921 |
-
"model.visual.blocks.4.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 922 |
-
"model.visual.blocks.10.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 923 |
"model.layers.8.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 924 |
"model.layers.10.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 925 |
-
"model.visual.blocks.5.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 926 |
-
"model.visual.blocks.11.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 927 |
"model.layers.8.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 928 |
"model.layers.10.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 929 |
-
"model.visual.blocks.5.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 930 |
"model.audio.blocks.11.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 931 |
"model.audio.blocks.14.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 932 |
"model.layers.14.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 933 |
-
"model.visual.blocks.5.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 934 |
-
"model.visual.blocks.12.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 935 |
-
"model.layers.8.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 936 |
-
"model.layers.10.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 937 |
-
"model.visual.blocks.6.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 938 |
-
"model.visual.blocks.13.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 939 |
-
"model.layers.9.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 940 |
-
"model.layers.10.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 941 |
-
"model.visual.blocks.6.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 942 |
-
"model.visual.blocks.14.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 943 |
-
"model.layers.9.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 944 |
-
"model.layers.10.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 945 |
-
"model.visual.blocks.7.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 946 |
-
"model.visual.blocks.15.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 947 |
-
"model.layers.9.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 948 |
-
"model.layers.10.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 949 |
-
"model.visual.blocks.7.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 950 |
-
"model.visual.blocks.16.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 951 |
-
"model.layers.9.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 952 |
-
"model.layers.11.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 953 |
-
"model.visual.blocks.8.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 954 |
-
"model.visual.blocks.17.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 955 |
-
"model.layers.9.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 956 |
-
"model.layers.12.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 957 |
-
"model.visual.blocks.6.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 958 |
"model.audio.blocks.12.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 959 |
"model.audio.blocks.15.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 960 |
"model.layers.14.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 961 |
-
"model.visual.blocks.8.mlp.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 962 |
-
"model.visual.blocks.18.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 963 |
-
"model.layers.9.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 964 |
-
"model.layers.12.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 965 |
-
"model.visual.blocks.9.mlp.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 966 |
-
"model.visual.blocks.19.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 967 |
-
"model.layers.12.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 968 |
-
"model.layers.24.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 969 |
-
"model.visual.blocks.7.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 970 |
"model.audio.blocks.12.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 971 |
"model.audio.blocks.15.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 972 |
"model.layers.14.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 973 |
-
"model.visual.blocks.8.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 974 |
"model.audio.blocks.13.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 975 |
"model.audio.blocks.15.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 976 |
"model.layers.14.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 977 |
-
"model.visual.blocks.9.attn.proj.weight": "model-00001-of-00002.safetensors",
|
| 978 |
"model.audio.blocks.13.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 979 |
"model.audio.blocks.15.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 980 |
"model.layers.14.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 981 |
-
"model.
|
| 982 |
-
"model.
|
| 983 |
-
"model.visual.blocks.3.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 984 |
-
"model.visual.blocks.4.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 985 |
-
"model.visual.blocks.8.norm2.bias": "model-00001-of-00002.safetensors",
|
| 986 |
-
"model.visual.blocks.11.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 987 |
-
"model.visual.blocks.15.norm2.bias": "model-00001-of-00002.safetensors",
|
| 988 |
-
"model.visual.blocks.23.norm2.bias": "model-00001-of-00002.safetensors",
|
| 989 |
-
"model.visual.merger.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 990 |
"model.audio.blocks.2.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 991 |
"model.audio.blocks.5.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 992 |
"model.audio.blocks.7.attn.query.bias": "model-00001-of-00002.safetensors",
|
|
@@ -1013,18 +715,7 @@
|
|
| 1013 |
"model.layers.21.attention.v_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 1014 |
"model.layers.23.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 1015 |
"model.layers.24.enorm.weight": "model-00001-of-00002.safetensors",
|
| 1016 |
-
"linear_proj.2.bias": "model-00001-of-00002.safetensors",
|
| 1017 |
"linear_proj_audio.7.bias": "model-00001-of-00002.safetensors",
|
| 1018 |
-
"lm_head.weight": "model-00001-of-00002.safetensors",
|
| 1019 |
-
"model.visual.blocks.0.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1020 |
-
"model.visual.blocks.3.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1021 |
-
"model.visual.blocks.4.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 1022 |
-
"model.visual.blocks.6.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1023 |
-
"model.visual.blocks.8.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1024 |
-
"model.visual.blocks.10.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1025 |
-
"model.visual.blocks.15.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1026 |
-
"model.visual.blocks.19.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1027 |
-
"model.visual.blocks.23.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1028 |
"model.audio.blocks.5.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 1029 |
"model.audio.blocks.6.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 1030 |
"model.audio.blocks.9.attn.out.bias": "model-00001-of-00002.safetensors",
|
|
@@ -1053,15 +744,9 @@
|
|
| 1053 |
"model.layers.19.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 1054 |
"model.layers.22.attention.A_log": "model-00001-of-00002.safetensors",
|
| 1055 |
"model.layers.22.attention.k_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 1056 |
-
"model.
|
| 1057 |
-
"model.
|
| 1058 |
-
"model.
|
| 1059 |
-
"model.visual.blocks.7.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1060 |
-
"model.visual.blocks.8.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 1061 |
-
"model.visual.blocks.10.norm2.bias": "model-00001-of-00002.safetensors",
|
| 1062 |
-
"model.visual.blocks.15.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 1063 |
-
"model.visual.blocks.19.norm2.bias": "model-00001-of-00002.safetensors",
|
| 1064 |
-
"model.visual.blocks.23.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 1065 |
"model.audio.blocks.5.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 1066 |
"model.audio.blocks.7.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 1067 |
"model.audio.blocks.9.attn.query.bias": "model-00001-of-00002.safetensors",
|
|
@@ -1090,15 +775,6 @@
|
|
| 1090 |
"model.layers.19.attention.q_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 1091 |
"model.layers.19.attention.kv_a_proj_with_mqa.weight": "model-00001-of-00002.safetensors",
|
| 1092 |
"model.layers.22.attention.q_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 1093 |
-
"model.visual.blocks.3.norm2.weight": "model-00001-of-00002.safetensors",
|
| 1094 |
-
"model.visual.blocks.6.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 1095 |
-
"model.visual.blocks.8.norm1.bias": "model-00001-of-00002.safetensors",
|
| 1096 |
-
"model.visual.blocks.8.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1097 |
-
"model.visual.blocks.10.norm2.weight": "model-00001-of-00002.safetensors",
|
| 1098 |
-
"model.visual.blocks.10.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1099 |
-
"model.visual.blocks.15.norm1.bias": "model-00001-of-00002.safetensors",
|
| 1100 |
-
"model.visual.blocks.19.norm2.weight": "model-00001-of-00002.safetensors",
|
| 1101 |
-
"model.visual.blocks.23.norm1.bias": "model-00001-of-00002.safetensors",
|
| 1102 |
"model.audio.blocks.5.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 1103 |
"model.audio.blocks.8.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 1104 |
"model.audio.blocks.9.attn.value.bias": "model-00001-of-00002.safetensors",
|
|
@@ -1127,15 +803,6 @@
|
|
| 1127 |
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 1128 |
"model.layers.22.attention.v_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 1129 |
"model.layers.23.attention.kv_a_proj_with_mqa.weight": "model-00001-of-00002.safetensors",
|
| 1130 |
-
"model.visual.blocks.2.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1131 |
-
"model.visual.blocks.4.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1132 |
-
"model.visual.blocks.7.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 1133 |
-
"model.visual.blocks.8.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1134 |
-
"model.visual.blocks.9.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1135 |
-
"model.visual.blocks.11.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1136 |
-
"model.visual.blocks.11.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1137 |
-
"model.visual.blocks.15.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1138 |
-
"model.visual.blocks.23.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1139 |
"model.audio.blocks.6.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 1140 |
"model.audio.blocks.9.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 1141 |
"model.audio.blocks.9.mlp.0.bias": "model-00001-of-00002.safetensors",
|
|
@@ -1164,14 +831,8 @@
|
|
| 1164 |
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 1165 |
"model.layers.20.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 1166 |
"model.layers.20.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 1167 |
-
"model.
|
| 1168 |
-
"model.
|
| 1169 |
-
"model.visual.blocks.14.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1170 |
-
"model.visual.blocks.18.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1171 |
-
"model.visual.blocks.22.attn.proj.bias": "model-00001-of-00002.safetensors",
|
| 1172 |
-
"model.visual.blocks.26.norm1.weight": "model-00001-of-00002.safetensors",
|
| 1173 |
-
"model.visual.blocks.26.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 1174 |
-
"model.visual.merger.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 1175 |
"model.audio.blocks.1.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 1176 |
"model.audio.blocks.3.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 1177 |
"model.audio.blocks.4.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
@@ -1201,17 +862,8 @@
|
|
| 1201 |
"model.layers.17.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 1202 |
"model.layers.21.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 1203 |
"model.layers.21.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 1204 |
-
"linear_proj.0.bias": "model-00001-of-00002.safetensors",
|
| 1205 |
"linear_proj_audio.4.bias": "model-00001-of-00002.safetensors",
|
| 1206 |
-
"
|
| 1207 |
-
"model.visual.blocks.1.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 1208 |
-
"model.visual.blocks.6.norm2.bias": "model-00001-of-00002.safetensors",
|
| 1209 |
-
"model.visual.blocks.8.mlp.linear_fc1.bias": "model-00001-of-00002.safetensors",
|
| 1210 |
-
"model.visual.blocks.12.attn.qkv.bias": "model-00001-of-00002.safetensors",
|
| 1211 |
-
"model.visual.blocks.13.norm2.bias": "model-00001-of-00002.safetensors",
|
| 1212 |
-
"model.visual.blocks.18.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 1213 |
-
"model.visual.blocks.21.norm2.bias": "model-00001-of-00002.safetensors",
|
| 1214 |
-
"model.visual.blocks.26.mlp.linear_fc2.bias": "model-00001-of-00002.safetensors",
|
| 1215 |
"model.audio.blocks.0.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 1216 |
"model.audio.blocks.1.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 1217 |
"model.audio.blocks.3.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
@@ -1243,7 +895,8 @@
|
|
| 1243 |
"model.layers.23.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 1244 |
"model.layers.24.attention.kv_a_proj_with_mqa.weight": "model-00001-of-00002.safetensors",
|
| 1245 |
"linear_proj_audio.0.bias": "model-00001-of-00002.safetensors",
|
| 1246 |
-
"model.
|
|
|
|
| 1247 |
"model.audio.blocks.17.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 1248 |
"model.audio.blocks.17.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 1249 |
"model.layers.1.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -1258,6 +911,8 @@
|
|
| 1258 |
"model.layers.1.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 1259 |
"model.layers.3.attention.q_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 1260 |
"model.layers.17.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 1261 |
"model.audio.blocks.18.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 1262 |
"model.audio.blocks.19.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 1263 |
"model.layers.4.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -1268,13 +923,13 @@
|
|
| 1268 |
"model.audio.blocks.18.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 1269 |
"model.audio.blocks.19.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 1270 |
"model.layers.17.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 1271 |
"model.audio.blocks.2.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 1272 |
"model.audio.blocks.19.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 1273 |
"model.layers.4.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 1274 |
"model.layers.10.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 1275 |
"model.layers.17.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 1276 |
-
"model.visual.merger.linear_fc2.weight": "model-00001-of-00002.safetensors",
|
| 1277 |
-
"model.visual.merger.linear_fc1.weight": "model-00001-of-00002.safetensors",
|
| 1278 |
"model.audio.blocks.2.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 1279 |
"model.audio.blocks.19.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 1280 |
"model.layers.5.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -1285,11 +940,17 @@
|
|
| 1285 |
"model.audio.blocks.19.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 1286 |
"model.audio.blocks.20.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 1287 |
"model.layers.18.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1288 |
"model.audio.blocks.19.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 1289 |
"model.audio.blocks.20.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 1290 |
"model.layers.5.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 1291 |
"model.layers.11.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 1292 |
"model.layers.18.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 1293 |
"model.audio.blocks.2.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 1294 |
"model.audio.blocks.21.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 1295 |
"model.layers.6.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -1305,6 +966,8 @@
|
|
| 1305 |
"model.audio.blocks.22.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 1306 |
"model.layers.6.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 1307 |
"model.layers.18.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 1308 |
"model.layers.1.mlp.experts.0.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 1309 |
"model.layers.1.mlp.experts.0.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 1310 |
"model.layers.1.mlp.experts.0.down_proj.weight": "model-00001-of-00002.safetensors",
|
|
@@ -10522,4 +10185,4 @@
|
|
| 10522 |
"model.layers.24.mlp.experts.127.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 10523 |
"model.layers.24.mlp.experts.127.down_proj.weight": "model-00002-of-00002.safetensors"
|
| 10524 |
}
|
| 10525 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 17742692480
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"model.audio.blocks.28.attn.query.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 8 |
"model.layers.23.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 9 |
"model.layers.23.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 10 |
"linear_proj_audio.2.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
"model.audio.blocks.20.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 12 |
"model.audio.blocks.24.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 13 |
"model.layers.2.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 35 |
"model.layers.9.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 36 |
"model.layers.15.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 37 |
"model.layers.15.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 38 |
"model.audio.blocks.21.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 39 |
"model.audio.blocks.26.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 40 |
"model.layers.20.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 41 |
+
"model.audio.blocks.28.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 42 |
+
"model.layers.5.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 43 |
+
"linear_proj_audio.4.weight": "model-00001-of-00002.safetensors",
|
| 44 |
"model.audio.blocks.22.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 45 |
"model.audio.blocks.27.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 46 |
"model.layers.9.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 66 |
"model.layers.16.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 67 |
"model.layers.20.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 68 |
"model.layers.24.attention.q_b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
"model.audio.conv1.weight": "model-00001-of-00002.safetensors",
|
| 70 |
"model.audio.blocks.23.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 71 |
"model.audio.blocks.29.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 72 |
"model.layers.17.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 73 |
"model.layers.17.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 74 |
"model.layers.21.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 75 |
+
"model.audio.blocks.29.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 76 |
+
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 77 |
+
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 78 |
+
"model.layers.5.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 79 |
+
"model.layers.23.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 80 |
"model.audio.blocks.3.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 81 |
"model.audio.blocks.23.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 82 |
"model.layers.11.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 101 |
"model.layers.3.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
| 102 |
"model.layers.18.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 103 |
"model.layers.21.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 104 |
"model.audio.blocks.24.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 105 |
"model.audio.blocks.31.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 106 |
"model.layers.7.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
| 107 |
"model.layers.19.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 108 |
"model.layers.19.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 109 |
"model.layers.22.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 110 |
+
"model.audio.blocks.29.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 111 |
+
"model.layers.5.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 112 |
+
"model.layers.23.attention.q_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 113 |
"model.audio.blocks.4.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 114 |
"model.audio.blocks.25.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 115 |
"model.layers.22.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 116 |
"model.layers.24.attention.q_a_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
"model.audio.blocks.4.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 118 |
"model.audio.blocks.4.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 119 |
"model.audio.blocks.7.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 133 |
"model.layers.22.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 134 |
"model.norm.weight": "model-00001-of-00002.safetensors",
|
| 135 |
"model.layers.24.final_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
"model.audio.blocks.4.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 137 |
"model.audio.blocks.5.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 138 |
"model.audio.blocks.7.attn_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 154 |
"model.layers.22.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 155 |
"model.layers.24.hnorm.weight": "model-00001-of-00002.safetensors",
|
| 156 |
"model.layers.24.attention.kv_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
"model.audio.blocks.3.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 158 |
"model.audio.blocks.4.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 159 |
"model.audio.blocks.5.mlp.2.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 177 |
"model.layers.20.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 178 |
"model.layers.22.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 179 |
"model.layers.24.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
"model.audio.blocks.3.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 181 |
"model.audio.blocks.4.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 182 |
"model.audio.blocks.6.mlp.0.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 198 |
"model.layers.20.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 199 |
"model.layers.22.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 200 |
"model.layers.24.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
"model.audio.blocks.0.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 202 |
"model.audio.blocks.6.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 203 |
"model.audio.blocks.6.mlp.2.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 218 |
"model.layers.13.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 219 |
"model.layers.21.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 220 |
"model.layers.23.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 221 |
+
"model.audio.blocks.29.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 222 |
+
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 223 |
+
"model.layers.3.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 224 |
+
"model.layers.3.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 225 |
+
"model.layers.5.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
| 226 |
"model.audio.blocks.0.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 227 |
"model.audio.blocks.2.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 228 |
"model.audio.blocks.6.attn.value.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 244 |
"model.layers.20.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 245 |
"model.layers.20.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 246 |
"model.layers.21.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
"model.audio.blocks.0.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 248 |
"model.audio.blocks.2.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 249 |
"model.audio.blocks.6.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 263 |
"model.layers.15.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 264 |
"model.layers.16.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 265 |
"model.layers.22.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
"model.audio.blocks.0.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 267 |
"model.audio.blocks.2.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 268 |
"model.audio.blocks.6.attn_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 283 |
"model.layers.17.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 284 |
"model.layers.20.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 285 |
"model.layers.22.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
"model.audio.conv1.bias": "model-00001-of-00002.safetensors",
|
| 287 |
"model.audio.blocks.0.attn_ln.weight": "model-00001-of-00002.safetensors",
|
| 288 |
"model.audio.blocks.2.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 304 |
"model.layers.21.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 305 |
"model.layers.21.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 306 |
"model.layers.23.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
"model.audio.conv2.bias": "model-00001-of-00002.safetensors",
|
| 308 |
"model.audio.blocks.0.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 309 |
"model.audio.blocks.2.attn_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 323 |
"model.layers.18.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 324 |
"model.layers.23.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 325 |
"model.layers.24.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
"model.audio.blocks.0.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 327 |
"model.audio.blocks.2.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 328 |
"model.audio.blocks.6.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 343 |
"model.layers.20.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 344 |
"model.layers.21.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 345 |
"model.layers.24.attention.q_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 346 |
+
"model.audio.blocks.0.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 347 |
+
"model.audio.blocks.13.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 348 |
+
"model.layers.12.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 349 |
"model.audio.blocks.7.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 350 |
"model.audio.blocks.12.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 351 |
"model.layers.12.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
"model.audio.blocks.0.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 353 |
"model.audio.blocks.2.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 354 |
"model.audio.blocks.5.attn.key.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 369 |
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 370 |
"model.layers.21.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 371 |
"linear_proj_audio.0.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
"model.audio.blocks.3.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 373 |
"model.audio.blocks.4.attn_ln.weight": "model-00001-of-00002.safetensors",
|
| 374 |
"model.audio.blocks.7.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 383 |
"model.layers.22.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 384 |
"model.layers.22.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 385 |
"model.layers.23.attention.kv_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
"model.audio.conv2.weight": "model-00001-of-00002.safetensors",
|
| 387 |
"model.audio.blocks.1.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 388 |
"model.audio.blocks.3.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 407 |
"model.layers.22.attention.dt_bias": "model-00001-of-00002.safetensors",
|
| 408 |
"model.layers.22.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 409 |
"model.layers.22.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 410 |
"model.audio.blocks.12.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 411 |
"model.layers.24.eh_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 412 |
"model.audio.blocks.0.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 413 |
"model.audio.blocks.13.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 414 |
"model.layers.13.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 415 |
"linear_proj_audio.7.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 416 |
"model.audio.blocks.5.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 417 |
"model.layers.11.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 418 |
"model.audio.blocks.5.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 419 |
"model.layers.15.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 420 |
"model.audio.blocks.6.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 421 |
"model.layers.19.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 422 |
"model.audio.blocks.6.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 423 |
"model.layers.23.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 424 |
+
"model.audio.blocks.6.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 425 |
+
"model.layers.3.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 426 |
"model.audio.blocks.1.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 427 |
"model.audio.blocks.13.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 428 |
"model.layers.13.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
"model.audio.blocks.6.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 430 |
"model.layers.7.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 431 |
"model.audio.blocks.7.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 432 |
"model.layers.24.attention.kv_b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
"model.audio.blocks.5.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 434 |
"model.audio.blocks.7.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 435 |
"model.layers.12.attention.A_log": "model-00001-of-00002.safetensors",
|
| 436 |
"model.layers.16.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 437 |
"model.layers.17.attention.A_log": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 438 |
"model.audio.blocks.0.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 439 |
"model.audio.blocks.29.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 440 |
"model.layers.2.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 441 |
"model.audio.blocks.0.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 442 |
"model.audio.blocks.3.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 443 |
"model.layers.20.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 444 |
+
"model.audio.blocks.0.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 445 |
+
"model.audio.blocks.3.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 446 |
+
"model.layers.21.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 447 |
"model.audio.blocks.20.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 448 |
"model.audio.blocks.23.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 449 |
"model.layers.7.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 450 |
"model.layers.7.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 451 |
+
"model.layers.13.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 452 |
+
"model.layers.13.mlp.shared_experts.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 453 |
"model.layers.19.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 454 |
"model.audio.blocks.2.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 455 |
"model.audio.blocks.22.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 456 |
"model.layers.12.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 457 |
"model.layers.18.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 458 |
"model.audio.blocks.0.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 459 |
"model.audio.blocks.3.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 460 |
"model.layers.22.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 461 |
"model.audio.blocks.1.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 462 |
"model.audio.blocks.3.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 463 |
"model.layers.23.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 464 |
"model.audio.blocks.1.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 465 |
"model.audio.blocks.30.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 466 |
"model.layers.3.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 467 |
"model.audio.blocks.1.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 468 |
"model.audio.blocks.30.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 469 |
"model.layers.4.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 470 |
"model.audio.blocks.1.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 471 |
"model.audio.blocks.30.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 472 |
"model.layers.5.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 473 |
"model.audio.blocks.10.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 474 |
"model.audio.blocks.30.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 475 |
"model.layers.6.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
| 476 |
+
"model.audio.blocks.1.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 477 |
+
"model.audio.blocks.13.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 478 |
+
"model.layers.13.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 479 |
"model.audio.blocks.10.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 480 |
"model.audio.blocks.31.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 481 |
"model.layers.7.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 482 |
"model.audio.blocks.10.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 483 |
"model.audio.blocks.31.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 484 |
"model.layers.8.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 485 |
"model.audio.blocks.10.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 486 |
"model.audio.blocks.31.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 487 |
"model.layers.9.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 488 |
"model.audio.blocks.11.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 489 |
"model.audio.blocks.31.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 490 |
"model.layers.24.mlp.gate.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 491 |
"model.audio.blocks.1.attn_ln.weight": "model-00001-of-00002.safetensors",
|
| 492 |
"model.audio.blocks.3.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 493 |
"model.audio.blocks.3.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 514 |
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 515 |
"model.layers.20.attention.q_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 516 |
"model.layers.24.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
"model.audio.blocks.1.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 518 |
"model.audio.blocks.4.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 519 |
"model.audio.blocks.5.attn.value.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 542 |
"model.layers.16.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 543 |
"model.layers.20.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 544 |
"model.layers.20.attention.v_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 545 |
+
"model.audio.blocks.10.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 546 |
+
"model.audio.blocks.14.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 547 |
+
"model.layers.13.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 548 |
"model.audio.blocks.1.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 549 |
"model.audio.blocks.2.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 550 |
"model.audio.blocks.4.attn.query.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 573 |
"model.layers.17.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 574 |
"model.layers.21.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 575 |
"model.layers.21.attention.k_conv1d.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 576 |
"model.audio.blocks.1.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 577 |
"model.audio.blocks.4.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 578 |
"model.audio.blocks.4.mlp.0.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 604 |
"model.layers.20.attention.A_log": "model-00001-of-00002.safetensors",
|
| 605 |
"model.layers.21.attention.q_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 606 |
"model.layers.22.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 607 |
"model.audio.positional_embedding": "model-00001-of-00002.safetensors",
|
| 608 |
"model.audio.blocks.1.attn.query.bias": "model-00001-of-00002.safetensors",
|
| 609 |
"model.audio.blocks.1.mlp.0.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 628 |
"model.layers.20.attention.k_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 629 |
"model.layers.23.attention.q_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 630 |
"linear_proj_audio.2.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 631 |
"model.audio.blocks.7.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 632 |
"model.layers.0.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 633 |
"model.layers.5.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 634 |
"model.audio.blocks.7.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 635 |
"model.layers.0.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 636 |
"model.layers.5.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 637 |
"model.audio.blocks.8.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 638 |
"model.layers.0.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 639 |
"model.layers.6.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 640 |
+
"model.audio.blocks.10.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 641 |
+
"model.audio.blocks.14.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 642 |
+
"model.layers.13.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 643 |
"model.audio.blocks.8.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 644 |
"model.layers.0.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 645 |
"model.layers.6.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 646 |
"model.audio.blocks.8.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 647 |
"model.layers.0.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 648 |
"model.layers.6.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 649 |
"model.audio.blocks.8.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 650 |
"model.layers.0.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 651 |
"model.layers.6.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 652 |
"model.audio.blocks.9.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 653 |
"model.layers.1.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 654 |
"model.layers.6.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 655 |
"model.audio.blocks.9.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 656 |
"model.layers.1.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 657 |
"model.layers.6.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 658 |
"model.audio.blocks.9.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 659 |
"model.layers.1.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 660 |
"model.layers.7.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 661 |
+
"model.audio.blocks.11.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 662 |
+
"model.audio.blocks.14.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 663 |
+
"model.layers.13.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 664 |
"model.audio.blocks.9.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 665 |
"model.layers.1.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 666 |
"model.layers.8.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 667 |
"model.layers.1.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 668 |
"model.layers.8.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 669 |
"model.layers.1.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 670 |
"model.layers.8.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 671 |
"model.layers.8.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 672 |
"model.layers.10.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 673 |
"model.layers.8.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 674 |
"model.layers.10.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 675 |
"model.audio.blocks.11.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 676 |
"model.audio.blocks.14.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 677 |
"model.layers.14.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 678 |
"model.audio.blocks.12.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 679 |
"model.audio.blocks.15.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 680 |
"model.layers.14.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 681 |
"model.audio.blocks.12.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 682 |
"model.audio.blocks.15.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 683 |
"model.layers.14.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 684 |
"model.audio.blocks.13.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 685 |
"model.audio.blocks.15.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 686 |
"model.layers.14.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 687 |
"model.audio.blocks.13.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 688 |
"model.audio.blocks.15.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 689 |
"model.layers.14.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 690 |
+
"model.layers.8.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 691 |
+
"model.layers.10.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 692 |
"model.audio.blocks.2.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 693 |
"model.audio.blocks.5.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 694 |
"model.audio.blocks.7.attn.query.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 715 |
"model.layers.21.attention.v_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 716 |
"model.layers.23.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 717 |
"model.layers.24.enorm.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 718 |
"linear_proj_audio.7.bias": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 719 |
"model.audio.blocks.5.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 720 |
"model.audio.blocks.6.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 721 |
"model.audio.blocks.9.attn.out.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 744 |
"model.layers.19.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 745 |
"model.layers.22.attention.A_log": "model-00001-of-00002.safetensors",
|
| 746 |
"model.layers.22.attention.k_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 747 |
+
"model.word_embeddings.weight": "model-00001-of-00002.safetensors",
|
| 748 |
+
"model.layers.9.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 749 |
+
"model.layers.10.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 750 |
"model.audio.blocks.5.mlp_ln.bias": "model-00001-of-00002.safetensors",
|
| 751 |
"model.audio.blocks.7.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 752 |
"model.audio.blocks.9.attn.query.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 775 |
"model.layers.19.attention.q_a_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 776 |
"model.layers.19.attention.kv_a_proj_with_mqa.weight": "model-00001-of-00002.safetensors",
|
| 777 |
"model.layers.22.attention.q_conv1d.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 778 |
"model.audio.blocks.5.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
| 779 |
"model.audio.blocks.8.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 780 |
"model.audio.blocks.9.attn.value.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 803 |
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 804 |
"model.layers.22.attention.v_conv1d.weight": "model-00001-of-00002.safetensors",
|
| 805 |
"model.layers.23.attention.kv_a_proj_with_mqa.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 806 |
"model.audio.blocks.6.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 807 |
"model.audio.blocks.9.attn_ln.bias": "model-00001-of-00002.safetensors",
|
| 808 |
"model.audio.blocks.9.mlp.0.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 831 |
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 832 |
"model.layers.20.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 833 |
"model.layers.20.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 834 |
+
"model.layers.9.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 835 |
+
"model.layers.10.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 836 |
"model.audio.blocks.1.attn.value.bias": "model-00001-of-00002.safetensors",
|
| 837 |
"model.audio.blocks.3.mlp.2.bias": "model-00001-of-00002.safetensors",
|
| 838 |
"model.audio.blocks.4.mlp_ln.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 862 |
"model.layers.17.attention.b_proj.weight": "model-00001-of-00002.safetensors",
|
| 863 |
"model.layers.21.attention.o_norm.weight": "model-00001-of-00002.safetensors",
|
| 864 |
"model.layers.21.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 865 |
"linear_proj_audio.4.bias": "model-00001-of-00002.safetensors",
|
| 866 |
+
"lm_head.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 867 |
"model.audio.blocks.0.mlp.0.bias": "model-00001-of-00002.safetensors",
|
| 868 |
"model.audio.blocks.1.attn.out.bias": "model-00001-of-00002.safetensors",
|
| 869 |
"model.audio.blocks.3.attn_ln.bias": "model-00001-of-00002.safetensors",
|
|
|
|
| 895 |
"model.layers.23.mlp.gate.expert_bias": "model-00001-of-00002.safetensors",
|
| 896 |
"model.layers.24.attention.kv_a_proj_with_mqa.weight": "model-00001-of-00002.safetensors",
|
| 897 |
"linear_proj_audio.0.bias": "model-00001-of-00002.safetensors",
|
| 898 |
+
"model.layers.9.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 899 |
+
"model.layers.10.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 900 |
"model.audio.blocks.17.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 901 |
"model.audio.blocks.17.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 902 |
"model.layers.1.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 911 |
"model.layers.1.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 912 |
"model.layers.3.attention.q_b_proj.weight": "model-00001-of-00002.safetensors",
|
| 913 |
"model.layers.17.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 914 |
+
"model.layers.9.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 915 |
+
"model.layers.11.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 916 |
"model.audio.blocks.18.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 917 |
"model.audio.blocks.19.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 918 |
"model.layers.4.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 923 |
"model.audio.blocks.18.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 924 |
"model.audio.blocks.19.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 925 |
"model.layers.17.attention.q_proj.weight": "model-00001-of-00002.safetensors",
|
| 926 |
+
"model.layers.9.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 927 |
+
"model.layers.12.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 928 |
"model.audio.blocks.2.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 929 |
"model.audio.blocks.19.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 930 |
"model.layers.4.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 931 |
"model.layers.10.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 932 |
"model.layers.17.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
|
|
|
| 933 |
"model.audio.blocks.2.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 934 |
"model.audio.blocks.19.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 935 |
"model.layers.5.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 940 |
"model.audio.blocks.19.attn.query.weight": "model-00001-of-00002.safetensors",
|
| 941 |
"model.audio.blocks.20.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 942 |
"model.layers.18.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 943 |
+
"model.audio.blocks.20.attn.out.weight": "model-00001-of-00002.safetensors",
|
| 944 |
+
"model.audio.blocks.23.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 945 |
+
"model.layers.2.attention.f_proj.weight": "model-00001-of-00002.safetensors",
|
| 946 |
+
"model.layers.7.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 947 |
"model.audio.blocks.19.attn.value.weight": "model-00001-of-00002.safetensors",
|
| 948 |
"model.audio.blocks.20.mlp.2.weight": "model-00001-of-00002.safetensors",
|
| 949 |
"model.layers.5.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 950 |
"model.layers.11.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 951 |
"model.layers.18.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 952 |
+
"model.layers.9.attention.o_proj.weight": "model-00001-of-00002.safetensors",
|
| 953 |
+
"model.layers.12.attention.g_proj.weight": "model-00001-of-00002.safetensors",
|
| 954 |
"model.audio.blocks.2.attn.key.weight": "model-00001-of-00002.safetensors",
|
| 955 |
"model.audio.blocks.21.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 956 |
"model.layers.6.mlp.shared_experts.gate_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 966 |
"model.audio.blocks.22.mlp.0.weight": "model-00001-of-00002.safetensors",
|
| 967 |
"model.layers.6.mlp.shared_experts.down_proj.weight": "model-00001-of-00002.safetensors",
|
| 968 |
"model.layers.18.attention.v_proj.weight": "model-00001-of-00002.safetensors",
|
| 969 |
+
"model.layers.12.attention.k_proj.weight": "model-00001-of-00002.safetensors",
|
| 970 |
+
"model.layers.24.attention.dense.weight": "model-00001-of-00002.safetensors",
|
| 971 |
"model.layers.1.mlp.experts.0.gate_proj.weight": "model-00001-of-00002.safetensors",
|
| 972 |
"model.layers.1.mlp.experts.0.up_proj.weight": "model-00001-of-00002.safetensors",
|
| 973 |
"model.layers.1.mlp.experts.0.down_proj.weight": "model-00001-of-00002.safetensors",
|
|
|
|
| 10185 |
"model.layers.24.mlp.experts.127.up_proj.weight": "model-00002-of-00002.safetensors",
|
| 10186 |
"model.layers.24.mlp.experts.127.down_proj.weight": "model-00002-of-00002.safetensors"
|
| 10187 |
}
|
| 10188 |
+
}
|
modeling_bailing_moe_v3.py
CHANGED
|
@@ -38,7 +38,7 @@ from transformers.modeling_attn_mask_utils import (
|
|
| 38 |
)
|
| 39 |
from transformers.modeling_outputs import MoeModelOutputWithPast
|
| 40 |
from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
|
| 41 |
-
from transformers.modeling_utils import PreTrainedModel
|
| 42 |
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS, is_torch_greater_or_equal_than_1_13
|
| 43 |
from transformers.utils import (
|
| 44 |
add_start_docstrings,
|
|
@@ -46,8 +46,12 @@ from transformers.utils import (
|
|
| 46 |
logging,
|
| 47 |
replace_return_docstrings,
|
| 48 |
)
|
| 49 |
-
|
| 50 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
from transformers.generation.utils import GenerationMixin
|
| 52 |
from dataclasses import dataclass
|
| 53 |
from transformers.utils import ModelOutput
|
|
@@ -246,6 +250,15 @@ class BailingMoeV3GroupRMSNorm(nn.Module):
|
|
| 246 |
ALL_LAYERNORM_LAYERS.append(BailingMoeV3RMSNorm)
|
| 247 |
|
| 248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
class BailingMoeV3RotaryEmbedding(nn.Module):
|
| 250 |
def __init__(self, config: BailingMoeV3Config, device=None):
|
| 251 |
super().__init__()
|
|
@@ -260,7 +273,11 @@ class BailingMoeV3RotaryEmbedding(nn.Module):
|
|
| 260 |
self.config = deepcopy(config)
|
| 261 |
self.config.head_dim = config.qk_rope_head_dim
|
| 262 |
self.config.partial_rotary_factor = 1.0
|
| 263 |
-
self.rope_init_fn =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
|
| 266 |
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
|
@@ -672,8 +689,8 @@ class BailingMoeV3MultiLatentAttention(nn.Module):
|
|
| 672 |
self.scaling = self.qk_head_dim ** (-0.5)
|
| 673 |
if self.config.rope_scaling is not None:
|
| 674 |
mscale_all_dim = self.config.rope_scaling.get("mscale_all_dim", 0)
|
| 675 |
-
scaling_factor = self.config.rope_scaling["factor"]
|
| 676 |
if mscale_all_dim:
|
|
|
|
| 677 |
mscale = yarn_get_mscale(scaling_factor, mscale_all_dim)
|
| 678 |
self.scaling = self.scaling * mscale * mscale
|
| 679 |
|
|
@@ -727,6 +744,10 @@ class BailingMoeV3MultiLatentAttention(nn.Module):
|
|
| 727 |
value_states = F.pad(value_states, [0, self.qk_head_dim - self.v_head_dim])
|
| 728 |
|
| 729 |
attention_interface: Callable = eager_attention_forward
|
|
|
|
|
|
|
|
|
|
|
|
|
| 730 |
|
| 731 |
attn_output, attn_weights = attention_interface(
|
| 732 |
self,
|
|
@@ -1345,8 +1366,14 @@ class BailingMoeV3Model(BailingMoeV3PreTrainedModel):
|
|
| 1345 |
if inputs_embeds is None:
|
| 1346 |
inputs_embeds = self.word_embeddings(input_ids)
|
| 1347 |
|
|
|
|
|
|
|
|
|
|
| 1348 |
if cache_position is None:
|
| 1349 |
-
past_seen_tokens =
|
|
|
|
|
|
|
|
|
|
| 1350 |
cache_position: torch.Tensor = torch.arange(
|
| 1351 |
past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
|
| 1352 |
)
|
|
@@ -1354,7 +1381,6 @@ class BailingMoeV3Model(BailingMoeV3PreTrainedModel):
|
|
| 1354 |
if position_ids is None:
|
| 1355 |
position_ids = cache_position.unsqueeze(0)
|
| 1356 |
|
| 1357 |
-
softmax_attention_layer_id = self.config.layer_group_size - 1
|
| 1358 |
past_seen_tokens = (
|
| 1359 |
past_key_values.get_seq_length(layer_idx=softmax_attention_layer_id) if past_key_values is not None else 0
|
| 1360 |
)
|
|
@@ -1515,7 +1541,7 @@ class BailingMoeV3Model(BailingMoeV3PreTrainedModel):
|
|
| 1515 |
|
| 1516 |
|
| 1517 |
class BailingMoeV3ForCausalLM(BailingMoeV3PreTrainedModel, GenerationMixin):
|
| 1518 |
-
_tied_weights_keys =
|
| 1519 |
|
| 1520 |
def __init__(self, config: BailingMoeV3Config):
|
| 1521 |
super().__init__(config)
|
|
|
|
| 38 |
)
|
| 39 |
from transformers.modeling_outputs import MoeModelOutputWithPast
|
| 40 |
from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
|
| 41 |
+
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 42 |
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS, is_torch_greater_or_equal_than_1_13
|
| 43 |
from transformers.utils import (
|
| 44 |
add_start_docstrings,
|
|
|
|
| 46 |
logging,
|
| 47 |
replace_return_docstrings,
|
| 48 |
)
|
| 49 |
+
try:
|
| 50 |
+
from transformers.utils.import_utils import is_torch_fx_available
|
| 51 |
+
except ImportError:
|
| 52 |
+
def is_torch_fx_available():
|
| 53 |
+
return False
|
| 54 |
+
from .configuration_bailing_moe_v3 import BailingMoeV3Config
|
| 55 |
from transformers.generation.utils import GenerationMixin
|
| 56 |
from dataclasses import dataclass
|
| 57 |
from transformers.utils import ModelOutput
|
|
|
|
| 250 |
ALL_LAYERNORM_LAYERS.append(BailingMoeV3RMSNorm)
|
| 251 |
|
| 252 |
|
| 253 |
+
def _compute_default_rope_parameters(config, device=None, seq_len=None):
|
| 254 |
+
# Transformers 5 no longer includes the unscaled initializer in its registry.
|
| 255 |
+
dim = int(config.head_dim * getattr(config, "partial_rotary_factor", 1.0))
|
| 256 |
+
inv_freq = 1.0 / (
|
| 257 |
+
config.rope_theta ** (torch.arange(0, dim, 2, device=device).float() / dim)
|
| 258 |
+
)
|
| 259 |
+
return inv_freq, 1.0
|
| 260 |
+
|
| 261 |
+
|
| 262 |
class BailingMoeV3RotaryEmbedding(nn.Module):
|
| 263 |
def __init__(self, config: BailingMoeV3Config, device=None):
|
| 264 |
super().__init__()
|
|
|
|
| 273 |
self.config = deepcopy(config)
|
| 274 |
self.config.head_dim = config.qk_rope_head_dim
|
| 275 |
self.config.partial_rotary_factor = 1.0
|
| 276 |
+
self.rope_init_fn = (
|
| 277 |
+
_compute_default_rope_parameters
|
| 278 |
+
if self.rope_type == "default"
|
| 279 |
+
else ROPE_INIT_FUNCTIONS[self.rope_type]
|
| 280 |
+
)
|
| 281 |
|
| 282 |
inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
|
| 283 |
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
|
|
|
| 689 |
self.scaling = self.qk_head_dim ** (-0.5)
|
| 690 |
if self.config.rope_scaling is not None:
|
| 691 |
mscale_all_dim = self.config.rope_scaling.get("mscale_all_dim", 0)
|
|
|
|
| 692 |
if mscale_all_dim:
|
| 693 |
+
scaling_factor = self.config.rope_scaling["factor"]
|
| 694 |
mscale = yarn_get_mscale(scaling_factor, mscale_all_dim)
|
| 695 |
self.scaling = self.scaling * mscale * mscale
|
| 696 |
|
|
|
|
| 744 |
value_states = F.pad(value_states, [0, self.qk_head_dim - self.v_head_dim])
|
| 745 |
|
| 746 |
attention_interface: Callable = eager_attention_forward
|
| 747 |
+
if self.config._attn_implementation != "eager":
|
| 748 |
+
attention_interface = ALL_ATTENTION_FUNCTIONS.get(
|
| 749 |
+
self.config._attn_implementation, eager_attention_forward
|
| 750 |
+
)
|
| 751 |
|
| 752 |
attn_output, attn_weights = attention_interface(
|
| 753 |
self,
|
|
|
|
| 1366 |
if inputs_embeds is None:
|
| 1367 |
inputs_embeds = self.word_embeddings(input_ids)
|
| 1368 |
|
| 1369 |
+
# Recurrent KDA states do not encode sequence length. Use the first
|
| 1370 |
+
# softmax attention cache for positions as well as the causal mask.
|
| 1371 |
+
softmax_attention_layer_id = min(self.config.layer_group_size - 1, self.config.num_hidden_layers - 1)
|
| 1372 |
if cache_position is None:
|
| 1373 |
+
past_seen_tokens = (
|
| 1374 |
+
past_key_values.get_seq_length(layer_idx=softmax_attention_layer_id)
|
| 1375 |
+
if past_key_values is not None else 0
|
| 1376 |
+
)
|
| 1377 |
cache_position: torch.Tensor = torch.arange(
|
| 1378 |
past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
|
| 1379 |
)
|
|
|
|
| 1381 |
if position_ids is None:
|
| 1382 |
position_ids = cache_position.unsqueeze(0)
|
| 1383 |
|
|
|
|
| 1384 |
past_seen_tokens = (
|
| 1385 |
past_key_values.get_seq_length(layer_idx=softmax_attention_layer_id) if past_key_values is not None else 0
|
| 1386 |
)
|
|
|
|
| 1541 |
|
| 1542 |
|
| 1543 |
class BailingMoeV3ForCausalLM(BailingMoeV3PreTrainedModel, GenerationMixin):
|
| 1544 |
+
_tied_weights_keys = {"lm_head.weight": "model.word_embeddings.weight"}
|
| 1545 |
|
| 1546 |
def __init__(self, config: BailingMoeV3Config):
|
| 1547 |
super().__init__(config)
|
modeling_bailing_moe_v3_audio.py
CHANGED
|
@@ -19,6 +19,7 @@
|
|
| 19 |
# limitations under the License.
|
| 20 |
"""PyTorch BailingMoE V3 Audio model."""
|
| 21 |
|
|
|
|
| 22 |
from typing import Optional, Union
|
| 23 |
|
| 24 |
import torch
|
|
@@ -32,7 +33,7 @@ try:
|
|
| 32 |
except ImportError:
|
| 33 |
def is_torch_fx_available():
|
| 34 |
return False
|
| 35 |
-
from configuration_bailing_moe_v3_audio import (
|
| 36 |
BailingMoeV3AudioConfig,
|
| 37 |
BailingMoeV3AudioEncoderConfig,
|
| 38 |
)
|
|
@@ -118,7 +119,7 @@ class WhisperEncoderForBailing(nn.Module):
|
|
| 118 |
)
|
| 119 |
|
| 120 |
|
| 121 |
-
from modeling_bailing_moe_v3 import BailingMoeV3Model
|
| 122 |
|
| 123 |
|
| 124 |
@dataclass
|
|
@@ -158,7 +159,7 @@ class BailingMoeV3AudioPreTrainedModel(PreTrainedModel):
|
|
| 158 |
|
| 159 |
|
| 160 |
class BailingMoeV3AudioForConditionalGeneration(BailingMoeV3AudioPreTrainedModel, GenerationMixin):
|
| 161 |
-
_tied_weights_keys =
|
| 162 |
|
| 163 |
def __init__(self, config: BailingMoeV3AudioConfig, **kwargs):
|
| 164 |
super().__init__(config, **kwargs)
|
|
@@ -222,18 +223,29 @@ class BailingMoeV3AudioForConditionalGeneration(BailingMoeV3AudioPreTrainedModel
|
|
| 222 |
input_lengths = torch.tensor([chunk.shape[0] for chunk in chunks], dtype=torch.long, device=audio_feats.device)
|
| 223 |
chunk_batch = torch.nn.utils.rnn.pad_sequence(chunks, batch_first=True)
|
| 224 |
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
return audio_embeds
|
| 238 |
|
| 239 |
def prepare_inputs_for_generation(
|
|
@@ -255,6 +267,13 @@ class BailingMoeV3AudioForConditionalGeneration(BailingMoeV3AudioPreTrainedModel
|
|
| 255 |
and cache_position.numel() > 0
|
| 256 |
and cache_position[0].item() > 0
|
| 257 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
if is_decode_step:
|
| 259 |
model_inputs.pop("audio_feats", None)
|
| 260 |
model_inputs.pop("audio_feats_lengths", None)
|
|
|
|
| 19 |
# limitations under the License.
|
| 20 |
"""PyTorch BailingMoE V3 Audio model."""
|
| 21 |
|
| 22 |
+
import os
|
| 23 |
from typing import Optional, Union
|
| 24 |
|
| 25 |
import torch
|
|
|
|
| 33 |
except ImportError:
|
| 34 |
def is_torch_fx_available():
|
| 35 |
return False
|
| 36 |
+
from .configuration_bailing_moe_v3_audio import (
|
| 37 |
BailingMoeV3AudioConfig,
|
| 38 |
BailingMoeV3AudioEncoderConfig,
|
| 39 |
)
|
|
|
|
| 119 |
)
|
| 120 |
|
| 121 |
|
| 122 |
+
from .modeling_bailing_moe_v3 import BailingMoeV3Model
|
| 123 |
|
| 124 |
|
| 125 |
@dataclass
|
|
|
|
| 159 |
|
| 160 |
|
| 161 |
class BailingMoeV3AudioForConditionalGeneration(BailingMoeV3AudioPreTrainedModel, GenerationMixin):
|
| 162 |
+
_tied_weights_keys = {"lm_head.weight": "model.word_embeddings.weight"}
|
| 163 |
|
| 164 |
def __init__(self, config: BailingMoeV3AudioConfig, **kwargs):
|
| 165 |
super().__init__(config, **kwargs)
|
|
|
|
| 223 |
input_lengths = torch.tensor([chunk.shape[0] for chunk in chunks], dtype=torch.long, device=audio_feats.device)
|
| 224 |
chunk_batch = torch.nn.utils.rnn.pad_sequence(chunks, batch_first=True)
|
| 225 |
|
| 226 |
+
# Limit Whisper activations for long recordings. An unset value keeps
|
| 227 |
+
# the original single-batch path; each chunk has independent context.
|
| 228 |
+
micro_batch = int(os.environ.get("HF_SFT_WHISPER_MICRO_BATCH", "0"))
|
| 229 |
+
if micro_batch < 0:
|
| 230 |
+
raise ValueError("HF_SFT_WHISPER_MICRO_BATCH must be nonnegative")
|
| 231 |
+
micro_batch = micro_batch or len(chunks)
|
| 232 |
+
projected_chunks = []
|
| 233 |
+
for start in range(0, len(chunks), micro_batch):
|
| 234 |
+
end = start + micro_batch
|
| 235 |
+
encoded, enc_lengths = self.model.audio(
|
| 236 |
+
chunk_batch[start:end], input_lengths[start:end]
|
| 237 |
+
)[:2]
|
| 238 |
+
projected = self.linear_proj_audio(encoded.transpose(-1, -2))
|
| 239 |
+
proj_lens = enc_lengths
|
| 240 |
+
for module in self.linear_proj_audio:
|
| 241 |
+
if isinstance(module, nn.Conv1d):
|
| 242 |
+
proj_lens = (proj_lens + 2 * module.padding[0] - module.kernel_size[0]) // module.stride[0] + 1
|
| 243 |
+
projected_chunks.extend(
|
| 244 |
+
projected[i, :proj_lens[i]] for i in range(projected.shape[0])
|
| 245 |
+
)
|
| 246 |
+
audio_embeds = torch.cat(projected_chunks, dim=0).unsqueeze(0)
|
| 247 |
+
if self.config.norm_query_embeds:
|
| 248 |
+
audio_embeds = F.normalize(audio_embeds, dim=2)
|
| 249 |
return audio_embeds
|
| 250 |
|
| 251 |
def prepare_inputs_for_generation(
|
|
|
|
| 267 |
and cache_position.numel() > 0
|
| 268 |
and cache_position[0].item() > 0
|
| 269 |
)
|
| 270 |
+
# Transformers 5 slices cached decoding with next_sequence_length
|
| 271 |
+
# instead of passing cache_position to remote models.
|
| 272 |
+
is_decode_step = is_decode_step or (
|
| 273 |
+
past_key_values is not None
|
| 274 |
+
and kwargs.get("next_sequence_length") is not None
|
| 275 |
+
and not kwargs.get("is_first_iteration", False)
|
| 276 |
+
)
|
| 277 |
if is_decode_step:
|
| 278 |
model_inputs.pop("audio_feats", None)
|
| 279 |
model_inputs.pop("audio_feats_lengths", None)
|
processing_bailing_moe_v3_audio.py
CHANGED
|
@@ -4,11 +4,12 @@ from pathlib import Path
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
import torchaudio
|
|
|
|
| 7 |
import whisper
|
| 8 |
from transformers import AutoTokenizer, BatchFeature
|
| 9 |
from transformers.processing_utils import ProcessorMixin
|
| 10 |
|
| 11 |
-
from configuration_bailing_moe_v3_audio import BailingMoeV3AudioConfig
|
| 12 |
|
| 13 |
|
| 14 |
class BailingMoeV3AudioProcessor(ProcessorMixin):
|
|
@@ -34,7 +35,8 @@ class BailingMoeV3AudioProcessor(ProcessorMixin):
|
|
| 34 |
|
| 35 |
def _load_audio(self, audio):
|
| 36 |
if isinstance(audio, (str, Path)):
|
| 37 |
-
|
|
|
|
| 38 |
elif isinstance(audio, tuple) and len(audio) == 2:
|
| 39 |
waveform, sample_rate = audio
|
| 40 |
waveform = torch.as_tensor(waveform)
|
|
@@ -67,6 +69,19 @@ class BailingMoeV3AudioProcessor(ProcessorMixin):
|
|
| 67 |
return total
|
| 68 |
|
| 69 |
def __call__(self, audio, text=None, return_tensors="pt"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
waveform = self._load_audio(audio)
|
| 71 |
n_mels = getattr(self.audio_config, "n_mels", 128)
|
| 72 |
mel = whisper.log_mel_spectrogram(waveform, n_mels=n_mels)
|
|
@@ -76,12 +91,25 @@ class BailingMoeV3AudioProcessor(ProcessorMixin):
|
|
| 76 |
audio_start = "<|audio_start|>"
|
| 77 |
audio_token = "<|audio_pad|>"
|
| 78 |
audio_end = "<|audio_end|>"
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
inputs = self.tokenizer(prompt, return_tensors=return_tensors)
|
| 86 |
inputs.pop("token_type_ids", None)
|
| 87 |
inputs["audio_feats"] = mel
|
|
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
import torchaudio
|
| 7 |
+
import soundfile as sf
|
| 8 |
import whisper
|
| 9 |
from transformers import AutoTokenizer, BatchFeature
|
| 10 |
from transformers.processing_utils import ProcessorMixin
|
| 11 |
|
| 12 |
+
from .configuration_bailing_moe_v3_audio import BailingMoeV3AudioConfig
|
| 13 |
|
| 14 |
|
| 15 |
class BailingMoeV3AudioProcessor(ProcessorMixin):
|
|
|
|
| 35 |
|
| 36 |
def _load_audio(self, audio):
|
| 37 |
if isinstance(audio, (str, Path)):
|
| 38 |
+
samples, sample_rate = sf.read(str(audio), dtype="float32", always_2d=True)
|
| 39 |
+
waveform = torch.from_numpy(samples.T.copy())
|
| 40 |
elif isinstance(audio, tuple) and len(audio) == 2:
|
| 41 |
waveform, sample_rate = audio
|
| 42 |
waveform = torch.as_tensor(waveform)
|
|
|
|
| 69 |
return total
|
| 70 |
|
| 71 |
def __call__(self, audio, text=None, return_tensors="pt"):
|
| 72 |
+
messages = None
|
| 73 |
+
if isinstance(audio, list) and audio and isinstance(audio[0], dict):
|
| 74 |
+
messages = audio
|
| 75 |
+
audio_items = [
|
| 76 |
+
item["audio"]
|
| 77 |
+
for message in messages
|
| 78 |
+
if isinstance(message.get("content"), list)
|
| 79 |
+
for item in message["content"]
|
| 80 |
+
if item.get("type") == "audio"
|
| 81 |
+
]
|
| 82 |
+
if len(audio_items) != 1:
|
| 83 |
+
raise ValueError("exactly one audio item is required")
|
| 84 |
+
audio = audio_items[0]
|
| 85 |
waveform = self._load_audio(audio)
|
| 86 |
n_mels = getattr(self.audio_config, "n_mels", 128)
|
| 87 |
mel = whisper.log_mel_spectrogram(waveform, n_mels=n_mels)
|
|
|
|
| 91 |
audio_start = "<|audio_start|>"
|
| 92 |
audio_token = "<|audio_pad|>"
|
| 93 |
audio_end = "<|audio_end|>"
|
| 94 |
+
if messages is None:
|
| 95 |
+
prompt = (
|
| 96 |
+
audio_start
|
| 97 |
+
+ audio_token * self._num_audio_tokens(mel_length)
|
| 98 |
+
+ audio_end
|
| 99 |
+
+ (text or self.ASR_PROMPT)
|
| 100 |
+
)
|
| 101 |
+
else:
|
| 102 |
+
prompt = self.tokenizer.apply_chat_template(
|
| 103 |
+
messages, tokenize=False, add_generation_prompt=True,
|
| 104 |
+
enable_thinking=False,
|
| 105 |
+
)
|
| 106 |
+
placeholder = audio_start + audio_token + audio_end
|
| 107 |
+
if prompt.count(placeholder) != 1:
|
| 108 |
+
raise ValueError("chat prompt must contain exactly one audio placeholder")
|
| 109 |
+
prompt = prompt.replace(
|
| 110 |
+
placeholder,
|
| 111 |
+
audio_start + audio_token * self._num_audio_tokens(mel_length) + audio_end,
|
| 112 |
+
)
|
| 113 |
inputs = self.tokenizer(prompt, return_tensors=return_tensors)
|
| 114 |
inputs.pop("token_type_ids", None)
|
| 115 |
inputs["audio_feats"] = mel
|
processor_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"processor_class": "BailingMoeV3AudioProcessor",
|
| 3 |
+
"auto_map": {
|
| 4 |
+
"AutoProcessor": "processing_bailing_moe_v3_audio.BailingMoeV3AudioProcessor"
|
| 5 |
+
}
|
| 6 |
+
}
|
talker/AudioVAE/__init__.py
ADDED
|
File without changes
|
talker/AudioVAE/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (183 Bytes). View file
|
|
|
talker/AudioVAE/__pycache__/configuration_audio_vae.cpython-312.pyc
ADDED
|
Binary file (998 Bytes). View file
|
|
|
talker/AudioVAE/__pycache__/istft.cpython-312.pyc
ADDED
|
Binary file (9.54 kB). View file
|
|
|
talker/AudioVAE/__pycache__/modeling_audio_vae.cpython-312.pyc
ADDED
|
Binary file (5.05 kB). View file
|
|
|
talker/AudioVAE/__pycache__/vae_modules.cpython-312.pyc
ADDED
|
Binary file (11.2 kB). View file
|
|
|
talker/AudioVAE/configuration_audio_vae.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PretrainedConfig
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class AudioVAEconfig(PretrainedConfig):
|
| 5 |
+
def __init__(
|
| 6 |
+
self,
|
| 7 |
+
sample_rate: int=16000,
|
| 8 |
+
enc_kwargs: dict = None,
|
| 9 |
+
dec_kwargs: dict = None,
|
| 10 |
+
init_method='normal',
|
| 11 |
+
patch_size=-1,
|
| 12 |
+
**kwargs
|
| 13 |
+
):
|
| 14 |
+
self.sample_rate = sample_rate
|
| 15 |
+
self.enc_kwargs = enc_kwargs
|
| 16 |
+
self.dec_kwargs = dec_kwargs
|
| 17 |
+
self.init_method = init_method
|
| 18 |
+
self.patch_size = patch_size
|
| 19 |
+
super().__init__(**kwargs)
|
talker/AudioVAE/istft.py
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch.nn as nn
|
| 2 |
+
import torch
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class ISTFT(nn.Module):
|
| 6 |
+
"""
|
| 7 |
+
Custom implementation of ISTFT since torch.istft doesn't allow custom padding (other than `center=True`) with
|
| 8 |
+
windowing. This is because the NOLA (Nonzero Overlap Add) check fails at the edges.
|
| 9 |
+
See issue: https://github.com/pytorch/pytorch/issues/62323
|
| 10 |
+
Specifically, in the context of neural vocoding we are interested in "same" padding analogous to CNNs.
|
| 11 |
+
The NOLA constraint is met as we trim padded samples anyway.
|
| 12 |
+
|
| 13 |
+
Args:
|
| 14 |
+
n_fft (int): Size of Fourier transform.
|
| 15 |
+
hop_length (int): The distance between neighboring sliding window frames.
|
| 16 |
+
win_length (int): The size of window frame and STFT filter.
|
| 17 |
+
padding (str, optional): Type of padding. Options are "center" or "same". Defaults to "same".
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def __init__(self, n_fft: int, hop_length: int, win_length: int, padding: str = "same"):
|
| 21 |
+
super().__init__()
|
| 22 |
+
if padding not in ["center", "same"]:
|
| 23 |
+
raise ValueError("Padding must be 'center' or 'same'.")
|
| 24 |
+
self.padding = padding
|
| 25 |
+
self.n_fft = n_fft
|
| 26 |
+
self.hop_length = hop_length
|
| 27 |
+
self.win_length = win_length
|
| 28 |
+
window = torch.hann_window(win_length)
|
| 29 |
+
self.register_buffer("window", window)
|
| 30 |
+
|
| 31 |
+
self.audio_buffer = None
|
| 32 |
+
self.window_buffer = None
|
| 33 |
+
self.buffer_len = self.win_length - self.hop_length
|
| 34 |
+
|
| 35 |
+
def __buffer_process(self, x, buffer, pad, last_chunk=False, streaming=False):
|
| 36 |
+
if streaming:
|
| 37 |
+
if buffer is None:
|
| 38 |
+
# first chunk
|
| 39 |
+
x = x[:, pad:]
|
| 40 |
+
if buffer is not None:
|
| 41 |
+
# next chunk
|
| 42 |
+
x[:, :self.buffer_len] += buffer
|
| 43 |
+
buffer = x[:, -self.buffer_len:]
|
| 44 |
+
if not last_chunk:
|
| 45 |
+
x = x[:, :-self.buffer_len]
|
| 46 |
+
else:
|
| 47 |
+
x = x[:, :-pad]
|
| 48 |
+
else:
|
| 49 |
+
x = x[:, pad:-pad]
|
| 50 |
+
|
| 51 |
+
return x, buffer
|
| 52 |
+
|
| 53 |
+
def forward(
|
| 54 |
+
self,
|
| 55 |
+
spec: torch.Tensor,
|
| 56 |
+
audio_buffer=None,
|
| 57 |
+
window_buffer=None,
|
| 58 |
+
streaming=False,
|
| 59 |
+
last_chunk=False
|
| 60 |
+
):
|
| 61 |
+
"""
|
| 62 |
+
Compute the Inverse Short Time Fourier Transform (ISTFT) of a complex spectrogram.
|
| 63 |
+
|
| 64 |
+
Args:
|
| 65 |
+
spec (Tensor): Input complex spectrogram of shape (B, N, T), where B is the batch size,
|
| 66 |
+
N is the number of frequency bins, and T is the number of time frames.
|
| 67 |
+
audio_buffer (Tensor): [Streaming Input/State] The audio overlap buffer from the previous chunk.
|
| 68 |
+
Shape: (B, win_length - hop_length)
|
| 69 |
+
window_buffer (Tensor): [Streaming Input/State] The window overlap buffer from the previous chunk.
|
| 70 |
+
streaming: If `True`, the function operates in streaming mode, processing `spec` as a single chunk.
|
| 71 |
+
last_chunk: When `streaming=True` and `last_chunk=True`, the function can perform final "flush" operations
|
| 72 |
+
|
| 73 |
+
Returns:
|
| 74 |
+
Tensor: Reconstructed time-domain signal of shape (B, L), where L is the length of the output signal.
|
| 75 |
+
"""
|
| 76 |
+
if self.padding == "center":
|
| 77 |
+
# Fallback to pytorch native implementation
|
| 78 |
+
return torch.istft(spec, self.n_fft, self.hop_length, self.win_length, self.window, center=True)
|
| 79 |
+
elif self.padding == "same":
|
| 80 |
+
pad = (self.win_length - self.hop_length) // 2
|
| 81 |
+
else:
|
| 82 |
+
raise ValueError("Padding must be 'center' or 'same'.")
|
| 83 |
+
|
| 84 |
+
assert spec.dim() == 3, "Expected a 3D tensor as input"
|
| 85 |
+
B, N, T = spec.shape
|
| 86 |
+
|
| 87 |
+
# Inverse FFT
|
| 88 |
+
ifft = torch.fft.irfft(spec, self.n_fft, dim=1, norm="backward")
|
| 89 |
+
ifft = ifft * self.window[None, :, None]
|
| 90 |
+
|
| 91 |
+
# Overlap and Add
|
| 92 |
+
output_size = (T - 1) * self.hop_length + self.win_length
|
| 93 |
+
y = torch.nn.functional.fold(
|
| 94 |
+
ifft, output_size=(1, output_size), kernel_size=(1, self.win_length), stride=(1, self.hop_length),
|
| 95 |
+
)[:, 0, 0, :]
|
| 96 |
+
|
| 97 |
+
y, audio_buffer = self.__buffer_process(y, audio_buffer, pad, last_chunk=last_chunk, streaming=streaming)
|
| 98 |
+
|
| 99 |
+
# Window envelope
|
| 100 |
+
window_sq = self.window.square().expand(1, T, -1).transpose(1, 2)
|
| 101 |
+
window_envelope = torch.nn.functional.fold(
|
| 102 |
+
window_sq, output_size=(1, output_size), kernel_size=(1, self.win_length), stride=(1, self.hop_length),
|
| 103 |
+
).squeeze(0).squeeze(0)
|
| 104 |
+
|
| 105 |
+
window_envelope, window_buffer = self.__buffer_process(window_envelope, window_buffer, pad, last_chunk=last_chunk, streaming=streaming)
|
| 106 |
+
window_envelope = window_envelope.squeeze()
|
| 107 |
+
|
| 108 |
+
# Normalize
|
| 109 |
+
assert (window_envelope > 1e-11).all()
|
| 110 |
+
y = y / window_envelope
|
| 111 |
+
|
| 112 |
+
return y, audio_buffer, window_buffer
|
| 113 |
+
|
| 114 |
+
class FourierHead(nn.Module):
|
| 115 |
+
"""Base class for inverse fourier modules."""
|
| 116 |
+
|
| 117 |
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
| 118 |
+
"""
|
| 119 |
+
Args:
|
| 120 |
+
x (Tensor): Input tensor of shape (B, L, H), where B is the batch size,
|
| 121 |
+
L is the sequence length, and H denotes the model dimension.
|
| 122 |
+
|
| 123 |
+
Returns:
|
| 124 |
+
Tensor: Reconstructed time-domain audio signal of shape (B, T), where T is the length of the output signal.
|
| 125 |
+
"""
|
| 126 |
+
raise NotImplementedError("Subclasses must implement the forward method.")
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
class ISTFTHead(FourierHead):
|
| 130 |
+
"""
|
| 131 |
+
ISTFT Head module for predicting STFT complex coefficients.
|
| 132 |
+
|
| 133 |
+
Args:
|
| 134 |
+
dim (int): Hidden dimension of the model.
|
| 135 |
+
n_fft (int): Size of Fourier transform.
|
| 136 |
+
hop_length (int): The distance between neighboring sliding window frames, which should align with
|
| 137 |
+
the resolution of the input features.
|
| 138 |
+
padding (str, optional): Type of padding. Options are "center" or "same". Defaults to "same".
|
| 139 |
+
"""
|
| 140 |
+
|
| 141 |
+
def __init__(self, dim: int, n_fft: int, hop_length: int, padding: str = "same"):
|
| 142 |
+
super().__init__()
|
| 143 |
+
out_dim = n_fft + 2
|
| 144 |
+
self.out = torch.nn.Linear(dim, out_dim)
|
| 145 |
+
self.istft = ISTFT(n_fft=n_fft, hop_length=hop_length, win_length=n_fft, padding=padding)
|
| 146 |
+
|
| 147 |
+
def forward(
|
| 148 |
+
self,
|
| 149 |
+
x: torch.Tensor,
|
| 150 |
+
audio_buffer=None,
|
| 151 |
+
window_buffer=None,
|
| 152 |
+
streaming=False,
|
| 153 |
+
last_chunk=False
|
| 154 |
+
):
|
| 155 |
+
"""
|
| 156 |
+
Forward pass of the ISTFTHead module.
|
| 157 |
+
|
| 158 |
+
Args:
|
| 159 |
+
x (Tensor): Input tensor of shape (B, L, H), where B is the batch size,
|
| 160 |
+
L is the sequence length, and H denotes the model dimension.
|
| 161 |
+
|
| 162 |
+
Returns:
|
| 163 |
+
Tensor: Reconstructed time-domain audio signal of shape (B, T), where T is the length of the output signal.
|
| 164 |
+
"""
|
| 165 |
+
x_pred = self.out(x )
|
| 166 |
+
# x_pred = x
|
| 167 |
+
x_pred = x_pred.transpose(1, 2)
|
| 168 |
+
mag, p = x_pred.chunk(2, dim=1)
|
| 169 |
+
mag = torch.exp(mag)
|
| 170 |
+
mag = torch.clip(mag, max=1e2) # safeguard to prevent excessively large magnitudes
|
| 171 |
+
# wrapping happens here. These two lines produce real and imaginary value
|
| 172 |
+
x = torch.cos(p)
|
| 173 |
+
y = torch.sin(p)
|
| 174 |
+
# recalculating phase here does not produce anything new
|
| 175 |
+
# only costs time
|
| 176 |
+
# phase = torch.atan2(y, x)
|
| 177 |
+
# S = mag * torch.exp(phase * 1j)
|
| 178 |
+
# better directly produce the complex value
|
| 179 |
+
S = mag * (x + 1j * y)
|
| 180 |
+
audio, audio_buffer, window_buffer = self.istft(S, audio_buffer=audio_buffer, window_buffer=window_buffer, streaming=streaming, last_chunk=last_chunk)
|
| 181 |
+
return audio.unsqueeze(1),x_pred, audio_buffer, window_buffer
|
talker/AudioVAE/modeling_audio_vae.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from diffusers.models.autoencoders.autoencoder_oobleck import OobleckDiagonalGaussianDistribution
|
| 2 |
+
from transformers import PreTrainedModel
|
| 3 |
+
import torch
|
| 4 |
+
import torch.nn as nn
|
| 5 |
+
|
| 6 |
+
from .configuration_audio_vae import AudioVAEconfig
|
| 7 |
+
from .vae_modules import Encoder, Decoder
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class AudioVAE(PreTrainedModel):
|
| 11 |
+
config_class = AudioVAEconfig
|
| 12 |
+
|
| 13 |
+
def __init__(self, config: AudioVAEconfig):
|
| 14 |
+
super().__init__(config)
|
| 15 |
+
self.encoder = Encoder(
|
| 16 |
+
encoder_args=config.enc_kwargs['backbone'],
|
| 17 |
+
input_dim=config.enc_kwargs['input_dim'],
|
| 18 |
+
hop_size=config.enc_kwargs.get('hop_size', 320),
|
| 19 |
+
latent_dim=config.enc_kwargs['latent_dim'],
|
| 20 |
+
patch_size=config.patch_size
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
self.decoder = Decoder(
|
| 24 |
+
decoder_args=config.dec_kwargs['backbone'],
|
| 25 |
+
output_dim=config.dec_kwargs['output_dim'],
|
| 26 |
+
latent_dim=config.dec_kwargs['latent_dim'],
|
| 27 |
+
patch_size=config.patch_size
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
self.post_init()
|
| 31 |
+
|
| 32 |
+
def _init_weights(self, module):
|
| 33 |
+
std = 0.02
|
| 34 |
+
if isinstance(module, nn.Linear):
|
| 35 |
+
if self.config.init_method == 'kaiming':
|
| 36 |
+
nn.init.kaiming_normal_(module.weight, mode='fan_in', nonlinearity='relu')
|
| 37 |
+
else:
|
| 38 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 39 |
+
|
| 40 |
+
if module.bias is not None:
|
| 41 |
+
module.bias.data.zero_()
|
| 42 |
+
elif isinstance(module, nn.Embedding):
|
| 43 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 44 |
+
if module.padding_idx is not None:
|
| 45 |
+
module.weight.data[module.padding_idx].zero_()
|
| 46 |
+
|
| 47 |
+
def encode_latent(self, waveform, waveform_length):
|
| 48 |
+
"""
|
| 49 |
+
Encodes a raw waveform to obtain its acoustic latent representation.
|
| 50 |
+
Args:
|
| 51 |
+
waveform: The input audio waveform, shape (B, T_wav).
|
| 52 |
+
waveform_length: The length of each waveform, shape (B,).
|
| 53 |
+
|
| 54 |
+
Returns:
|
| 55 |
+
tuple[torch.Tensor, torch.Tensor]: A tuple containing:
|
| 56 |
+
- z (torch.Tensor): The sampled acoustic latent vectors, shape (B, T_frame, D_latent).
|
| 57 |
+
- frame_num (torch.Tensor): The number of frames for each audio, shape (B,).
|
| 58 |
+
"""
|
| 59 |
+
frame_num = torch.ceil(waveform_length/self.config.enc_kwargs['input_dim']).to(torch.int32)
|
| 60 |
+
if self.config.patch_size != -1:
|
| 61 |
+
frame_num = torch.ceil(frame_num/self.config.patch_size)
|
| 62 |
+
h, y = self.encoder(waveform)
|
| 63 |
+
h = h.transpose(1, 2) # [B, d, T]
|
| 64 |
+
|
| 65 |
+
posterior = OobleckDiagonalGaussianDistribution(h)
|
| 66 |
+
latent = posterior.sample() # [B, d/2, T]
|
| 67 |
+
latent = latent.transpose(1, 2)
|
| 68 |
+
return latent, frame_num
|
| 69 |
+
|
| 70 |
+
def decode(self, latent, past_key_values=None, use_cache=False, stream_state=(None, None, None), last_chunk=False):
|
| 71 |
+
"""
|
| 72 |
+
Reconstructs the raw audio waveform from its acoustic latent representation.
|
| 73 |
+
Args:
|
| 74 |
+
latent: The acoustic latent representation, shape: (B, T_frame, D_latent).
|
| 75 |
+
|
| 76 |
+
Returns:
|
| 77 |
+
The reconstructed raw audio waveform, shape: (B, T_wav)
|
| 78 |
+
"""
|
| 79 |
+
waveform, stream_state, past_key_values = self.decoder.low_level_reconstruct(latent, past_key_values=past_key_values, use_cache=use_cache, stream_state=stream_state, last_chunk=last_chunk)
|
| 80 |
+
return waveform, stream_state, past_key_values
|
talker/AudioVAE/vae_modules.py
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch.nn as nn
|
| 2 |
+
import torch.nn.functional as F
|
| 3 |
+
from transformers import Qwen2Model, Qwen2Config
|
| 4 |
+
import torch
|
| 5 |
+
|
| 6 |
+
from .istft import ISTFTHead
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
class StreamingLinearUpsample(nn.Module):
|
| 10 |
+
def __init__(self, scale_factor=4):
|
| 11 |
+
super().__init__()
|
| 12 |
+
self.scale_factor = scale_factor
|
| 13 |
+
self.upsampler = nn.Upsample(scale_factor=scale_factor, mode='linear', align_corners=False)
|
| 14 |
+
|
| 15 |
+
def forward(self, x, state=None, is_last=False):
|
| 16 |
+
# 初始化状态
|
| 17 |
+
if state is None:
|
| 18 |
+
state = {
|
| 19 |
+
'prev_chunk': None,
|
| 20 |
+
'history_last': None,
|
| 21 |
+
'is_first': True
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
if x is None and not is_last:
|
| 25 |
+
return None, state
|
| 26 |
+
|
| 27 |
+
if state['is_first'] and is_last:
|
| 28 |
+
out = self.upsampler(x.transpose(1, 2)).transpose(1, 2)
|
| 29 |
+
return out, None # 结束后清除状态
|
| 30 |
+
|
| 31 |
+
output_chunks = []
|
| 32 |
+
|
| 33 |
+
if state['is_first']:
|
| 34 |
+
state['prev_chunk'] = x
|
| 35 |
+
state['is_first'] = False
|
| 36 |
+
if not is_last:
|
| 37 |
+
return None, state
|
| 38 |
+
|
| 39 |
+
if state['prev_chunk'] is not None:
|
| 40 |
+
p = state['prev_chunk'].transpose(1, 2)
|
| 41 |
+
|
| 42 |
+
if state['history_last'] is None:
|
| 43 |
+
lookahead = x[:, :1, :].transpose(1, 2)
|
| 44 |
+
inp = torch.cat([p, lookahead], dim=2)
|
| 45 |
+
up = self.upsampler(inp)
|
| 46 |
+
out_prev = up[:, :, :p.size(2) * self.scale_factor]
|
| 47 |
+
else:
|
| 48 |
+
lookahead = x[:, :1, :].transpose(1, 2)
|
| 49 |
+
inp = torch.cat([state['history_last'], p, lookahead], dim=2)
|
| 50 |
+
up = self.upsampler(inp)
|
| 51 |
+
start = self.scale_factor
|
| 52 |
+
end = start + p.size(2) * self.scale_factor
|
| 53 |
+
out_prev = up[:, :, start:end]
|
| 54 |
+
|
| 55 |
+
output_chunks.append(out_prev.transpose(1, 2))
|
| 56 |
+
state['history_last'] = p[:, :, -1:]
|
| 57 |
+
state['prev_chunk'] = x
|
| 58 |
+
|
| 59 |
+
if is_last:
|
| 60 |
+
p = state['prev_chunk'].transpose(1, 2)
|
| 61 |
+
inp = torch.cat([state['history_last'], p], dim=2)
|
| 62 |
+
up = self.upsampler(inp)
|
| 63 |
+
out_last = up[:, :, self.scale_factor:]
|
| 64 |
+
output_chunks.append(out_last.transpose(1, 2))
|
| 65 |
+
state = None # 结束
|
| 66 |
+
|
| 67 |
+
final_out = torch.cat(output_chunks, dim=1) if output_chunks else None
|
| 68 |
+
return final_out, state
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
class Encoder(nn.Module):
|
| 72 |
+
def __init__(self, encoder_args, input_dim=320, hop_size=320, latent_dim=64, patch_size=-1):
|
| 73 |
+
super().__init__()
|
| 74 |
+
config = Qwen2Config.from_dict(config_dict=encoder_args)
|
| 75 |
+
self.encoder = Qwen2Model(config)
|
| 76 |
+
self.input_dim = input_dim
|
| 77 |
+
self.hop_size = hop_size
|
| 78 |
+
self.latent_dim = latent_dim
|
| 79 |
+
self.fc1 = nn.Linear(input_dim, config.hidden_size, bias=False)
|
| 80 |
+
self.fc2 = nn.Linear(config.hidden_size, config.hidden_size)
|
| 81 |
+
self.fc3 = nn.Linear(config.hidden_size, latent_dim*2)
|
| 82 |
+
self.norm = nn.LayerNorm(config.hidden_size)
|
| 83 |
+
self.patch_size = patch_size
|
| 84 |
+
if patch_size != -1:
|
| 85 |
+
config.num_hidden_layers = 4
|
| 86 |
+
self.aggregator = Qwen2Model(config)
|
| 87 |
+
self.cls_embed = nn.Parameter(torch.rand(1, 1, config.hidden_size))
|
| 88 |
+
self.cls_embed.data.normal_(0, 0.02)
|
| 89 |
+
|
| 90 |
+
def get_frames(self, x):
|
| 91 |
+
num_frames_total = (x.size(-1) + self.hop_size - 1) // self.hop_size # 向上取整的帧数
|
| 92 |
+
expected_len = (num_frames_total - 1) * self.hop_size + self.input_dim
|
| 93 |
+
padding_needed = expected_len - x.size(-1)
|
| 94 |
+
waveform = F.pad(x, (0, padding_needed), value=0.0)
|
| 95 |
+
|
| 96 |
+
frames = waveform.unfold(dimension=-1, size=self.input_dim, step=self.hop_size) # [B, T, d]
|
| 97 |
+
return frames
|
| 98 |
+
|
| 99 |
+
def pad_patch_insert_cls(self, x):
|
| 100 |
+
bsz, _, dim = x.size()
|
| 101 |
+
num_frame = x.size(1)
|
| 102 |
+
r = num_frame % self.patch_size
|
| 103 |
+
pad_num = self.patch_size-r if r else 0
|
| 104 |
+
x = F.pad(x, (0, 0, 0, pad_num), value=0.0) # 帧数对齐到patch_size倍数
|
| 105 |
+
x = x.reshape(-1, self.patch_size, dim)
|
| 106 |
+
x = torch.cat((x, self.cls_embed.expand(x.size(0), -1, -1)), dim=1) # 每个patch后插入一个cls
|
| 107 |
+
x = x.reshape(bsz, -1, dim)
|
| 108 |
+
return x
|
| 109 |
+
|
| 110 |
+
def forward(self, waveform):
|
| 111 |
+
x = self.get_frames(waveform)
|
| 112 |
+
|
| 113 |
+
x = self.fc1(x)
|
| 114 |
+
x = self.fc2(x)
|
| 115 |
+
x = self.encoder(inputs_embeds=x)
|
| 116 |
+
x = x.last_hidden_state
|
| 117 |
+
|
| 118 |
+
# downsample
|
| 119 |
+
if self.patch_size != -1:
|
| 120 |
+
x = self.pad_patch_insert_cls(x)
|
| 121 |
+
x = self.aggregator(inputs_embeds=x)
|
| 122 |
+
x = x.last_hidden_state
|
| 123 |
+
bsz, _, dim = x.size()
|
| 124 |
+
x = x.reshape(-1, self.patch_size+1, dim)
|
| 125 |
+
x = x[:, -1:, :].reshape(bsz, -1, dim)
|
| 126 |
+
|
| 127 |
+
x = self.fc3(x)
|
| 128 |
+
return x, waveform.unsqueeze(1)
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
class Decoder(nn.Module):
|
| 132 |
+
def __init__(self, decoder_args, output_dim=320, latent_dim=64, patch_size=-1):
|
| 133 |
+
super().__init__()
|
| 134 |
+
config = Qwen2Config.from_dict(config_dict=decoder_args)
|
| 135 |
+
self.decoder = Qwen2Model(config)
|
| 136 |
+
self.output_dim = output_dim
|
| 137 |
+
self.latent_dim = latent_dim
|
| 138 |
+
self.fc1 = nn.Linear(latent_dim, config.hidden_size)
|
| 139 |
+
self.hop_length = output_dim
|
| 140 |
+
self.head = ISTFTHead(dim=config.hidden_size, n_fft=self.hop_length * 4, hop_length=self.hop_length, padding="same")
|
| 141 |
+
self.patch_size = patch_size
|
| 142 |
+
if self.patch_size != -1:
|
| 143 |
+
self.upsampling = StreamingLinearUpsample(scale_factor=patch_size)
|
| 144 |
+
|
| 145 |
+
def low_level_reconstruct(self, x, past_key_values=None, use_cache=False, stream_state=None, last_chunk=False):
|
| 146 |
+
upsample_state, audio_buffer, window_buffer = stream_state
|
| 147 |
+
bsz, device, dtype = x.size(0), x.device, x.dtype
|
| 148 |
+
x = self.fc1(x)
|
| 149 |
+
if self.patch_size != -1:
|
| 150 |
+
if use_cache:
|
| 151 |
+
# streaming
|
| 152 |
+
x, upsample_state = self.upsampling(x, state=upsample_state, is_last=last_chunk)
|
| 153 |
+
if x is None:
|
| 154 |
+
stream_state = (upsample_state, audio_buffer, window_buffer)
|
| 155 |
+
return torch.empty(bsz, 1, 0, device=device, dtype=dtype), stream_state, past_key_values
|
| 156 |
+
else:
|
| 157 |
+
x = self.upsampling.upsampler(x.transpose(1, 2)).transpose(1, 2)
|
| 158 |
+
|
| 159 |
+
hidden_states_list = []
|
| 160 |
+
|
| 161 |
+
if use_cache and getattr(self.decoder.config, "sliding_window", None) is not None:
|
| 162 |
+
sw_size = self.decoder.config.sliding_window
|
| 163 |
+
target_len = sw_size - 1
|
| 164 |
+
if past_key_values is None:
|
| 165 |
+
past_len = 0
|
| 166 |
+
elif hasattr(past_key_values, "get_seq_length"):
|
| 167 |
+
past_len = past_key_values.get_seq_length()
|
| 168 |
+
elif isinstance(past_key_values, tuple) and len(past_key_values) > 0:
|
| 169 |
+
past_len = past_key_values[0][0].shape[-2]
|
| 170 |
+
else:
|
| 171 |
+
past_len = 0
|
| 172 |
+
|
| 173 |
+
curr_len = x.shape[1]
|
| 174 |
+
|
| 175 |
+
if past_len < target_len and (past_len + curr_len) >= sw_size:
|
| 176 |
+
fill_len = target_len - past_len
|
| 177 |
+
x_fill = x[:, :fill_len, :]
|
| 178 |
+
outputs = self.decoder(inputs_embeds=x_fill, past_key_values=past_key_values, use_cache=use_cache)
|
| 179 |
+
|
| 180 |
+
hidden_states_list.append(outputs.last_hidden_state)
|
| 181 |
+
past_key_values = outputs.past_key_values
|
| 182 |
+
|
| 183 |
+
x = x[:, fill_len:, :]
|
| 184 |
+
|
| 185 |
+
outputs = self.decoder(inputs_embeds=x, past_key_values=past_key_values, use_cache=use_cache)
|
| 186 |
+
|
| 187 |
+
hidden_states_list.append(outputs.last_hidden_state)
|
| 188 |
+
past_key_values = outputs.past_key_values
|
| 189 |
+
|
| 190 |
+
if len(hidden_states_list) > 1:
|
| 191 |
+
full_hidden_state = torch.cat(hidden_states_list, dim=1)
|
| 192 |
+
else:
|
| 193 |
+
full_hidden_state = hidden_states_list[0]
|
| 194 |
+
|
| 195 |
+
x_out, _, audio_buffer, window_buffer = self.head(
|
| 196 |
+
full_hidden_state,
|
| 197 |
+
streaming=use_cache,
|
| 198 |
+
audio_buffer=audio_buffer,
|
| 199 |
+
window_buffer=window_buffer,
|
| 200 |
+
last_chunk=last_chunk
|
| 201 |
+
)
|
| 202 |
+
|
| 203 |
+
stream_state = (upsample_state, audio_buffer, window_buffer)
|
| 204 |
+
return x_out, stream_state, past_key_values
|
talker/__init__.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Native Ming Talker inference and checkpoint assets."""
|
| 2 |
+
|
| 3 |
+
from .inference import MingTalker
|
| 4 |
+
|
| 5 |
+
__all__ = ["MingTalker"]
|
talker/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (317 Bytes). View file
|
|
|
talker/__pycache__/configuration_bailing_talker.cpython-312.pyc
ADDED
|
Binary file (509 Bytes). View file
|
|
|
talker/__pycache__/inference.cpython-312.pyc
ADDED
|
Binary file (22.6 kB). View file
|
|
|
talker/__pycache__/tts_prompt.cpython-312.pyc
ADDED
|
Binary file (17.3 kB). View file
|
|
|
talker/campplus.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6ac6a63997761ae2997373e2ee1c47040854b4b759ea41ec48e4e42df0f4d73
|
| 3 |
+
size 28303423
|
talker/config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"aggregator": {
|
| 3 |
+
"attn_backend": "torch",
|
| 4 |
+
"attn_mask_enabled": false,
|
| 5 |
+
"depth": 8,
|
| 6 |
+
"dropout": 0.0,
|
| 7 |
+
"hidden_size": 1024,
|
| 8 |
+
"in_channels": 64,
|
| 9 |
+
"mlp_ratio": 4,
|
| 10 |
+
"num_heads": 16,
|
| 11 |
+
"pe_attn_head": null,
|
| 12 |
+
"qk_norm": null
|
| 13 |
+
},
|
| 14 |
+
"architectures": [
|
| 15 |
+
"BailingTalker2"
|
| 16 |
+
],
|
| 17 |
+
"cfg_strength": 2.0,
|
| 18 |
+
"flowmodel": {
|
| 19 |
+
"attn_backend": "torch",
|
| 20 |
+
"attn_mask_enabled": false,
|
| 21 |
+
"depth": 8,
|
| 22 |
+
"dropout": 0.0,
|
| 23 |
+
"hidden_size": 1024,
|
| 24 |
+
"in_channels": 64,
|
| 25 |
+
"mlp_ratio": 4,
|
| 26 |
+
"num_heads": 16,
|
| 27 |
+
"pe_attn_head": null,
|
| 28 |
+
"qk_norm": null
|
| 29 |
+
},
|
| 30 |
+
"history_patch_size": 1,
|
| 31 |
+
"patch_size": 1,
|
| 32 |
+
"steps": 10,
|
| 33 |
+
"torch_dtype": "bfloat16",
|
| 34 |
+
"transformers_version": "4.51.3"
|
| 35 |
+
}
|
talker/configuration_bailing_talker.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2022 shunxing1234 and The HuggingFace Inc. team. All rights reserved.
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
""" GLMAudio model configuration """
|
| 16 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class BailingTalkerConfig(PretrainedConfig):
|
| 20 |
+
pass
|
talker/data/lid.176.LICENSE.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FastText language identification model
|
| 2 |
+
|
| 3 |
+
`lid.176.ftz` is the compressed language identification model published by the
|
| 4 |
+
fastText project: https://fasttext.cc/docs/en/language-identification
|
| 5 |
+
|
| 6 |
+
The model is distributed under the Creative Commons Attribution-ShareAlike 3.0
|
| 7 |
+
license: https://creativecommons.org/licenses/by-sa/3.0/
|
| 8 |
+
|
| 9 |
+
The fastText project states that the model was trained on Wikipedia, Tatoeba,
|
| 10 |
+
and SETimes data.
|
talker/data/lid.176.ftz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f3472cfe8738a7b6099e8e999c3cbfae0dcd15696aac7d7738a8039db603e83
|
| 3 |
+
size 938013
|
talker/front/__init__.py
ADDED
|
File without changes
|
talker/front/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (180 Bytes). View file
|
|
|
talker/front/__pycache__/number_en.cpython-312.pyc
ADDED
|
Binary file (14.7 kB). View file
|
|
|
talker/front/__pycache__/text_segment_cut.cpython-312.pyc
ADDED
|
Binary file (12.7 kB). View file
|
|
|
talker/front/__pycache__/toolkit.cpython-312.pyc
ADDED
|
Binary file (9.31 kB). View file
|
|
|
talker/front/number_en.py
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
import inflect
|
| 3 |
+
|
| 4 |
+
'''
|
| 5 |
+
number normalization for English
|
| 6 |
+
'''
|
| 7 |
+
|
| 8 |
+
_inflect = inflect.engine()
|
| 9 |
+
|
| 10 |
+
# 移除逗号:1,000 → 1000
|
| 11 |
+
_comma_number_re = re.compile(r"([0-9][0-9,]+[0-9])")
|
| 12 |
+
|
| 13 |
+
# 百分比:支持负数(-25.5%)
|
| 14 |
+
_percent_number_re = re.compile(r"(-?[0-9.,]*[0-9]+)%")
|
| 15 |
+
|
| 16 |
+
# 英镑:£-150 → minus one hundred fifty pounds
|
| 17 |
+
_pounds_re = re.compile(r"£(-?[0-9,]*[0-9]+(?:\.[0-9]+)?)")
|
| 18 |
+
|
| 19 |
+
# 美元:$-12.99
|
| 20 |
+
_dollars_re = re.compile(r"\$(-?[0-9.,]*[0-9]+(?:\.[0-9]+)?)")
|
| 21 |
+
|
| 22 |
+
# 分数:3/4
|
| 23 |
+
_fraction_re = re.compile(r"([0-9]+)\/([0-9]+)")
|
| 24 |
+
|
| 25 |
+
# 序数:1st, 2nd
|
| 26 |
+
_ordinal_re = re.compile(r"\b[0-9]+(st|nd|rd|th)\b")
|
| 27 |
+
|
| 28 |
+
# 普通数字(最后处理)
|
| 29 |
+
_number_re = re.compile(r"\b-?[0-9]+(?:\.[0-9]+)?\b")
|
| 30 |
+
|
| 31 |
+
# 单位:10ms, 5.5 kg 等
|
| 32 |
+
_unit_re = re.compile(
|
| 33 |
+
r'\b(-?\d+(?:\.\d+)?)\s*(ms|s|Hz|kHz|MHz|GHz|kb|mb|gb|tb|KB|MB|GB|TB|bps|kbps|Mbps|Gbps|cm|km|kg|V|A|W|°C|°F)\b',
|
| 34 |
+
re.IGNORECASE
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
# 正则:支持 v2, v2.1, gpt-4, gpt-4.5
|
| 38 |
+
_version_re = re.compile(r'\b([a-zA-Z]+)([-]?)([0-9]+(?:\.[0-9]+)?)\b')
|
| 39 |
+
|
| 40 |
+
# 空白字符
|
| 41 |
+
_whitespace_re = re.compile(r"\s+")
|
| 42 |
+
|
| 43 |
+
# 标点符号(可选)
|
| 44 |
+
_colon_re = re.compile(r":")
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
_unit_mapping = {
|
| 48 |
+
'ms': 'milliseconds',
|
| 49 |
+
's': 'seconds',
|
| 50 |
+
'hz': 'hertz',
|
| 51 |
+
'khz': 'kilohertz',
|
| 52 |
+
'mhz': 'megahertz',
|
| 53 |
+
'ghz': 'gigahertz',
|
| 54 |
+
'kb': 'kilobytes',
|
| 55 |
+
'mb': 'megabytes',
|
| 56 |
+
'gb': 'gigabytes',
|
| 57 |
+
'tb': 'terabytes',
|
| 58 |
+
'kbps': 'kilobits per second',
|
| 59 |
+
'mbps': 'megabits per second',
|
| 60 |
+
'gbps': 'gigabits per second',
|
| 61 |
+
'bps': 'bits per second',
|
| 62 |
+
'cm': 'centimeters',
|
| 63 |
+
'km': 'kilometers',
|
| 64 |
+
'kg': 'kilograms',
|
| 65 |
+
'v': 'volts',
|
| 66 |
+
'a': 'amperes',
|
| 67 |
+
'w': 'watts',
|
| 68 |
+
'°c': 'degrees celsius',
|
| 69 |
+
'°f': 'degrees fahrenheit',
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def _remove_commas(m):
|
| 74 |
+
return m.group(1).replace(",", "")
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def _expand_colon(m):
|
| 78 |
+
return " colon "
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def _expand_unit(m):
|
| 82 |
+
num_str = m.group(1)
|
| 83 |
+
unit = m.group(2).lower()
|
| 84 |
+
unit_word = _unit_mapping.get(unit, unit)
|
| 85 |
+
|
| 86 |
+
try:
|
| 87 |
+
is_negative = num_str.startswith('-')
|
| 88 |
+
clean_num = num_str.lstrip('-')
|
| 89 |
+
if not clean_num:
|
| 90 |
+
clean_num = '0'
|
| 91 |
+
|
| 92 |
+
if '.' in clean_num:
|
| 93 |
+
parts = clean_num.split('.', 1)
|
| 94 |
+
integer_part = parts[0] or '0'
|
| 95 |
+
decimal_part = parts[1]
|
| 96 |
+
|
| 97 |
+
# 检查是否全为数字
|
| 98 |
+
if not integer_part.isdigit() or not decimal_part.isdigit():
|
| 99 |
+
return f" {num_str} {unit} "
|
| 100 |
+
|
| 101 |
+
integer_word = _inflect.number_to_words(int(integer_part), andword="") if integer_part != '0' else 'zero'
|
| 102 |
+
decimal_words = " ".join(
|
| 103 |
+
_inflect.number_to_words(int(d), andword="") for d in decimal_part if d.isdigit()
|
| 104 |
+
)
|
| 105 |
+
num_word = f"{integer_word} point {decimal_words}"
|
| 106 |
+
else:
|
| 107 |
+
if not clean_num.isdigit():
|
| 108 |
+
return f" {num_str} {unit} "
|
| 109 |
+
num_word = _inflect.number_to_words(int(clean_num), andword="")
|
| 110 |
+
|
| 111 |
+
if is_negative:
|
| 112 |
+
num_word = f"minus {num_word}"
|
| 113 |
+
|
| 114 |
+
return f" {num_word} {unit_word} "
|
| 115 |
+
except Exception:
|
| 116 |
+
return f" {num_str} {unit} "
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def _expand_percent(m):
|
| 120 |
+
num_str = m.group(1)
|
| 121 |
+
try:
|
| 122 |
+
is_negative = num_str.startswith('-')
|
| 123 |
+
clean_num = num_str.lstrip('-')
|
| 124 |
+
if not clean_num:
|
| 125 |
+
clean_num = '0'
|
| 126 |
+
|
| 127 |
+
if '.' in clean_num:
|
| 128 |
+
parts = clean_num.split('.', 1)
|
| 129 |
+
integer_part = parts[0] or '0'
|
| 130 |
+
decimal_part = parts[1]
|
| 131 |
+
|
| 132 |
+
if not integer_part.isdigit() or not decimal_part.isdigit():
|
| 133 |
+
return f" {num_str} percent "
|
| 134 |
+
|
| 135 |
+
integer_word = _inflect.number_to_words(int(integer_part), andword="") if integer_part != '0' else 'zero'
|
| 136 |
+
decimal_words = " ".join(
|
| 137 |
+
_inflect.number_to_words(int(d), andword="") for d in decimal_part if d.isdigit()
|
| 138 |
+
)
|
| 139 |
+
num_word = f"{integer_word} point {decimal_words}"
|
| 140 |
+
else:
|
| 141 |
+
if not clean_num.isdigit():
|
| 142 |
+
return f" {num_str} percent "
|
| 143 |
+
num_word = _inflect.number_to_words(int(clean_num), andword="")
|
| 144 |
+
|
| 145 |
+
if is_negative:
|
| 146 |
+
num_word = f"minus {num_word}"
|
| 147 |
+
|
| 148 |
+
return f" {num_word} percent "
|
| 149 |
+
except Exception:
|
| 150 |
+
return f" {num_str} percent "
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
def _expand_dollars(m):
|
| 154 |
+
match = m.group(1)
|
| 155 |
+
is_negative = match.startswith('-')
|
| 156 |
+
clean_match = match.lstrip('-')
|
| 157 |
+
if not clean_match:
|
| 158 |
+
clean_match = '0'
|
| 159 |
+
|
| 160 |
+
try:
|
| 161 |
+
if '.' in clean_match:
|
| 162 |
+
parts = clean_match.split('.', 1)
|
| 163 |
+
integer_part = parts[0] or '0'
|
| 164 |
+
decimal_part = parts[1]
|
| 165 |
+
|
| 166 |
+
if not integer_part.isdigit() or not decimal_part.isdigit():
|
| 167 |
+
return f" {clean_match} dollars "
|
| 168 |
+
|
| 169 |
+
integer_word = _inflect.number_to_words(int(integer_part), andword="") if integer_part != '0' else 'zero'
|
| 170 |
+
decimal_words = " ".join(
|
| 171 |
+
_inflect.number_to_words(int(d), andword="") for d in decimal_part if d.isdigit()
|
| 172 |
+
)
|
| 173 |
+
num_word = f"{integer_word} point {decimal_words}"
|
| 174 |
+
else:
|
| 175 |
+
if not clean_match.isdigit():
|
| 176 |
+
return f" {clean_match} dollars "
|
| 177 |
+
num_word = _inflect.number_to_words(int(clean_match), andword="")
|
| 178 |
+
|
| 179 |
+
if is_negative:
|
| 180 |
+
num_word = f"minus {num_word}"
|
| 181 |
+
|
| 182 |
+
value = float(clean_match)
|
| 183 |
+
unit = "dollar" if abs(value) == 1.0 else "dollars"
|
| 184 |
+
return f" {num_word} {unit} "
|
| 185 |
+
except Exception:
|
| 186 |
+
return f" {clean_match} dollars "
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
def _expand_pounds(m):
|
| 190 |
+
num_str = m.group(1)
|
| 191 |
+
is_negative = num_str.startswith('-')
|
| 192 |
+
clean_num = num_str.lstrip('-')
|
| 193 |
+
if not clean_num:
|
| 194 |
+
clean_num = '0'
|
| 195 |
+
|
| 196 |
+
try:
|
| 197 |
+
if '.' in clean_num:
|
| 198 |
+
parts = clean_num.split('.', 1)
|
| 199 |
+
integer_part = parts[0] or '0'
|
| 200 |
+
decimal_part = parts[1]
|
| 201 |
+
|
| 202 |
+
if not integer_part.isdigit() or not decimal_part.isdigit():
|
| 203 |
+
return f" {clean_num} pounds "
|
| 204 |
+
|
| 205 |
+
integer_word = _inflect.number_to_words(int(integer_part), andword="") if integer_part != '0' else 'zero'
|
| 206 |
+
decimal_words = " ".join(
|
| 207 |
+
_inflect.number_to_words(int(d), andword="") for d in decimal_part if d.isdigit()
|
| 208 |
+
)
|
| 209 |
+
num_word = f"{integer_word} point {decimal_words}"
|
| 210 |
+
else:
|
| 211 |
+
if not clean_num.isdigit():
|
| 212 |
+
return f" {clean_num} pounds "
|
| 213 |
+
num_word = _inflect.number_to_words(int(clean_num), andword="")
|
| 214 |
+
|
| 215 |
+
if is_negative:
|
| 216 |
+
num_word = f"minus {num_word}"
|
| 217 |
+
|
| 218 |
+
value = float(clean_num)
|
| 219 |
+
unit = "pound" if abs(value) == 1.0 else "pounds"
|
| 220 |
+
return f" {num_word} {unit} "
|
| 221 |
+
except Exception:
|
| 222 |
+
return f" {clean_num} pounds "
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
def fraction_to_words(numerator, denominator):
|
| 226 |
+
try:
|
| 227 |
+
if numerator == 1 and denominator == 2:
|
| 228 |
+
return " one half "
|
| 229 |
+
if numerator == 1 and denominator == 4:
|
| 230 |
+
return " one quarter "
|
| 231 |
+
if denominator == 2:
|
| 232 |
+
plural = " half" if numerator == 1 else " halves"
|
| 233 |
+
return f" {_inflect.number_to_words(numerator)}{plural} "
|
| 234 |
+
if denominator == 4:
|
| 235 |
+
plural = " quarter" if numerator == 1 else " quarters"
|
| 236 |
+
return f" {_inflect.number_to_words(numerator)}{plural} "
|
| 237 |
+
ordinal = _inflect.ordinal(_inflect.number_to_words(denominator))
|
| 238 |
+
return f" {_inflect.number_to_words(numerator)} {ordinal} "
|
| 239 |
+
except Exception:
|
| 240 |
+
return f" {numerator} over {denominator} "
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
def _expand_fraction(m):
|
| 244 |
+
try:
|
| 245 |
+
numerator = int(m.group(1))
|
| 246 |
+
denominator = int(m.group(2))
|
| 247 |
+
return fraction_to_words(numerator, denominator)
|
| 248 |
+
except Exception:
|
| 249 |
+
return m.group(0)
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
def _expand_ordinal(m):
|
| 253 |
+
try:
|
| 254 |
+
# 提取纯数字部分
|
| 255 |
+
num = int(re.sub(r"(st|nd|rd|th)", "", m.group(0)))
|
| 256 |
+
word = _inflect.number_to_words(num)
|
| 257 |
+
return f" {word} "
|
| 258 |
+
except Exception:
|
| 259 |
+
return m.group(0)
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
def _expand_number(m):
|
| 263 |
+
num_str = m.group(0)
|
| 264 |
+
try:
|
| 265 |
+
is_negative = num_str.startswith('-')
|
| 266 |
+
clean_num = num_str.lstrip('-')
|
| 267 |
+
if not clean_num:
|
| 268 |
+
clean_num = '0'
|
| 269 |
+
|
| 270 |
+
if '.' in clean_num:
|
| 271 |
+
parts = clean_num.split('.', 1)
|
| 272 |
+
integer_part = parts[0]
|
| 273 |
+
decimal_part = parts[1]
|
| 274 |
+
|
| 275 |
+
if not integer_part:
|
| 276 |
+
integer_part = '0'
|
| 277 |
+
if not integer_part.isdigit() or not decimal_part.isdigit():
|
| 278 |
+
return f" {num_str} "
|
| 279 |
+
|
| 280 |
+
integer_word = _inflect.number_to_words(int(integer_part), andword="") if integer_part != '0' else 'zero'
|
| 281 |
+
decimal_words = " ".join(
|
| 282 |
+
_inflect.number_to_words(int(d), andword="") for d in decimal_part if d.isdigit()
|
| 283 |
+
)
|
| 284 |
+
num_word = f"{integer_word} point {decimal_words}"
|
| 285 |
+
else:
|
| 286 |
+
if not clean_num.isdigit():
|
| 287 |
+
return f" {num_str} "
|
| 288 |
+
num_word = _inflect.number_to_words(int(clean_num), andword="")
|
| 289 |
+
|
| 290 |
+
if is_negative:
|
| 291 |
+
num_word = f"minus {num_word}"
|
| 292 |
+
|
| 293 |
+
return f" {num_word} "
|
| 294 |
+
except Exception:
|
| 295 |
+
return f" {num_str} "
|
| 296 |
+
|
| 297 |
+
|
| 298 |
+
def _expand_version(m):
|
| 299 |
+
prefix = m.group(1)
|
| 300 |
+
sep = m.group(2)
|
| 301 |
+
num_str = m.group(3)
|
| 302 |
+
|
| 303 |
+
try:
|
| 304 |
+
if '.' in num_str:
|
| 305 |
+
parts = num_str.split('.', 1)
|
| 306 |
+
integer_part = parts[0]
|
| 307 |
+
decimal_part = parts[1]
|
| 308 |
+
|
| 309 |
+
if not integer_part.isdigit() or not decimal_part.isdigit():
|
| 310 |
+
return m.group(0)
|
| 311 |
+
|
| 312 |
+
integer_word = _inflect.number_to_words(int(integer_part))
|
| 313 |
+
decimal_words = " ".join(
|
| 314 |
+
_inflect.number_to_words(int(d)) for d in decimal_part if d.isdigit()
|
| 315 |
+
)
|
| 316 |
+
word = f"{integer_word} point {decimal_words}"
|
| 317 |
+
else:
|
| 318 |
+
if not num_str.isdigit():
|
| 319 |
+
return m.group(0)
|
| 320 |
+
word = _inflect.number_to_words(int(num_str))
|
| 321 |
+
except Exception:
|
| 322 |
+
return m.group(0)
|
| 323 |
+
|
| 324 |
+
# 连字符替换为空格,如 gpt-4 → gpt four
|
| 325 |
+
if sep == '-':
|
| 326 |
+
return f"{prefix} {word}"
|
| 327 |
+
# 直接拼接则加空格读出:v2 → v two
|
| 328 |
+
return f"{prefix} {word}"
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
def normalize_numbers(text):
|
| 332 |
+
text = re.sub(_comma_number_re, _remove_commas, text)
|
| 333 |
+
text = re.sub(_unit_re, _expand_unit, text) # 带单位的量(含负数)
|
| 334 |
+
text = re.sub(_pounds_re, _expand_pounds, text)
|
| 335 |
+
text = re.sub(_dollars_re, _expand_dollars, text)
|
| 336 |
+
text = re.sub(_fraction_re, _expand_fraction, text)
|
| 337 |
+
text = re.sub(_percent_number_re, _expand_percent, text)
|
| 338 |
+
text = re.sub(_ordinal_re, _expand_ordinal, text)
|
| 339 |
+
text = re.sub(_version_re, _expand_version, text) # 新增:处理 v2, gpt-4
|
| 340 |
+
text = re.sub(_number_re, _expand_number, text) # 剩余孤立数字
|
| 341 |
+
# text = re.sub(_colon_re, _expand_colon, text) # 冒号(可选)
|
| 342 |
+
text = re.sub(_whitespace_re, " ", text)
|
| 343 |
+
return text.strip()
|
talker/front/text_segment_cut.py
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
import string
|
| 3 |
+
|
| 4 |
+
def is_chinese(text):
|
| 5 |
+
"""检测文本是否包含中文"""
|
| 6 |
+
# 使用简单规则判断
|
| 7 |
+
return bool(re.search(r'[\u4e00-\u9fff]', text))
|
| 8 |
+
|
| 9 |
+
def get_lang_type(text):
|
| 10 |
+
"""
|
| 11 |
+
- 'zh': 只包含中文字符(及相关标点)。
|
| 12 |
+
- 'en': 只包含英文字符(及相关标点)。
|
| 13 |
+
- 'mixed': 同时包含中文字符和英文字符。
|
| 14 |
+
- 'other': 只包含数字、符号等,不含中英文字符。
|
| 15 |
+
"""
|
| 16 |
+
has_chinese = bool(re.search(r'[\u4e00-\u9fff]', text))
|
| 17 |
+
has_english = bool(re.search(r'[a-zA-Z]', text))
|
| 18 |
+
|
| 19 |
+
if has_chinese and has_english:
|
| 20 |
+
return 'mixed'
|
| 21 |
+
if has_chinese:
|
| 22 |
+
return 'zh'
|
| 23 |
+
if has_english:
|
| 24 |
+
return 'en'
|
| 25 |
+
return 'other'
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def split_and_group_sentences(text, group_by_lang=False):
|
| 29 |
+
# 分句正则表达式,匹配中文和英文的句子结束标点
|
| 30 |
+
# pattern = r'(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=[.!?。!?])\s*'
|
| 31 |
+
# 仅匹配中文冒号 `:` 或英文冒号 `:` 后跟空格的情况
|
| 32 |
+
pattern = r'(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=[.!?。!?]|:(?=\s)|:)\s*'
|
| 33 |
+
sentences = [s.strip() for s in re.split(pattern, text.strip()) if s.strip()]
|
| 34 |
+
|
| 35 |
+
if not group_by_lang:
|
| 36 |
+
return sentences
|
| 37 |
+
|
| 38 |
+
# 聚合相同语言的相邻子句
|
| 39 |
+
grouped = []
|
| 40 |
+
current_group = []
|
| 41 |
+
current_lang = None
|
| 42 |
+
|
| 43 |
+
for sentence in sentences:
|
| 44 |
+
lang = 'zh' if is_chinese(sentence) else 'en'
|
| 45 |
+
|
| 46 |
+
if current_lang is None:
|
| 47 |
+
current_group.append(sentence)
|
| 48 |
+
current_lang = lang
|
| 49 |
+
elif lang == current_lang:
|
| 50 |
+
# 中文直接连接,英文添加空格
|
| 51 |
+
if lang == 'zh':
|
| 52 |
+
current_group.append(sentence)
|
| 53 |
+
else:
|
| 54 |
+
current_group.append(' ' + sentence if sentence[0].isalnum() else sentence)
|
| 55 |
+
else:
|
| 56 |
+
grouped.append(''.join(current_group))
|
| 57 |
+
current_group = [sentence]
|
| 58 |
+
current_lang = lang
|
| 59 |
+
|
| 60 |
+
if current_group:
|
| 61 |
+
grouped.append(''.join(current_group))
|
| 62 |
+
|
| 63 |
+
return grouped
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def get_semantic_length(text):
|
| 67 |
+
"""
|
| 68 |
+
计算字符串的语义长度。
|
| 69 |
+
一个汉字计为1,一个连续的英文字母串(单词)计为1。
|
| 70 |
+
"""
|
| 71 |
+
chinese_char_count = len(re.findall(r'[\u4e00-\u9fa5]', text))
|
| 72 |
+
# [a-zA-Z]+ 匹配一个或多个连续的英文字母
|
| 73 |
+
english_word_count = len(re.findall(r'[a-zA-Z]+', text))
|
| 74 |
+
return chinese_char_count + english_word_count
|
| 75 |
+
|
| 76 |
+
def has_valid_content(text):
|
| 77 |
+
"""
|
| 78 |
+
判断文本是否包含有效字符(非标点符号)
|
| 79 |
+
"""
|
| 80 |
+
punctuation_and_whitespace = string.punctuation + string.whitespace
|
| 81 |
+
for char in text:
|
| 82 |
+
if char not in punctuation_and_whitespace:
|
| 83 |
+
return True
|
| 84 |
+
return False
|
| 85 |
+
|
| 86 |
+
def append_text_fragment(fragments, new_text, max_len, min_tail_length):
|
| 87 |
+
"""
|
| 88 |
+
将新文本追加到片段列表中,根据语义长度决定是否合并
|
| 89 |
+
"""
|
| 90 |
+
# 清理 new_text 的前导标点和空格
|
| 91 |
+
new_text = new_text.lstrip(",,:;" + string.whitespace)
|
| 92 |
+
if not has_valid_content(new_text):
|
| 93 |
+
return fragments
|
| 94 |
+
|
| 95 |
+
if not fragments:
|
| 96 |
+
fragments.append(new_text)
|
| 97 |
+
return fragments
|
| 98 |
+
|
| 99 |
+
last_fragment = fragments[-1]
|
| 100 |
+
last_semantic_len = get_semantic_length(last_fragment)
|
| 101 |
+
new_semantic_len = get_semantic_length(new_text)
|
| 102 |
+
|
| 103 |
+
if last_semantic_len + new_semantic_len <= max_len:
|
| 104 |
+
# 特殊处理:如果上一段以句号结尾且新文本很短,则开启新段落
|
| 105 |
+
if last_fragment.endswith(("。", "!", "?")) and new_semantic_len < min_tail_length:
|
| 106 |
+
fragments.append(new_text)
|
| 107 |
+
else:
|
| 108 |
+
# 决定连接符,让中英文拼接更自然
|
| 109 |
+
separator = ""
|
| 110 |
+
# 如果上一个片段结尾不是空格,且新片段以英文/数字开头,则加个空格
|
| 111 |
+
if not last_fragment.endswith(" ") and re.match(r'^[a-zA-Z0-9]', new_text):
|
| 112 |
+
separator = " "
|
| 113 |
+
fragments[-1] += separator + new_text
|
| 114 |
+
else:
|
| 115 |
+
# 开启新段落时,new_text 已经被清理过了
|
| 116 |
+
fragments.append(new_text)
|
| 117 |
+
return fragments
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def split_long_fragment(text_fragment, max_len):
|
| 121 |
+
"""
|
| 122 |
+
分割超长的文本片段。优先沿标点(clause边界)切,避免从字中间断开。
|
| 123 |
+
仅当单个 clause 自身仍超 max_len 时,才退化到字/词级切分(保底不卡死)。
|
| 124 |
+
"""
|
| 125 |
+
fragment_semantic_len = get_semantic_length(text_fragment)
|
| 126 |
+
if fragment_semantic_len <= max_len:
|
| 127 |
+
return [text_fragment]
|
| 128 |
+
|
| 129 |
+
# —— 第一优先级:沿标点切 clause ——
|
| 130 |
+
# 标点(中文,、;。!? + 英文 ,;!?!) 及列表分隔(空格+[-•·]) 作为切分边界。
|
| 131 |
+
# 用 split 保留分隔符并并回前一 clause, 使子串拼接 == 原文(位置校准仍能 find 到)。
|
| 132 |
+
clause_pattern = r'([,、;。!?,;!?]|\s+[-•·])'
|
| 133 |
+
parts = re.split(clause_pattern, text_fragment)
|
| 134 |
+
merged_clauses = []
|
| 135 |
+
for part in parts:
|
| 136 |
+
if part == "":
|
| 137 |
+
continue
|
| 138 |
+
if merged_clauses and re.fullmatch(clause_pattern, part):
|
| 139 |
+
merged_clauses[-1] += part # 标点/分隔 并回前一段
|
| 140 |
+
else:
|
| 141 |
+
merged_clauses.append(part)
|
| 142 |
+
|
| 143 |
+
fragments = []
|
| 144 |
+
current_fragment = ""
|
| 145 |
+
|
| 146 |
+
for clause in merged_clauses:
|
| 147 |
+
clause_semantic_len = get_semantic_length(clause)
|
| 148 |
+
|
| 149 |
+
# 单个 clause 自身超 max_len: 保底字/词级切分(避免无限卡死)
|
| 150 |
+
if clause_semantic_len > max_len:
|
| 151 |
+
if current_fragment:
|
| 152 |
+
fragments.append(current_fragment)
|
| 153 |
+
current_fragment = ""
|
| 154 |
+
fragments.extend(_split_by_char_word(clause, max_len))
|
| 155 |
+
continue
|
| 156 |
+
|
| 157 |
+
current_semantic_len = get_semantic_length(current_fragment)
|
| 158 |
+
if current_semantic_len + clause_semantic_len <= max_len:
|
| 159 |
+
current_fragment += clause
|
| 160 |
+
else:
|
| 161 |
+
if current_fragment:
|
| 162 |
+
fragments.append(current_fragment)
|
| 163 |
+
current_fragment = clause
|
| 164 |
+
|
| 165 |
+
if current_fragment:
|
| 166 |
+
fragments.append(current_fragment)
|
| 167 |
+
|
| 168 |
+
return fragments
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
def _split_by_char_word(text, max_len):
|
| 172 |
+
"""
|
| 173 |
+
保底切分:按字(汉字)/词(英文)等基本语义单元切,用于单个 clause 仍超长时。
|
| 174 |
+
"""
|
| 175 |
+
fragments = []
|
| 176 |
+
current = ""
|
| 177 |
+
tokens = re.findall(r'(\s+|[,、;。!?,;!?]|[\u4e00-\u9fa5]|[a-zA-Z]+|[^a-zA-Z\u4e00-\u9fa5]+)', text)
|
| 178 |
+
for tok in tokens:
|
| 179 |
+
tok_len = get_semantic_length(tok)
|
| 180 |
+
cur_len = get_semantic_length(current)
|
| 181 |
+
if cur_len + tok_len <= max_len:
|
| 182 |
+
current += tok
|
| 183 |
+
else:
|
| 184 |
+
if current:
|
| 185 |
+
fragments.append(current)
|
| 186 |
+
if tok_len > max_len:
|
| 187 |
+
fragments.append(tok)
|
| 188 |
+
current = ""
|
| 189 |
+
else:
|
| 190 |
+
current = tok
|
| 191 |
+
if current:
|
| 192 |
+
fragments.append(current)
|
| 193 |
+
return fragments
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
def calibrate_positions(fragments, positions, original_text):
|
| 197 |
+
"""
|
| 198 |
+
校准fragments和positions的对齐关系
|
| 199 |
+
"""
|
| 200 |
+
calibrated_positions = {}
|
| 201 |
+
current_global_pos = 0
|
| 202 |
+
|
| 203 |
+
for frag_idx, fragment in enumerate(fragments):
|
| 204 |
+
# 在原始文本中查找当前片段的位置
|
| 205 |
+
frag_len = len(fragment)
|
| 206 |
+
found_pos = original_text.find(fragment, current_global_pos)
|
| 207 |
+
|
| 208 |
+
if found_pos == -1:
|
| 209 |
+
# 如果找不到,尝试放宽条件(如忽略空格差异)
|
| 210 |
+
simplified_frag = fragment.replace(" ", "")
|
| 211 |
+
simplified_original = original_text.replace(" ", "")
|
| 212 |
+
found_pos = simplified_original.find(simplified_frag, current_global_pos)
|
| 213 |
+
if found_pos != -1:
|
| 214 |
+
# 找到后映射回原始位置
|
| 215 |
+
non_space_count = original_text[:found_pos].count(" ")
|
| 216 |
+
found_pos += non_space_count
|
| 217 |
+
|
| 218 |
+
if found_pos == -1:
|
| 219 |
+
# 如果仍然找不到,使用原positions中的值(降级处理)
|
| 220 |
+
if frag_idx in positions:
|
| 221 |
+
calibrated_positions[frag_idx] = positions[frag_idx]
|
| 222 |
+
else:
|
| 223 |
+
calibrated_positions[frag_idx] = (current_global_pos, current_global_pos + frag_len)
|
| 224 |
+
continue
|
| 225 |
+
|
| 226 |
+
calibrated_positions[frag_idx] = (found_pos, found_pos + frag_len)
|
| 227 |
+
current_global_pos = found_pos + frag_len
|
| 228 |
+
|
| 229 |
+
return calibrated_positions
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
def cut_text_by_semantic_length(text, max_semantic_length=50, min_tail_length=5):
|
| 233 |
+
"""
|
| 234 |
+
按照语义长度划分文本,保持语义单元的完整性,并返回位置信息
|
| 235 |
+
Args:
|
| 236 |
+
text: 输入文本
|
| 237 |
+
max_semantic_length: 最大语义长度限制
|
| 238 |
+
min_tail_length: 尾部最小长度
|
| 239 |
+
Returns:
|
| 240 |
+
dict: {
|
| 241 |
+
"fragments": List[str], # 分割后的文本片段列表
|
| 242 |
+
"positions": Dict[int, Tuple[int, int]] # 子句位置信息(key为顺序,value为(起始index, 结束index))
|
| 243 |
+
}
|
| 244 |
+
"""
|
| 245 |
+
if not has_valid_content(text):
|
| 246 |
+
return {"fragments": [], "positions": {}}
|
| 247 |
+
|
| 248 |
+
# 保存原始文本用于位置计算
|
| 249 |
+
original_text = text
|
| 250 |
+
# 定义一个独特的占位符
|
| 251 |
+
DOT_PLACEHOLDER = "##DOT##"
|
| 252 |
+
|
| 253 |
+
# 保护小数点和特定缩写中的点
|
| 254 |
+
# 使用正则表达式查找数字中的点(如 3.14)和常见缩写中的点(如 U.S.A.)
|
| 255 |
+
# 并将它们替换为占位符
|
| 256 |
+
# `\d\.\d` 匹配数字间的小数点
|
| 257 |
+
# `([A-Z])\.([A-Z])` 匹配大写字母间的点
|
| 258 |
+
|
| 259 |
+
processed_text = re.sub(r'(\d)\.(\d)', r'\1' + DOT_PLACEHOLDER + r'\2', text)
|
| 260 |
+
for _ in range(3):
|
| 261 |
+
processed_text = re.sub(r'([A-Z])\.([A-Z])', r'\1' + DOT_PLACEHOLDER + r'\2', processed_text)
|
| 262 |
+
|
| 263 |
+
processed_text = processed_text.replace("\n", " ").replace("。,", "。")
|
| 264 |
+
|
| 265 |
+
if get_semantic_length(processed_text) <= max_semantic_length:
|
| 266 |
+
# 返回前恢复占位符
|
| 267 |
+
return {
|
| 268 |
+
"fragments": [processed_text.replace(DOT_PLACEHOLDER, ".")],
|
| 269 |
+
"positions": {0: (0, len(text))} # 整个文本的位置
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
# 标点标准化(只在处理时使用,不影响原始位置计算)
|
| 273 |
+
normalized_text = processed_text.replace(".", "。").replace("!", "!").replace("?", "?").replace(",", ",")
|
| 274 |
+
|
| 275 |
+
result_fragments = []
|
| 276 |
+
position_map = {}
|
| 277 |
+
global_offset = 0 # 跟踪在原始文本中的位置
|
| 278 |
+
|
| 279 |
+
# 第一阶段:按句子分割
|
| 280 |
+
sentences = []
|
| 281 |
+
sentence_positions = []
|
| 282 |
+
current_sentence = ""
|
| 283 |
+
start_idx = 0
|
| 284 |
+
|
| 285 |
+
for i, char in enumerate(normalized_text):
|
| 286 |
+
current_sentence += char
|
| 287 |
+
if char in "。!?": # 移除了 '.' 和 '!' '?'
|
| 288 |
+
sentence = current_sentence.strip()
|
| 289 |
+
if sentence:
|
| 290 |
+
sentences.append(sentence)
|
| 291 |
+
sentence_positions.append((start_idx, i + 1)) # 包含标点的结束位置
|
| 292 |
+
current_sentence = ""
|
| 293 |
+
start_idx = i + 1
|
| 294 |
+
|
| 295 |
+
# 处理最后一个句子
|
| 296 |
+
if current_sentence:
|
| 297 |
+
# 如果最后一部分没有标点,可以补上,也可以不补,保持原逻辑
|
| 298 |
+
sentences.append(current_sentence.strip())
|
| 299 |
+
sentence_positions.append((start_idx, len(normalized_text)))
|
| 300 |
+
if not sentences[-1].endswith(("。", "!", "?")):
|
| 301 |
+
sentences[-1] += "。"
|
| 302 |
+
|
| 303 |
+
# 第二阶段:处理每个句子
|
| 304 |
+
fragment_counter = 0
|
| 305 |
+
for sent_idx, (sentence, (sent_start, sent_end)) in enumerate(zip(sentences, sentence_positions)):
|
| 306 |
+
clauses = []
|
| 307 |
+
clause_positions = []
|
| 308 |
+
current_clause = ""
|
| 309 |
+
clause_start = 0
|
| 310 |
+
|
| 311 |
+
for i, char in enumerate(sentence):
|
| 312 |
+
current_clause += char
|
| 313 |
+
if char in ",;;": # 移除了 ','
|
| 314 |
+
clause = current_clause.strip()
|
| 315 |
+
if clause and has_valid_content(clause):
|
| 316 |
+
clauses.append(clause)
|
| 317 |
+
clause_positions.append((clause_start, i + 1)) # 在句子中的相对位置
|
| 318 |
+
elif clause and clauses:
|
| 319 |
+
clauses[-1] += clause
|
| 320 |
+
clause_positions[-1] = (clause_positions[-1][0], i + 1)
|
| 321 |
+
current_clause = ""
|
| 322 |
+
clause_start = i + 1
|
| 323 |
+
|
| 324 |
+
if current_clause:
|
| 325 |
+
clause = current_clause.strip()
|
| 326 |
+
if clause and has_valid_content(clause):
|
| 327 |
+
clauses.append(clause)
|
| 328 |
+
clause_positions.append((clause_start, len(sentence)))
|
| 329 |
+
elif clause and clauses:
|
| 330 |
+
clauses[-1] += clause
|
| 331 |
+
clause_positions[-1] = (clause_positions[-1][0], len(sentence))
|
| 332 |
+
|
| 333 |
+
# 第三阶段:处理每个子句
|
| 334 |
+
i = 0
|
| 335 |
+
while i < len(clauses):
|
| 336 |
+
clause = clauses[i]
|
| 337 |
+
clause_start_in_sent, clause_end_in_sent = clause_positions[i]
|
| 338 |
+
|
| 339 |
+
# 计算在原始文本中的绝对位置
|
| 340 |
+
abs_start = sent_start + clause_start_in_sent
|
| 341 |
+
abs_end = sent_start + clause_end_in_sent
|
| 342 |
+
|
| 343 |
+
clause_semantic_len = get_semantic_length(clause)
|
| 344 |
+
|
| 345 |
+
# 如果当前子句很短,则尝试与下一个子句聚合
|
| 346 |
+
if clause_semantic_len < min_tail_length and i + 1 < len(clauses):
|
| 347 |
+
next_clause = clauses[i + 1]
|
| 348 |
+
next_start, next_end = clause_positions[i + 1]
|
| 349 |
+
combined_clause = clause + next_clause
|
| 350 |
+
combined_semantic_len = get_semantic_length(combined_clause)
|
| 351 |
+
# 如果聚合后的子句不超过最大长度,则聚合
|
| 352 |
+
if combined_semantic_len <= max_semantic_length:
|
| 353 |
+
result_fragments = append_text_fragment(result_fragments, combined_clause, max_semantic_length, min_tail_length)
|
| 354 |
+
# 合并位置信息
|
| 355 |
+
merged_position = (abs_start, sent_start + next_end)
|
| 356 |
+
position_map[fragment_counter] = merged_position
|
| 357 |
+
fragment_counter += 1
|
| 358 |
+
i += 2
|
| 359 |
+
continue
|
| 360 |
+
|
| 361 |
+
# 如果子句仍然超过最大长度,则进一步分割
|
| 362 |
+
if clause_semantic_len > max_semantic_length:
|
| 363 |
+
sub_fragments = split_long_fragment(clause, max_semantic_length)
|
| 364 |
+
# 等分位置(简化处理,实际应根据语义分割调整)
|
| 365 |
+
frag_len = len(clause)
|
| 366 |
+
sub_frag_count = len(sub_fragments)
|
| 367 |
+
for j, frag in enumerate(sub_fragments):
|
| 368 |
+
result_fragments = append_text_fragment(result_fragments, frag, max_semantic_length, min_tail_length)
|
| 369 |
+
frag_len_part = len(frag)
|
| 370 |
+
frag_start = abs_start + j * (frag_len // sub_frag_count)
|
| 371 |
+
frag_end = frag_start + frag_len_part
|
| 372 |
+
position_map[fragment_counter] = (frag_start, frag_end)
|
| 373 |
+
fragment_counter += 1
|
| 374 |
+
else:
|
| 375 |
+
result_fragments = append_text_fragment(result_fragments, clause, max_semantic_length, min_tail_length)
|
| 376 |
+
position_map[fragment_counter] = (abs_start, abs_end)
|
| 377 |
+
fragment_counter += 1
|
| 378 |
+
i += 1
|
| 379 |
+
|
| 380 |
+
|
| 381 |
+
# 最终返回结果前,恢复所有片段中的占位符
|
| 382 |
+
final_result = [frag.replace(DOT_PLACEHOLDER, ".") for frag in result_fragments]
|
| 383 |
+
|
| 384 |
+
calibrated_positions = calibrate_positions(final_result, position_map, original_text)
|
| 385 |
+
return {
|
| 386 |
+
"fragments": final_result,
|
| 387 |
+
"positions": calibrated_positions
|
| 388 |
+
}
|
talker/front/toolkit.py
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
from typing import Iterable
|
| 3 |
+
|
| 4 |
+
TOKENIZE_PATTERN = r"(?:[a-zA-Z]\.)+|[a-zA-Z]+(?:['\-][a-zA-Z]+)*|\d+(?:\.\d+)?|[\u4e00-\u9fff]|\s+|\S"
|
| 5 |
+
|
| 6 |
+
def tokenize_mixed_text(text: str):
|
| 7 |
+
"""
|
| 8 |
+
将混合文本字符串处理为标记列表,并保留原始的空格。
|
| 9 |
+
"""
|
| 10 |
+
return re.findall(TOKENIZE_PATTERN, text)
|
| 11 |
+
|
| 12 |
+
def tokenize_mixed_text_iterator(text_iterator: Iterable[str]):
|
| 13 |
+
"""
|
| 14 |
+
Args:
|
| 15 |
+
text_iterator (Iterable[str]): 一个产出字符串的迭代器。
|
| 16 |
+
例如,一个打开的文件对象,或一个生成器表达式。
|
| 17 |
+
Yields:
|
| 18 |
+
Iterator[str]: 逐一产出文本中的标记(单词、中文、标点、空格等)。
|
| 19 |
+
"""
|
| 20 |
+
# 函数本身就是一个生成器,将从 re.finditer 返回的迭代器中逐一产出结果
|
| 21 |
+
for chunk in text_iterator:
|
| 22 |
+
# re.finditer 返回一个迭代器,而不是列表
|
| 23 |
+
for match in re.finditer(TOKENIZE_PATTERN, chunk):
|
| 24 |
+
yield match.group(0)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def split_uppercase_acronyms(text):
|
| 28 |
+
"""
|
| 29 |
+
将连续大写字母(缩写词)逐字母用空格隔开。
|
| 30 |
+
单个大写字母或首字母大写的单词不受影响。
|
| 31 |
+
"""
|
| 32 |
+
return re.sub(r'[A-Z]{2,}', lambda m: ' '.join(m.group(0)), text)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def replace_parens_with_sep(text, target_sep=','):
|
| 36 |
+
"""
|
| 37 |
+
将中英文括号替换为target_sep。
|
| 38 |
+
"""
|
| 39 |
+
for ch in '()()':
|
| 40 |
+
text = text.replace(ch, target_sep)
|
| 41 |
+
return text
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def clean_text_formatting(text):
|
| 45 |
+
if not text:
|
| 46 |
+
return text
|
| 47 |
+
|
| 48 |
+
# 定义开头需要被替换为空格的“杂质标点”
|
| 49 |
+
# 保留了:() {} [] () 【】 "" '' “” ‘’ 《》 等成对符号
|
| 50 |
+
# 替换掉:, 。 ! ? ; : 、 …… 等容易出现在开头且没意义的标点
|
| 51 |
+
leading_punct_pattern = r'^[,。!?;:、……\.\!\?\-\—]+'
|
| 52 |
+
|
| 53 |
+
# 替换开头标点
|
| 54 |
+
text = re.sub(leading_punct_pattern, ' ', text)
|
| 55 |
+
# # 聚合连续空格
|
| 56 |
+
# text = re.sub(r'\s+', ' ', text)
|
| 57 |
+
# 去除首尾多余空格
|
| 58 |
+
return text.strip()
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def chinese_punc_en2cn(text):
|
| 62 |
+
"""
|
| 63 |
+
含中文文本清理:包含中文即处理,多个堆叠标点最终只保留一个。
|
| 64 |
+
1. 增加 URL和小数点 保护,防止链接内部符号被误转。
|
| 65 |
+
2. 增强标点优先级逻辑,确保顿号(、)正确去重。
|
| 66 |
+
3. 修复异类标点堆叠的匹配规则。
|
| 67 |
+
4、修复开头符号
|
| 68 |
+
"""
|
| 69 |
+
# # 允许的字符范围:汉字、中文标点、全角符号、空格、以及常见的英文标点
|
| 70 |
+
# # 明确排除:a-zA-Z(英文字母)、0-9(数字)
|
| 71 |
+
# # gen_tag = 'tn'
|
| 72 |
+
# if re.search(r'[a-zA-Z0-9]', text):
|
| 73 |
+
# return text
|
| 74 |
+
|
| 75 |
+
# 仅检查是否包含中文,无中文则直接返回原文本
|
| 76 |
+
# gen_tag = 'tn_v1'
|
| 77 |
+
if not text or not re.search(r'[\u4e00-\u9fa5]', text):
|
| 78 |
+
return clean_text_formatting(text)
|
| 79 |
+
|
| 80 |
+
# URL 占位保护
|
| 81 |
+
urls = re.findall(r'https?://[^\s,。!?]+', text)
|
| 82 |
+
for i, url in enumerate(urls):
|
| 83 |
+
text = text.replace(url, f"URLHOLDER{i}")
|
| 84 |
+
|
| 85 |
+
# 保护数字间的小数点,防止被 punc_map 误转为 。
|
| 86 |
+
text = re.sub(r'(?<=\d)\.(?=\d)', 'DOTPLACEHOLDER', text)
|
| 87 |
+
|
| 88 |
+
# 基础符号转换
|
| 89 |
+
text = text.replace('...', '……')
|
| 90 |
+
punc_map = {
|
| 91 |
+
',': ',', '.': '。', ';': ';', ':': ':', '!': '!', '?': '?',
|
| 92 |
+
'(': '(', ')': ')', '[': '【', ']': '】', '<': '《', '>': '》', '_': '——'
|
| 93 |
+
}
|
| 94 |
+
map_pattern = re.compile('|'.join(re.escape(k) for k in punc_map.keys()))
|
| 95 |
+
text = map_pattern.sub(lambda m: punc_map[m.group(0)], text)
|
| 96 |
+
|
| 97 |
+
# 还原小数点
|
| 98 |
+
text = text.replace('DOTPLACEHOLDER', '.')
|
| 99 |
+
|
| 100 |
+
# 修复:引号计数与转换 (改用闭包计数,避免 := 运算符在 re.sub 中的潜在崩溃)
|
| 101 |
+
dq_count = [0]
|
| 102 |
+
sq_count = [0]
|
| 103 |
+
|
| 104 |
+
def dq_sub(_):
|
| 105 |
+
dq_count[0] += 1
|
| 106 |
+
return '“' if dq_count[0] % 2 != 0 else '”'
|
| 107 |
+
|
| 108 |
+
def sq_sub(_):
|
| 109 |
+
sq_count[0] += 1
|
| 110 |
+
return '‘' if sq_count[0] % 2 != 0 else '’'
|
| 111 |
+
|
| 112 |
+
text = re.sub(r'"', dq_sub, text)
|
| 113 |
+
text = re.sub(r"'", sq_sub, text)
|
| 114 |
+
|
| 115 |
+
# 彻底消除标点周边的空格
|
| 116 |
+
ch_puncs = r',。!?;:“”‘’()【】《》——……、'
|
| 117 |
+
text = re.sub(fr'[ \t\u00A0\u3000]*([{ch_puncs}])[ \t\u00A0\u3000]*', r'\1', text)
|
| 118 |
+
|
| 119 |
+
# 标点递归清理
|
| 120 |
+
while True:
|
| 121 |
+
old_text = text
|
| 122 |
+
|
| 123 |
+
# 压缩完全相同的重复标点
|
| 124 |
+
text = re.sub(r'([{ch_puncs}])\1+', r'\1', text)
|
| 125 |
+
|
| 126 |
+
# 弱标点(,;、) 遇到 强标点(。!?) 时删除弱标点
|
| 127 |
+
text = re.sub(r'[,;、]+([。!?])', r'\1', text)
|
| 128 |
+
text = re.sub(r'([。!?])[,;、]+', r'\1', text)
|
| 129 |
+
|
| 130 |
+
# 处理 逗号/分号 与 顿号 的堆叠
|
| 131 |
+
text = re.sub(r'[,;]+[、]|[、][,;]+', '、', text)
|
| 132 |
+
|
| 133 |
+
# 强标点间唯一化
|
| 134 |
+
text = re.sub(r'([。!?])[。!?]+', r'\1', text)
|
| 135 |
+
|
| 136 |
+
# 剩余异类弱标点堆叠唯一化
|
| 137 |
+
text = re.sub(r'([,;、])[,;、]+', r'\1', text)
|
| 138 |
+
|
| 139 |
+
if old_text == text:
|
| 140 |
+
break
|
| 141 |
+
|
| 142 |
+
# 压缩汉字/单词间连续空格
|
| 143 |
+
text = re.sub(r'[ \t\u00A0\u3000]+', ' ', text)
|
| 144 |
+
|
| 145 |
+
# 还原 URL
|
| 146 |
+
for i, url in enumerate(urls):
|
| 147 |
+
text = text.replace(f"URLHOLDER{i}", url)
|
| 148 |
+
|
| 149 |
+
return clean_text_formatting(text)
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
# 弱标点结尾视为未收束,升格为句末标点(替换而非追加:
|
| 153 |
+
# 纯英文不经 chinese_punc_en2cn 的标点去重,追加会留下 ",." 漏网)
|
| 154 |
+
WEAK_TAIL_PUNCT = ',,、;;'
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
def add_period(text):
|
| 158 |
+
"""尾部无标点则添加句号;汉字结尾加'。',否则加'.'。弱标点(,,、;;)结尾升格为句末标点"""
|
| 159 |
+
stripped = text.rstrip()
|
| 160 |
+
if not stripped: # 空串或全空白
|
| 161 |
+
return "."
|
| 162 |
+
|
| 163 |
+
last_char = stripped[-1]
|
| 164 |
+
|
| 165 |
+
# 弱标点结尾(逗号/顿号/分号):升格为句末标点
|
| 166 |
+
if last_char in WEAK_TAIL_PUNCT:
|
| 167 |
+
has_chinese = bool(re.search(r'[一-鿿]', stripped)) # U+4E00-U+9FFF 汉字区
|
| 168 |
+
return stripped[:-1] + ('。' if has_chinese else '.')
|
| 169 |
+
|
| 170 |
+
# 如果最后一个字符不是字母或数字,则认为它已是标点符号,直接返回
|
| 171 |
+
if not last_char.isalnum():
|
| 172 |
+
return stripped
|
| 173 |
+
|
| 174 |
+
# 判断是否为汉字(基本汉字区和扩展A区)
|
| 175 |
+
is_chinese = ('\u4e00' <= last_char <= '\u9fff' or
|
| 176 |
+
'\u3400' <= last_char <= '\u4dbf')
|
| 177 |
+
suffix = '。' if is_chinese else '.'
|
| 178 |
+
return stripped + suffix
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
def fallback_replace_non_alnum(text, replacement=','):
|
| 182 |
+
"""
|
| 183 |
+
兜底方案:将非汉字、英文、数字及基础TTS标点的字符替换为指定符号。
|
| 184 |
+
并合并连续的替换符号。
|
| 185 |
+
保留中文基础标点:,。!?;:、
|
| 186 |
+
保留英文基础标点:,.!?;:
|
| 187 |
+
保留小数点:.和空格等
|
| 188 |
+
"""
|
| 189 |
+
# 白名单新增: () () " “ ” (半角/全角括号 + 半角/中文双引号) 不再被替换成逗号
|
| 190 |
+
text = re.sub(r"[^\u4e00-\u9fffA-Za-z0-9,。!?;:、,.!?;:\. \u2019\u2018'\"()()\u201C\u201D]", replacement, text)
|
| 191 |
+
text = re.sub(re.escape(replacement) + '+', replacement, text).strip()
|
| 192 |
+
return text
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
def normalize_text_kit(text):
|
| 196 |
+
"""
|
| 197 |
+
完整文本规范化流水线:
|
| 198 |
+
连续大写字母拆开(NBA → N B A)
|
| 199 |
+
(已禁用) 中英括号替换为逗号
|
| 200 |
+
兜底:非汉字/英文/数字/基础标点 → 逗号 (已把 () () " “ ” 加入白名单)
|
| 201 |
+
英文标点→中文标点 + 标点去重 + 空格清理
|
| 202 |
+
"""
|
| 203 |
+
#print(f'[normalize_text_kit] 输入 : {text!r}')
|
| 204 |
+
# ---- 已禁用: 连续大写字母拆分(NBA → N B A)----
|
| 205 |
+
# text = split_uppercase_acronyms(text)
|
| 206 |
+
#print(f'[normalize_text_kit] step1 大写拆分后 : {text!r}')
|
| 207 |
+
# ---- 已禁用: 不再把括号替换成逗号 ----
|
| 208 |
+
# text = replace_parens_with_sep(text)
|
| 209 |
+
# print(f'[normalize_text_kit] step2 括号替换后 : {text!r}')
|
| 210 |
+
text = fallback_replace_non_alnum(text)
|
| 211 |
+
#print(f'[normalize_text_kit] step3 兜底非白名单→, : {text!r}')
|
| 212 |
+
text = chinese_punc_en2cn(text)
|
| 213 |
+
#print(f'[normalize_text_kit] step4 英文标点→中文 : {text!r}')
|
| 214 |
+
text = re.sub(r'\s+', ' ', text).strip()
|
| 215 |
+
#print(f'[normalize_text_kit] step5 空格清理后 : {text!r}')
|
| 216 |
+
return text
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def strip_markdown_code(text):
|
| 220 |
+
"""
|
| 221 |
+
清除 Markdown 行内代码标记(反引号)。
|
| 222 |
+
支持单反引号 `code` 和双反引号 ``code`` 两种格式。
|
| 223 |
+
"""
|
| 224 |
+
# 双反引号优先匹配(避免单反引号先匹配到内层)
|
| 225 |
+
text = re.sub(r'``(.+?)``', r'\1', text)
|
| 226 |
+
# 单反引号
|
| 227 |
+
text = re.sub(r'`(.+?)`', r'\1', text)
|
| 228 |
+
|
| 229 |
+
# 清除残留的未配对反引号
|
| 230 |
+
text = text.replace('`', '')
|
| 231 |
+
return text
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
def preprosess_text(text):
|
| 235 |
+
"""
|
| 236 |
+
文本预处理:
|
| 237 |
+
清除 Markdown 行内代码标记
|
| 238 |
+
"""
|
| 239 |
+
text = strip_markdown_code(text)
|
| 240 |
+
return text
|
talker/inference.py
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Synchronous Ming Talker, adapted from talker_transformers_inference.
|
| 2 |
+
|
| 3 |
+
Native prompt formatting, text normalization, CFM, DiT, Aggregator and AudioVAE
|
| 4 |
+
are retained. Qwen2 uses the installed Transformers cache API; inference needs
|
| 5 |
+
neither vLLM nor engine workers, CUDA graphs, thread pools or temporary files.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from contextlib import nullcontext
|
| 9 |
+
from functools import cached_property
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
import random
|
| 12 |
+
import re
|
| 13 |
+
|
| 14 |
+
import numpy as np
|
| 15 |
+
import onnxruntime
|
| 16 |
+
from safetensors.torch import load_file
|
| 17 |
+
import torch
|
| 18 |
+
from torch import nn
|
| 19 |
+
import torchaudio
|
| 20 |
+
from torchaudio.compliance import kaldi
|
| 21 |
+
from transformers import AutoTokenizer, Qwen2Config, Qwen2Model
|
| 22 |
+
|
| 23 |
+
from .AudioVAE.configuration_audio_vae import AudioVAEconfig
|
| 24 |
+
from .AudioVAE.modeling_audio_vae import AudioVAE
|
| 25 |
+
from .configuration_bailing_talker import BailingTalkerConfig
|
| 26 |
+
from .front.number_en import normalize_numbers
|
| 27 |
+
from .front.text_segment_cut import cut_text_by_semantic_length, is_chinese
|
| 28 |
+
from .front.toolkit import (
|
| 29 |
+
add_period,
|
| 30 |
+
normalize_text_kit,
|
| 31 |
+
preprosess_text,
|
| 32 |
+
tokenize_mixed_text_iterator,
|
| 33 |
+
)
|
| 34 |
+
from .talker_module.aggregator import Aggregator
|
| 35 |
+
from .talker_module.cfm import CFM, get_epss_timesteps
|
| 36 |
+
from .talker_module.dit import DiT
|
| 37 |
+
from .talker_tn.talker_tn import TalkerTN
|
| 38 |
+
from .tts_prompt import (
|
| 39 |
+
DEFAULT_TTS_PROMPT,
|
| 40 |
+
append_optional_target_language,
|
| 41 |
+
build_task_instruction,
|
| 42 |
+
contains_paralinguistic_tag,
|
| 43 |
+
preserve_multilingual_text,
|
| 44 |
+
protect_paralinguistic_tags,
|
| 45 |
+
resolve_request_language,
|
| 46 |
+
restore_paralinguistic_tags,
|
| 47 |
+
target_language_from_prompt,
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
class MingTalker(nn.Module):
|
| 52 |
+
def __init__(self, path: Path):
|
| 53 |
+
super().__init__()
|
| 54 |
+
self.path = path
|
| 55 |
+
self.config = BailingTalkerConfig.from_pretrained(path)
|
| 56 |
+
self.tokenizer = AutoTokenizer.from_pretrained(path / "llm")
|
| 57 |
+
llm_config = Qwen2Config.from_pretrained(path / "llm")
|
| 58 |
+
llm_config._attn_implementation = "sdpa"
|
| 59 |
+
self.model = Qwen2Model(llm_config)
|
| 60 |
+
self.cfm = CFM(
|
| 61 |
+
DiT(llm_cond_dim=llm_config.hidden_size, **self.config.flowmodel),
|
| 62 |
+
steps=self.config.steps,
|
| 63 |
+
)
|
| 64 |
+
self.aggregator = Aggregator(
|
| 65 |
+
llm_input_dim=llm_config.hidden_size, **self.config.aggregator
|
| 66 |
+
)
|
| 67 |
+
self.stop_head = nn.Linear(llm_config.hidden_size, 2)
|
| 68 |
+
self.spk_head = nn.Linear(192, llm_config.hidden_size)
|
| 69 |
+
self.normalizer = TalkerTN()
|
| 70 |
+
self.latent_dim = 64
|
| 71 |
+
self.patch_size = self.config.patch_size
|
| 72 |
+
self.history_patch_size = self.config.history_patch_size
|
| 73 |
+
|
| 74 |
+
@classmethod
|
| 75 |
+
def from_pretrained(cls, path, *, dtype=torch.bfloat16, device="cuda:0"):
|
| 76 |
+
path = Path(path).resolve()
|
| 77 |
+
model = cls(path).to(dtype=dtype)
|
| 78 |
+
weights = load_file(str(path / "model.safetensors"))
|
| 79 |
+
# Recent x-transformers computes RoPE frequencies instead of persisting them.
|
| 80 |
+
state_keys = model.state_dict().keys()
|
| 81 |
+
weights = {
|
| 82 |
+
key: value
|
| 83 |
+
for key, value in weights.items()
|
| 84 |
+
if not (key.endswith("rotary_embed.inv_freq") and key not in state_keys)
|
| 85 |
+
}
|
| 86 |
+
model.load_state_dict(weights, strict=True)
|
| 87 |
+
vae_config = AudioVAEconfig.from_pretrained(path / "vae")
|
| 88 |
+
vae_config._attn_implementation = "eager"
|
| 89 |
+
for section in (
|
| 90 |
+
vae_config.enc_kwargs["backbone"],
|
| 91 |
+
vae_config.dec_kwargs["backbone"],
|
| 92 |
+
):
|
| 93 |
+
section["_attn_implementation"] = "eager"
|
| 94 |
+
section["attn_implementation"] = "eager"
|
| 95 |
+
model.audio_vae = AudioVAE(vae_config).to(dtype=dtype)
|
| 96 |
+
model.audio_vae.load_state_dict(
|
| 97 |
+
load_file(str(path / "vae/model.safetensors")), strict=True
|
| 98 |
+
)
|
| 99 |
+
return model.to(device).eval()
|
| 100 |
+
|
| 101 |
+
@property
|
| 102 |
+
def device(self):
|
| 103 |
+
return next(self.model.parameters()).device
|
| 104 |
+
|
| 105 |
+
@property
|
| 106 |
+
def dtype(self):
|
| 107 |
+
return next(self.model.parameters()).dtype
|
| 108 |
+
|
| 109 |
+
@cached_property
|
| 110 |
+
def speaker_encoder(self):
|
| 111 |
+
options = onnxruntime.SessionOptions()
|
| 112 |
+
options.graph_optimization_level = (
|
| 113 |
+
onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
|
| 114 |
+
)
|
| 115 |
+
options.intra_op_num_threads = 2
|
| 116 |
+
return onnxruntime.InferenceSession(
|
| 117 |
+
str(self.path / "campplus.onnx"),
|
| 118 |
+
sess_options=options,
|
| 119 |
+
providers=["CPUExecutionProvider"],
|
| 120 |
+
)
|
| 121 |
+
|
| 122 |
+
def reference_features(self, reference, continuation):
|
| 123 |
+
waveform = torch.as_tensor(reference["samples"], dtype=torch.float32).reshape(
|
| 124 |
+
1, -1
|
| 125 |
+
)
|
| 126 |
+
sample_rate = reference["sample_rate"]
|
| 127 |
+
speaker_waveform = torchaudio.functional.resample(waveform, sample_rate, 16000)
|
| 128 |
+
features = kaldi.fbank(
|
| 129 |
+
speaker_waveform, num_mel_bins=80, dither=0, sample_frequency=16000
|
| 130 |
+
)
|
| 131 |
+
features -= features.mean(dim=0, keepdim=True)
|
| 132 |
+
embedding = self.speaker_encoder.run(
|
| 133 |
+
None,
|
| 134 |
+
{self.speaker_encoder.get_inputs()[0].name: features.unsqueeze(0).numpy()},
|
| 135 |
+
)[0]
|
| 136 |
+
speaker = [
|
| 137 |
+
self.spk_head(
|
| 138 |
+
torch.as_tensor(
|
| 139 |
+
embedding, device=self.device, dtype=self.dtype
|
| 140 |
+
).reshape(1, 192)
|
| 141 |
+
)
|
| 142 |
+
]
|
| 143 |
+
if not continuation:
|
| 144 |
+
return speaker, None, None
|
| 145 |
+
waveform = torchaudio.functional.resample(
|
| 146 |
+
waveform, sample_rate, self.audio_vae.config.sample_rate
|
| 147 |
+
)
|
| 148 |
+
alignment = (
|
| 149 |
+
self.audio_vae.encoder.hop_size
|
| 150 |
+
* max(1, self.audio_vae.encoder.patch_size)
|
| 151 |
+
* self.patch_size
|
| 152 |
+
)
|
| 153 |
+
waveform = nn.functional.pad(waveform, ((-waveform.shape[-1]) % alignment, 0))
|
| 154 |
+
latents, _ = self.audio_vae.encode_latent(
|
| 155 |
+
waveform.to(device=self.device, dtype=self.dtype),
|
| 156 |
+
torch.tensor([waveform.shape[-1]], device=self.device),
|
| 157 |
+
)
|
| 158 |
+
embeddings = self.aggregator(
|
| 159 |
+
latents.reshape(-1, self.patch_size, self.latent_dim)
|
| 160 |
+
)
|
| 161 |
+
return (
|
| 162 |
+
speaker,
|
| 163 |
+
latents,
|
| 164 |
+
embeddings.reshape(1, -1, self.model.config.hidden_size),
|
| 165 |
+
)
|
| 166 |
+
|
| 167 |
+
def text_fragments(self, value, max_length=50):
|
| 168 |
+
"""Mirror the legacy TTS-family buffering before TN."""
|
| 169 |
+
streaming_text = []
|
| 170 |
+
count = 0
|
| 171 |
+
for index, ele in enumerate(tokenize_mixed_text_iterator(value)):
|
| 172 |
+
if len(ele) == 0:
|
| 173 |
+
continue
|
| 174 |
+
should_process = False
|
| 175 |
+
if ele[-1] in "!?。!?" and (
|
| 176 |
+
len(streaming_text) >= 12 or (count > 0 and len(streaming_text) >= 8)
|
| 177 |
+
):
|
| 178 |
+
should_process = True
|
| 179 |
+
streaming_text.append(ele)
|
| 180 |
+
elif ele[-1] in ",," and len(streaming_text) >= 36:
|
| 181 |
+
should_process = True
|
| 182 |
+
streaming_text.append(ele)
|
| 183 |
+
elif (
|
| 184 |
+
ele[-1] == "."
|
| 185 |
+
and (
|
| 186 |
+
len(streaming_text) >= 12
|
| 187 |
+
or (count > 0 and len(streaming_text) >= 8)
|
| 188 |
+
)
|
| 189 |
+
and (not bool(re.search("[0-9]", streaming_text[-1][-1])))
|
| 190 |
+
):
|
| 191 |
+
should_process = True
|
| 192 |
+
streaming_text.append(ele)
|
| 193 |
+
elif ele[-1] == "\n":
|
| 194 |
+
if len(streaming_text) > 0:
|
| 195 |
+
if re.search("[\\u4e00-\\u9fff]", "".join(streaming_text)):
|
| 196 |
+
if re.search("[\\u4e00-\\u9fff]", streaming_text[-1][-1]):
|
| 197 |
+
ele = ","
|
| 198 |
+
streaming_text.append(ele)
|
| 199 |
+
else:
|
| 200 |
+
if len(ele) > 1 and re.search("[a-zA-Z]", ele[-2]):
|
| 201 |
+
ele = ele[:-1] + "."
|
| 202 |
+
else:
|
| 203 |
+
ele = ele[:-1]
|
| 204 |
+
streaming_text.append(ele)
|
| 205 |
+
if len(streaming_text) >= 12 or (
|
| 206 |
+
count > 0 and len(streaming_text) >= 8
|
| 207 |
+
):
|
| 208 |
+
should_process = True
|
| 209 |
+
else:
|
| 210 |
+
streaming_text.append(ele)
|
| 211 |
+
continue
|
| 212 |
+
if should_process:
|
| 213 |
+
buffered_text = preprosess_text("".join(streaming_text))
|
| 214 |
+
text_list = cut_text_by_semantic_length(buffered_text, max_length)[
|
| 215 |
+
"fragments"
|
| 216 |
+
]
|
| 217 |
+
count += len(text_list)
|
| 218 |
+
yield from text_list
|
| 219 |
+
streaming_text = []
|
| 220 |
+
if streaming_text and re.search(
|
| 221 |
+
"[a-zA-Z\\u4e00-\\u9fff1-9]", "".join(streaming_text)
|
| 222 |
+
):
|
| 223 |
+
buffered_text = preprosess_text("".join(streaming_text))
|
| 224 |
+
buffered_text = add_period(buffered_text)
|
| 225 |
+
yield from cut_text_by_semantic_length(buffered_text, max_length)[
|
| 226 |
+
"fragments"
|
| 227 |
+
]
|
| 228 |
+
|
| 229 |
+
def input_embeddings(
|
| 230 |
+
self, text, prompt, instruction, speaker, prompt_text, prompt_embeddings
|
| 231 |
+
):
|
| 232 |
+
encode = self.tokenizer.encode
|
| 233 |
+
speaker_tokens = []
|
| 234 |
+
for index, _ in enumerate(speaker or []):
|
| 235 |
+
speaker_tokens += (
|
| 236 |
+
encode(f" speaker_{index + 1}:")
|
| 237 |
+
+ encode("<|vision_start|>")
|
| 238 |
+
+ encode("<|vision_pad|>")
|
| 239 |
+
+ encode("<|vision_end|>\n")
|
| 240 |
+
)
|
| 241 |
+
continuation = prompt_embeddings is not None and prompt_text is not None
|
| 242 |
+
tokens = (
|
| 243 |
+
encode("<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n")
|
| 244 |
+
+ encode("<|im_start|>user\n")
|
| 245 |
+
+ encode(prompt)
|
| 246 |
+
+ speaker_tokens
|
| 247 |
+
+ encode(" Text input:\n")
|
| 248 |
+
+ (encode(prompt_text) if continuation else [])
|
| 249 |
+
+ encode(text)
|
| 250 |
+
+ encode("<|im_end|>\n")
|
| 251 |
+
+ encode("<|im_start|>assistant\n")
|
| 252 |
+
+ (encode(instruction) + encode("<|im_end|>") if instruction else [])
|
| 253 |
+
+ encode("<audio>")
|
| 254 |
+
+ (
|
| 255 |
+
encode("<audioPatch>") * prompt_embeddings.shape[1]
|
| 256 |
+
if continuation
|
| 257 |
+
else []
|
| 258 |
+
)
|
| 259 |
+
)
|
| 260 |
+
ids = torch.tensor([tokens], device=self.device)
|
| 261 |
+
embeddings = self.model.get_input_embeddings()(ids)
|
| 262 |
+
if speaker:
|
| 263 |
+
positions = torch.where(ids[0] == encode("<|vision_start|>")[0])[0]
|
| 264 |
+
for position, embedding in zip(positions, speaker):
|
| 265 |
+
embeddings[0, position + 1] = embedding
|
| 266 |
+
if continuation:
|
| 267 |
+
start = torch.where(ids[0] == encode("<audio>")[0])[0][0] + 1
|
| 268 |
+
embeddings[0, start : start + prompt_embeddings.shape[1]] = (
|
| 269 |
+
prompt_embeddings[0]
|
| 270 |
+
)
|
| 271 |
+
return embeddings
|
| 272 |
+
|
| 273 |
+
def generate_latents(
|
| 274 |
+
self, embeddings, prompt_latents, max_steps, cfg, sigma, temperature
|
| 275 |
+
):
|
| 276 |
+
history = embeddings.new_zeros(1, self.history_patch_size, self.latent_dim)
|
| 277 |
+
if prompt_latents is not None:
|
| 278 |
+
tail = prompt_latents[:, -self.history_patch_size :]
|
| 279 |
+
history[:, -tail.shape[1] :] = tail
|
| 280 |
+
past = None
|
| 281 |
+
latents = []
|
| 282 |
+
for step in range(max_steps):
|
| 283 |
+
output = self.model(
|
| 284 |
+
inputs_embeds=embeddings, past_key_values=past, use_cache=True
|
| 285 |
+
)
|
| 286 |
+
past = output.past_key_values
|
| 287 |
+
hidden = output.last_hidden_state[:, -1:]
|
| 288 |
+
noise = torch.randn(
|
| 289 |
+
(1, self.patch_size, self.latent_dim),
|
| 290 |
+
device=self.device,
|
| 291 |
+
dtype=self.dtype,
|
| 292 |
+
)
|
| 293 |
+
timesteps = get_epss_timesteps(self.config.steps, self.device, self.dtype)
|
| 294 |
+
sde_noise = torch.randn(
|
| 295 |
+
(self.config.steps, *noise.shape), device=self.device, dtype=self.dtype
|
| 296 |
+
)
|
| 297 |
+
latent = self.cfm.sample(
|
| 298 |
+
hidden,
|
| 299 |
+
history,
|
| 300 |
+
noise,
|
| 301 |
+
timesteps,
|
| 302 |
+
hidden.new_tensor([cfg, sigma, temperature]),
|
| 303 |
+
sde_noise,
|
| 304 |
+
)
|
| 305 |
+
embeddings = self.aggregator(latent)
|
| 306 |
+
latents.append(latent)
|
| 307 |
+
history = torch.cat([history, latent], dim=1)[:, -self.history_patch_size :]
|
| 308 |
+
stop = self.stop_head(hidden[:, -1]).softmax(dim=-1)[0, 1]
|
| 309 |
+
if step > 3 and stop.item() > 0.5:
|
| 310 |
+
break
|
| 311 |
+
return torch.cat(latents, dim=1)
|
| 312 |
+
|
| 313 |
+
@torch.inference_mode()
|
| 314 |
+
def synthesize(
|
| 315 |
+
self,
|
| 316 |
+
text,
|
| 317 |
+
*,
|
| 318 |
+
ip_name="灵小柔",
|
| 319 |
+
reference=None,
|
| 320 |
+
prompt_text=None,
|
| 321 |
+
language=None,
|
| 322 |
+
max_steps=1000,
|
| 323 |
+
seed=None,
|
| 324 |
+
cfg=2.0,
|
| 325 |
+
sigma=0.25,
|
| 326 |
+
temperature=0.0,
|
| 327 |
+
):
|
| 328 |
+
context = (
|
| 329 |
+
torch.cuda.device(self.device)
|
| 330 |
+
if self.device.type == "cuda"
|
| 331 |
+
else nullcontext()
|
| 332 |
+
)
|
| 333 |
+
with context, torch.autocast(device_type=self.device.type, dtype=self.dtype):
|
| 334 |
+
if seed is not None:
|
| 335 |
+
random.seed(seed)
|
| 336 |
+
np.random.seed(seed)
|
| 337 |
+
torch.manual_seed(seed)
|
| 338 |
+
text = re.sub(r"^[A-Za-z]{1,16}\t", "", text)
|
| 339 |
+
task = "IP" if reference is None else "TTS"
|
| 340 |
+
language, text = resolve_request_language(
|
| 341 |
+
text, language=language, taskname=task
|
| 342 |
+
)
|
| 343 |
+
prompt = append_optional_target_language(DEFAULT_TTS_PROMPT, language)
|
| 344 |
+
instruction = (
|
| 345 |
+
build_task_instruction("IP", ip=ip_name) if reference is None else None
|
| 346 |
+
)
|
| 347 |
+
skip_tn = preserve_multilingual_text(target_language_from_prompt(prompt))
|
| 348 |
+
speaker, prompt_latents, prompt_embeddings = (
|
| 349 |
+
self.reference_features(reference, prompt_text is not None)
|
| 350 |
+
if reference is not None
|
| 351 |
+
else (None, None, None)
|
| 352 |
+
)
|
| 353 |
+
chunks = []
|
| 354 |
+
for fragment in self.text_fragments(text):
|
| 355 |
+
protected = contains_paralinguistic_tag(fragment)
|
| 356 |
+
fragment = (
|
| 357 |
+
protect_paralinguistic_tags(fragment) if protected else fragment
|
| 358 |
+
)
|
| 359 |
+
if not skip_tn:
|
| 360 |
+
if not is_chinese(fragment):
|
| 361 |
+
fragment = normalize_numbers(fragment)
|
| 362 |
+
fragment = normalize_text_kit(
|
| 363 |
+
self.normalizer.normalize(fragment)
|
| 364 |
+
).lstrip(",")
|
| 365 |
+
if protected:
|
| 366 |
+
fragment = restore_paralinguistic_tags(fragment)
|
| 367 |
+
embeddings = self.input_embeddings(
|
| 368 |
+
fragment,
|
| 369 |
+
prompt,
|
| 370 |
+
instruction,
|
| 371 |
+
speaker,
|
| 372 |
+
prompt_text,
|
| 373 |
+
prompt_embeddings,
|
| 374 |
+
)
|
| 375 |
+
latents = self.generate_latents(
|
| 376 |
+
embeddings, prompt_latents, max_steps, cfg, sigma, temperature
|
| 377 |
+
)
|
| 378 |
+
waveform, _, _ = self.audio_vae.decode(
|
| 379 |
+
latents, use_cache=False, last_chunk=True
|
| 380 |
+
)
|
| 381 |
+
chunks.append(
|
| 382 |
+
self.silence_holder(
|
| 383 |
+
waveform.detach().float().cpu(),
|
| 384 |
+
self.audio_vae.config.sample_rate,
|
| 385 |
+
)[0]
|
| 386 |
+
)
|
| 387 |
+
return {
|
| 388 |
+
"audio": torch.cat(chunks, dim=-1),
|
| 389 |
+
"sr": self.audio_vae.config.sample_rate,
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
@staticmethod
|
| 393 |
+
def silence_holder(
|
| 394 |
+
speech, sample_rate, sil_cache=None, last_chunk=True, sil_th=1e-3, last_sil=0.3
|
| 395 |
+
):
|
| 396 |
+
if speech.numel() == 0:
|
| 397 |
+
assert not last_chunk
|
| 398 |
+
return speech, sil_cache
|
| 399 |
+
|
| 400 |
+
frame_step, frame_size = int(sample_rate * 0.1), int(sample_rate * 0.1)
|
| 401 |
+
if sil_cache is None:
|
| 402 |
+
sil_cache = {"holder": [], "buffer": []}
|
| 403 |
+
if sil_cache["buffer"]:
|
| 404 |
+
speech = torch.cat([*sil_cache["buffer"], speech], dim=-1)
|
| 405 |
+
sil_cache["buffer"] = []
|
| 406 |
+
if speech.shape[-1] < frame_size:
|
| 407 |
+
sil_cache["buffer"].append(speech)
|
| 408 |
+
if last_chunk:
|
| 409 |
+
speech = torch.cat(sil_cache["holder"] + sil_cache["buffer"], dim=-1)
|
| 410 |
+
return speech[..., : int(last_sil * sample_rate)], sil_cache
|
| 411 |
+
return torch.zeros(
|
| 412 |
+
(*speech.shape[:-1], 0), device=speech.device, dtype=speech.dtype
|
| 413 |
+
), sil_cache
|
| 414 |
+
|
| 415 |
+
num_frame = (speech.shape[-1] - frame_size) // frame_step + 1
|
| 416 |
+
cur_len = (num_frame - 1) * frame_step + frame_size
|
| 417 |
+
if speech.shape[-1] > cur_len:
|
| 418 |
+
sil_cache["buffer"].append(speech[..., cur_len:])
|
| 419 |
+
speech = speech[..., :cur_len]
|
| 420 |
+
spe_frames = speech.unfold(-1, frame_size, frame_step)
|
| 421 |
+
scores = spe_frames.abs().mean(dim=-1)
|
| 422 |
+
scores = scores.mean(dim=list(range(scores.dim() - 1)))
|
| 423 |
+
idx = scores.shape[0] - 1
|
| 424 |
+
while idx >= 0:
|
| 425 |
+
if scores[idx] > sil_th:
|
| 426 |
+
break
|
| 427 |
+
idx -= 1
|
| 428 |
+
if idx < 0:
|
| 429 |
+
sil_cache["holder"].append(speech)
|
| 430 |
+
if last_chunk:
|
| 431 |
+
speech = torch.cat(sil_cache["holder"] + sil_cache["buffer"], dim=-1)
|
| 432 |
+
return speech[..., : int(last_sil * sample_rate)], sil_cache
|
| 433 |
+
return torch.zeros(
|
| 434 |
+
(*speech.shape[:-1], 0), device=speech.device, dtype=speech.dtype
|
| 435 |
+
), sil_cache
|
| 436 |
+
non_sil_len = idx * frame_step + frame_size
|
| 437 |
+
if last_chunk:
|
| 438 |
+
non_sil_len += int(last_sil * sample_rate)
|
| 439 |
+
speech = torch.cat([*sil_cache["holder"], speech[..., :non_sil_len]], dim=-1)
|
| 440 |
+
sil_cache["holder"] = []
|
| 441 |
+
if non_sil_len < speech.shape[-1]:
|
| 442 |
+
sil_cache["holder"].append(speech[..., non_sil_len:])
|
| 443 |
+
return speech, sil_cache
|
talker/llm/added_tokens.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"</answer>": 151691,
|
| 3 |
+
"</audio>": 151707,
|
| 4 |
+
"</body>": 151681,
|
| 5 |
+
"</gen_audio>": 151710,
|
| 6 |
+
"</gen_image>": 151701,
|
| 7 |
+
"</html>": 151679,
|
| 8 |
+
"</image>": 151696,
|
| 9 |
+
"</prompt>": 151672,
|
| 10 |
+
"</table>": 151683,
|
| 11 |
+
"</td>": 151687,
|
| 12 |
+
"</think>": 151689,
|
| 13 |
+
"</thinker_prefix>": 151674,
|
| 14 |
+
"</tool_call>": 151658,
|
| 15 |
+
"</tr>": 151685,
|
| 16 |
+
"</video>": 151698,
|
| 17 |
+
"</vp>": 151676,
|
| 18 |
+
"<answer>": 151690,
|
| 19 |
+
"<asr>": 151714,
|
| 20 |
+
"<audio>": 151706,
|
| 21 |
+
"<audioHere>": 151711,
|
| 22 |
+
"<audioPatch>": 151705,
|
| 23 |
+
"<audio_bos>": 151665,
|
| 24 |
+
"<audio_eos>": 151666,
|
| 25 |
+
"<audio_pad>": 151667,
|
| 26 |
+
"<body>": 151680,
|
| 27 |
+
"<end_of_audio>": 151704,
|
| 28 |
+
"<end_of_chunk>": 151703,
|
| 29 |
+
"<framePatch>": 151712,
|
| 30 |
+
"<gen_audio>": 151709,
|
| 31 |
+
"<gen_audioPatch>": 151708,
|
| 32 |
+
"<gen_image>": 151700,
|
| 33 |
+
"<gen_imagePatch>": 151699,
|
| 34 |
+
"<html>": 151678,
|
| 35 |
+
"<image>": 151695,
|
| 36 |
+
"<imageHere>": 151702,
|
| 37 |
+
"<imagePatch>": 151694,
|
| 38 |
+
"<prompt>": 151671,
|
| 39 |
+
"<table>": 151682,
|
| 40 |
+
"<td>": 151686,
|
| 41 |
+
"<text>": 151713,
|
| 42 |
+
"<text_bos>": 151668,
|
| 43 |
+
"<text_eos>": 151669,
|
| 44 |
+
"<text_pad>": 151670,
|
| 45 |
+
"<think>": 151688,
|
| 46 |
+
"<thinker_prefix>": 151673,
|
| 47 |
+
"<tool_call>": 151657,
|
| 48 |
+
"<tr>": 151684,
|
| 49 |
+
"<tts>": 151715,
|
| 50 |
+
"<video>": 151697,
|
| 51 |
+
"<vp>": 151675,
|
| 52 |
+
"<|box_end|>": 151649,
|
| 53 |
+
"<|box_start|>": 151648,
|
| 54 |
+
"<|endoftext|>": 151643,
|
| 55 |
+
"<|file_sep|>": 151664,
|
| 56 |
+
"<|fim_middle|>": 151660,
|
| 57 |
+
"<|fim_pad|>": 151662,
|
| 58 |
+
"<|fim_prefix|>": 151659,
|
| 59 |
+
"<|fim_suffix|>": 151661,
|
| 60 |
+
"<|im_end|>": 151645,
|
| 61 |
+
"<|im_start|>": 151644,
|
| 62 |
+
"<|image_pad|>": 151655,
|
| 63 |
+
"<|object_ref_end|>": 151647,
|
| 64 |
+
"<|object_ref_start|>": 151646,
|
| 65 |
+
"<|quad_end|>": 151651,
|
| 66 |
+
"<|quad_start|>": 151650,
|
| 67 |
+
"<|repo_name|>": 151663,
|
| 68 |
+
"<|startoftext|>": 151692,
|
| 69 |
+
"<|video_pad|>": 151656,
|
| 70 |
+
"<|vision_end|>": 151653,
|
| 71 |
+
"<|vision_pad|>": 151654,
|
| 72 |
+
"<|vision_start|>": 151652,
|
| 73 |
+
"[gMASK]": 151693,
|
| 74 |
+
"[item]": 151677
|
| 75 |
+
}
|
talker/llm/config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"eos_token_id": 151645,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 896,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 4864,
|
| 12 |
+
"max_position_embeddings": 32768,
|
| 13 |
+
"max_window_layers": 21,
|
| 14 |
+
"model_type": "qwen2",
|
| 15 |
+
"num_attention_heads": 14,
|
| 16 |
+
"num_hidden_layers": 24,
|
| 17 |
+
"num_key_value_heads": 2,
|
| 18 |
+
"rms_norm_eps": 1e-06,
|
| 19 |
+
"rope_theta": 1000000.0,
|
| 20 |
+
"sliding_window": 32768,
|
| 21 |
+
"tie_word_embeddings": true,
|
| 22 |
+
"torch_dtype": "bfloat16",
|
| 23 |
+
"transformers_version": "4.43.1",
|
| 24 |
+
"use_cache": true,
|
| 25 |
+
"use_sliding_window": false,
|
| 26 |
+
"vocab_size": 151936
|
| 27 |
+
}
|
talker/llm/generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"pad_token_id": 151643,
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": [
|
| 6 |
+
151645,
|
| 7 |
+
151643
|
| 8 |
+
],
|
| 9 |
+
"repetition_penalty": 1.1,
|
| 10 |
+
"temperature": 0.7,
|
| 11 |
+
"top_p": 0.8,
|
| 12 |
+
"top_k": 20,
|
| 13 |
+
"transformers_version": "4.37.0"
|
| 14 |
+
}
|
talker/llm/merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
talker/llm/special_tokens_map.json
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
{
|
| 4 |
+
"content": "[item]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"content": "<html>",
|
| 12 |
+
"lstrip": false,
|
| 13 |
+
"normalized": false,
|
| 14 |
+
"rstrip": false,
|
| 15 |
+
"single_word": false
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"content": "</html>",
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"normalized": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"content": "<body>",
|
| 26 |
+
"lstrip": false,
|
| 27 |
+
"normalized": false,
|
| 28 |
+
"rstrip": false,
|
| 29 |
+
"single_word": false
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"content": "</body>",
|
| 33 |
+
"lstrip": false,
|
| 34 |
+
"normalized": false,
|
| 35 |
+
"rstrip": false,
|
| 36 |
+
"single_word": false
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"content": "<table>",
|
| 40 |
+
"lstrip": false,
|
| 41 |
+
"normalized": false,
|
| 42 |
+
"rstrip": false,
|
| 43 |
+
"single_word": false
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"content": "</table>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"content": "<tr>",
|
| 54 |
+
"lstrip": false,
|
| 55 |
+
"normalized": false,
|
| 56 |
+
"rstrip": false,
|
| 57 |
+
"single_word": false
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"content": "</tr>",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"content": "<td>",
|
| 68 |
+
"lstrip": false,
|
| 69 |
+
"normalized": false,
|
| 70 |
+
"rstrip": false,
|
| 71 |
+
"single_word": false
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"content": "</td>",
|
| 75 |
+
"lstrip": false,
|
| 76 |
+
"normalized": false,
|
| 77 |
+
"rstrip": false,
|
| 78 |
+
"single_word": false
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"content": "<think>",
|
| 82 |
+
"lstrip": false,
|
| 83 |
+
"normalized": false,
|
| 84 |
+
"rstrip": false,
|
| 85 |
+
"single_word": false
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"content": "</think>",
|
| 89 |
+
"lstrip": false,
|
| 90 |
+
"normalized": false,
|
| 91 |
+
"rstrip": false,
|
| 92 |
+
"single_word": false
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"content": "<answer>",
|
| 96 |
+
"lstrip": false,
|
| 97 |
+
"normalized": false,
|
| 98 |
+
"rstrip": false,
|
| 99 |
+
"single_word": false
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"content": "</answer>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"content": "<|startoftext|>",
|
| 110 |
+
"lstrip": false,
|
| 111 |
+
"normalized": false,
|
| 112 |
+
"rstrip": false,
|
| 113 |
+
"single_word": false
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"content": "[gMASK]",
|
| 117 |
+
"lstrip": false,
|
| 118 |
+
"normalized": false,
|
| 119 |
+
"rstrip": false,
|
| 120 |
+
"single_word": false
|
| 121 |
+
}
|
| 122 |
+
],
|
| 123 |
+
"eos_token": {
|
| 124 |
+
"content": "<|im_end|>",
|
| 125 |
+
"lstrip": false,
|
| 126 |
+
"normalized": false,
|
| 127 |
+
"rstrip": false,
|
| 128 |
+
"single_word": false
|
| 129 |
+
},
|
| 130 |
+
"pad_token": {
|
| 131 |
+
"content": "<|endoftext|>",
|
| 132 |
+
"lstrip": false,
|
| 133 |
+
"normalized": false,
|
| 134 |
+
"rstrip": false,
|
| 135 |
+
"single_word": false
|
| 136 |
+
}
|
| 137 |
+
}
|
talker/llm/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87d54ca3b44ea2f822ba39a0a45cb1b61644bd6606d9d3536dea75367bffb06d
|
| 3 |
+
size 11431389
|
talker/llm/tokenizer_config.json
ADDED
|
@@ -0,0 +1,619 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"151643": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"151644": {
|
| 14 |
+
"content": "<|im_start|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"special": true
|
| 20 |
+
},
|
| 21 |
+
"151645": {
|
| 22 |
+
"content": "<|im_end|>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false,
|
| 27 |
+
"special": true
|
| 28 |
+
},
|
| 29 |
+
"151646": {
|
| 30 |
+
"content": "<|object_ref_start|>",
|
| 31 |
+
"lstrip": false,
|
| 32 |
+
"normalized": false,
|
| 33 |
+
"rstrip": false,
|
| 34 |
+
"single_word": false,
|
| 35 |
+
"special": true
|
| 36 |
+
},
|
| 37 |
+
"151647": {
|
| 38 |
+
"content": "<|object_ref_end|>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false,
|
| 43 |
+
"special": true
|
| 44 |
+
},
|
| 45 |
+
"151648": {
|
| 46 |
+
"content": "<|box_start|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"special": true
|
| 52 |
+
},
|
| 53 |
+
"151649": {
|
| 54 |
+
"content": "<|box_end|>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false,
|
| 59 |
+
"special": true
|
| 60 |
+
},
|
| 61 |
+
"151650": {
|
| 62 |
+
"content": "<|quad_start|>",
|
| 63 |
+
"lstrip": false,
|
| 64 |
+
"normalized": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"single_word": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
"151651": {
|
| 70 |
+
"content": "<|quad_end|>",
|
| 71 |
+
"lstrip": false,
|
| 72 |
+
"normalized": false,
|
| 73 |
+
"rstrip": false,
|
| 74 |
+
"single_word": false,
|
| 75 |
+
"special": true
|
| 76 |
+
},
|
| 77 |
+
"151652": {
|
| 78 |
+
"content": "<|vision_start|>",
|
| 79 |
+
"lstrip": false,
|
| 80 |
+
"normalized": false,
|
| 81 |
+
"rstrip": false,
|
| 82 |
+
"single_word": false,
|
| 83 |
+
"special": true
|
| 84 |
+
},
|
| 85 |
+
"151653": {
|
| 86 |
+
"content": "<|vision_end|>",
|
| 87 |
+
"lstrip": false,
|
| 88 |
+
"normalized": false,
|
| 89 |
+
"rstrip": false,
|
| 90 |
+
"single_word": false,
|
| 91 |
+
"special": true
|
| 92 |
+
},
|
| 93 |
+
"151654": {
|
| 94 |
+
"content": "<|vision_pad|>",
|
| 95 |
+
"lstrip": false,
|
| 96 |
+
"normalized": false,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"single_word": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
"151655": {
|
| 102 |
+
"content": "<|image_pad|>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false,
|
| 107 |
+
"special": true
|
| 108 |
+
},
|
| 109 |
+
"151656": {
|
| 110 |
+
"content": "<|video_pad|>",
|
| 111 |
+
"lstrip": false,
|
| 112 |
+
"normalized": false,
|
| 113 |
+
"rstrip": false,
|
| 114 |
+
"single_word": false,
|
| 115 |
+
"special": true
|
| 116 |
+
},
|
| 117 |
+
"151657": {
|
| 118 |
+
"content": "<tool_call>",
|
| 119 |
+
"lstrip": false,
|
| 120 |
+
"normalized": false,
|
| 121 |
+
"rstrip": false,
|
| 122 |
+
"single_word": false,
|
| 123 |
+
"special": false
|
| 124 |
+
},
|
| 125 |
+
"151658": {
|
| 126 |
+
"content": "</tool_call>",
|
| 127 |
+
"lstrip": false,
|
| 128 |
+
"normalized": false,
|
| 129 |
+
"rstrip": false,
|
| 130 |
+
"single_word": false,
|
| 131 |
+
"special": false
|
| 132 |
+
},
|
| 133 |
+
"151659": {
|
| 134 |
+
"content": "<|fim_prefix|>",
|
| 135 |
+
"lstrip": false,
|
| 136 |
+
"normalized": false,
|
| 137 |
+
"rstrip": false,
|
| 138 |
+
"single_word": false,
|
| 139 |
+
"special": false
|
| 140 |
+
},
|
| 141 |
+
"151660": {
|
| 142 |
+
"content": "<|fim_middle|>",
|
| 143 |
+
"lstrip": false,
|
| 144 |
+
"normalized": false,
|
| 145 |
+
"rstrip": false,
|
| 146 |
+
"single_word": false,
|
| 147 |
+
"special": false
|
| 148 |
+
},
|
| 149 |
+
"151661": {
|
| 150 |
+
"content": "<|fim_suffix|>",
|
| 151 |
+
"lstrip": false,
|
| 152 |
+
"normalized": false,
|
| 153 |
+
"rstrip": false,
|
| 154 |
+
"single_word": false,
|
| 155 |
+
"special": false
|
| 156 |
+
},
|
| 157 |
+
"151662": {
|
| 158 |
+
"content": "<|fim_pad|>",
|
| 159 |
+
"lstrip": false,
|
| 160 |
+
"normalized": false,
|
| 161 |
+
"rstrip": false,
|
| 162 |
+
"single_word": false,
|
| 163 |
+
"special": false
|
| 164 |
+
},
|
| 165 |
+
"151663": {
|
| 166 |
+
"content": "<|repo_name|>",
|
| 167 |
+
"lstrip": false,
|
| 168 |
+
"normalized": false,
|
| 169 |
+
"rstrip": false,
|
| 170 |
+
"single_word": false,
|
| 171 |
+
"special": false
|
| 172 |
+
},
|
| 173 |
+
"151664": {
|
| 174 |
+
"content": "<|file_sep|>",
|
| 175 |
+
"lstrip": false,
|
| 176 |
+
"normalized": false,
|
| 177 |
+
"rstrip": false,
|
| 178 |
+
"single_word": false,
|
| 179 |
+
"special": false
|
| 180 |
+
},
|
| 181 |
+
"151665": {
|
| 182 |
+
"content": "<audio_bos>",
|
| 183 |
+
"lstrip": false,
|
| 184 |
+
"normalized": true,
|
| 185 |
+
"rstrip": false,
|
| 186 |
+
"single_word": false,
|
| 187 |
+
"special": false
|
| 188 |
+
},
|
| 189 |
+
"151666": {
|
| 190 |
+
"content": "<audio_eos>",
|
| 191 |
+
"lstrip": false,
|
| 192 |
+
"normalized": true,
|
| 193 |
+
"rstrip": false,
|
| 194 |
+
"single_word": false,
|
| 195 |
+
"special": false
|
| 196 |
+
},
|
| 197 |
+
"151667": {
|
| 198 |
+
"content": "<audio_pad>",
|
| 199 |
+
"lstrip": false,
|
| 200 |
+
"normalized": true,
|
| 201 |
+
"rstrip": false,
|
| 202 |
+
"single_word": false,
|
| 203 |
+
"special": false
|
| 204 |
+
},
|
| 205 |
+
"151668": {
|
| 206 |
+
"content": "<text_bos>",
|
| 207 |
+
"lstrip": false,
|
| 208 |
+
"normalized": true,
|
| 209 |
+
"rstrip": false,
|
| 210 |
+
"single_word": false,
|
| 211 |
+
"special": false
|
| 212 |
+
},
|
| 213 |
+
"151669": {
|
| 214 |
+
"content": "<text_eos>",
|
| 215 |
+
"lstrip": false,
|
| 216 |
+
"normalized": true,
|
| 217 |
+
"rstrip": false,
|
| 218 |
+
"single_word": false,
|
| 219 |
+
"special": false
|
| 220 |
+
},
|
| 221 |
+
"151670": {
|
| 222 |
+
"content": "<text_pad>",
|
| 223 |
+
"lstrip": false,
|
| 224 |
+
"normalized": true,
|
| 225 |
+
"rstrip": false,
|
| 226 |
+
"single_word": false,
|
| 227 |
+
"special": false
|
| 228 |
+
},
|
| 229 |
+
"151671": {
|
| 230 |
+
"content": "<prompt>",
|
| 231 |
+
"lstrip": false,
|
| 232 |
+
"normalized": true,
|
| 233 |
+
"rstrip": false,
|
| 234 |
+
"single_word": false,
|
| 235 |
+
"special": false
|
| 236 |
+
},
|
| 237 |
+
"151672": {
|
| 238 |
+
"content": "</prompt>",
|
| 239 |
+
"lstrip": false,
|
| 240 |
+
"normalized": true,
|
| 241 |
+
"rstrip": false,
|
| 242 |
+
"single_word": false,
|
| 243 |
+
"special": false
|
| 244 |
+
},
|
| 245 |
+
"151673": {
|
| 246 |
+
"content": "<thinker_prefix>",
|
| 247 |
+
"lstrip": false,
|
| 248 |
+
"normalized": true,
|
| 249 |
+
"rstrip": false,
|
| 250 |
+
"single_word": false,
|
| 251 |
+
"special": false
|
| 252 |
+
},
|
| 253 |
+
"151674": {
|
| 254 |
+
"content": "</thinker_prefix>",
|
| 255 |
+
"lstrip": false,
|
| 256 |
+
"normalized": true,
|
| 257 |
+
"rstrip": false,
|
| 258 |
+
"single_word": false,
|
| 259 |
+
"special": false
|
| 260 |
+
},
|
| 261 |
+
"151675": {
|
| 262 |
+
"content": "<vp>",
|
| 263 |
+
"lstrip": false,
|
| 264 |
+
"normalized": true,
|
| 265 |
+
"rstrip": false,
|
| 266 |
+
"single_word": false,
|
| 267 |
+
"special": false
|
| 268 |
+
},
|
| 269 |
+
"151676": {
|
| 270 |
+
"content": "</vp>",
|
| 271 |
+
"lstrip": false,
|
| 272 |
+
"normalized": true,
|
| 273 |
+
"rstrip": false,
|
| 274 |
+
"single_word": false,
|
| 275 |
+
"special": false
|
| 276 |
+
},
|
| 277 |
+
"151677": {
|
| 278 |
+
"content": "[item]",
|
| 279 |
+
"lstrip": false,
|
| 280 |
+
"normalized": false,
|
| 281 |
+
"rstrip": false,
|
| 282 |
+
"single_word": false,
|
| 283 |
+
"special": true
|
| 284 |
+
},
|
| 285 |
+
"151678": {
|
| 286 |
+
"content": "<html>",
|
| 287 |
+
"lstrip": false,
|
| 288 |
+
"normalized": false,
|
| 289 |
+
"rstrip": false,
|
| 290 |
+
"single_word": false,
|
| 291 |
+
"special": true
|
| 292 |
+
},
|
| 293 |
+
"151679": {
|
| 294 |
+
"content": "</html>",
|
| 295 |
+
"lstrip": false,
|
| 296 |
+
"normalized": false,
|
| 297 |
+
"rstrip": false,
|
| 298 |
+
"single_word": false,
|
| 299 |
+
"special": true
|
| 300 |
+
},
|
| 301 |
+
"151680": {
|
| 302 |
+
"content": "<body>",
|
| 303 |
+
"lstrip": false,
|
| 304 |
+
"normalized": false,
|
| 305 |
+
"rstrip": false,
|
| 306 |
+
"single_word": false,
|
| 307 |
+
"special": true
|
| 308 |
+
},
|
| 309 |
+
"151681": {
|
| 310 |
+
"content": "</body>",
|
| 311 |
+
"lstrip": false,
|
| 312 |
+
"normalized": false,
|
| 313 |
+
"rstrip": false,
|
| 314 |
+
"single_word": false,
|
| 315 |
+
"special": true
|
| 316 |
+
},
|
| 317 |
+
"151682": {
|
| 318 |
+
"content": "<table>",
|
| 319 |
+
"lstrip": false,
|
| 320 |
+
"normalized": false,
|
| 321 |
+
"rstrip": false,
|
| 322 |
+
"single_word": false,
|
| 323 |
+
"special": true
|
| 324 |
+
},
|
| 325 |
+
"151683": {
|
| 326 |
+
"content": "</table>",
|
| 327 |
+
"lstrip": false,
|
| 328 |
+
"normalized": false,
|
| 329 |
+
"rstrip": false,
|
| 330 |
+
"single_word": false,
|
| 331 |
+
"special": true
|
| 332 |
+
},
|
| 333 |
+
"151684": {
|
| 334 |
+
"content": "<tr>",
|
| 335 |
+
"lstrip": false,
|
| 336 |
+
"normalized": false,
|
| 337 |
+
"rstrip": false,
|
| 338 |
+
"single_word": false,
|
| 339 |
+
"special": true
|
| 340 |
+
},
|
| 341 |
+
"151685": {
|
| 342 |
+
"content": "</tr>",
|
| 343 |
+
"lstrip": false,
|
| 344 |
+
"normalized": false,
|
| 345 |
+
"rstrip": false,
|
| 346 |
+
"single_word": false,
|
| 347 |
+
"special": true
|
| 348 |
+
},
|
| 349 |
+
"151686": {
|
| 350 |
+
"content": "<td>",
|
| 351 |
+
"lstrip": false,
|
| 352 |
+
"normalized": false,
|
| 353 |
+
"rstrip": false,
|
| 354 |
+
"single_word": false,
|
| 355 |
+
"special": true
|
| 356 |
+
},
|
| 357 |
+
"151687": {
|
| 358 |
+
"content": "</td>",
|
| 359 |
+
"lstrip": false,
|
| 360 |
+
"normalized": false,
|
| 361 |
+
"rstrip": false,
|
| 362 |
+
"single_word": false,
|
| 363 |
+
"special": true
|
| 364 |
+
},
|
| 365 |
+
"151688": {
|
| 366 |
+
"content": "<think>",
|
| 367 |
+
"lstrip": false,
|
| 368 |
+
"normalized": false,
|
| 369 |
+
"rstrip": false,
|
| 370 |
+
"single_word": false,
|
| 371 |
+
"special": true
|
| 372 |
+
},
|
| 373 |
+
"151689": {
|
| 374 |
+
"content": "</think>",
|
| 375 |
+
"lstrip": false,
|
| 376 |
+
"normalized": false,
|
| 377 |
+
"rstrip": false,
|
| 378 |
+
"single_word": false,
|
| 379 |
+
"special": true
|
| 380 |
+
},
|
| 381 |
+
"151690": {
|
| 382 |
+
"content": "<answer>",
|
| 383 |
+
"lstrip": false,
|
| 384 |
+
"normalized": false,
|
| 385 |
+
"rstrip": false,
|
| 386 |
+
"single_word": false,
|
| 387 |
+
"special": true
|
| 388 |
+
},
|
| 389 |
+
"151691": {
|
| 390 |
+
"content": "</answer>",
|
| 391 |
+
"lstrip": false,
|
| 392 |
+
"normalized": false,
|
| 393 |
+
"rstrip": false,
|
| 394 |
+
"single_word": false,
|
| 395 |
+
"special": true
|
| 396 |
+
},
|
| 397 |
+
"151692": {
|
| 398 |
+
"content": "<|startoftext|>",
|
| 399 |
+
"lstrip": false,
|
| 400 |
+
"normalized": false,
|
| 401 |
+
"rstrip": false,
|
| 402 |
+
"single_word": false,
|
| 403 |
+
"special": true
|
| 404 |
+
},
|
| 405 |
+
"151693": {
|
| 406 |
+
"content": "[gMASK]",
|
| 407 |
+
"lstrip": false,
|
| 408 |
+
"normalized": false,
|
| 409 |
+
"rstrip": false,
|
| 410 |
+
"single_word": false,
|
| 411 |
+
"special": true
|
| 412 |
+
},
|
| 413 |
+
"151694": {
|
| 414 |
+
"content": "<imagePatch>",
|
| 415 |
+
"lstrip": false,
|
| 416 |
+
"normalized": false,
|
| 417 |
+
"rstrip": false,
|
| 418 |
+
"single_word": false,
|
| 419 |
+
"special": true
|
| 420 |
+
},
|
| 421 |
+
"151695": {
|
| 422 |
+
"content": "<image>",
|
| 423 |
+
"lstrip": false,
|
| 424 |
+
"normalized": false,
|
| 425 |
+
"rstrip": false,
|
| 426 |
+
"single_word": false,
|
| 427 |
+
"special": true
|
| 428 |
+
},
|
| 429 |
+
"151696": {
|
| 430 |
+
"content": "</image>",
|
| 431 |
+
"lstrip": false,
|
| 432 |
+
"normalized": false,
|
| 433 |
+
"rstrip": false,
|
| 434 |
+
"single_word": false,
|
| 435 |
+
"special": true
|
| 436 |
+
},
|
| 437 |
+
"151697": {
|
| 438 |
+
"content": "<video>",
|
| 439 |
+
"lstrip": false,
|
| 440 |
+
"normalized": false,
|
| 441 |
+
"rstrip": false,
|
| 442 |
+
"single_word": false,
|
| 443 |
+
"special": true
|
| 444 |
+
},
|
| 445 |
+
"151698": {
|
| 446 |
+
"content": "</video>",
|
| 447 |
+
"lstrip": false,
|
| 448 |
+
"normalized": false,
|
| 449 |
+
"rstrip": false,
|
| 450 |
+
"single_word": false,
|
| 451 |
+
"special": true
|
| 452 |
+
},
|
| 453 |
+
"151699": {
|
| 454 |
+
"content": "<gen_imagePatch>",
|
| 455 |
+
"lstrip": false,
|
| 456 |
+
"normalized": false,
|
| 457 |
+
"rstrip": false,
|
| 458 |
+
"single_word": false,
|
| 459 |
+
"special": true
|
| 460 |
+
},
|
| 461 |
+
"151700": {
|
| 462 |
+
"content": "<gen_image>",
|
| 463 |
+
"lstrip": false,
|
| 464 |
+
"normalized": false,
|
| 465 |
+
"rstrip": false,
|
| 466 |
+
"single_word": false,
|
| 467 |
+
"special": true
|
| 468 |
+
},
|
| 469 |
+
"151701": {
|
| 470 |
+
"content": "</gen_image>",
|
| 471 |
+
"lstrip": false,
|
| 472 |
+
"normalized": false,
|
| 473 |
+
"rstrip": false,
|
| 474 |
+
"single_word": false,
|
| 475 |
+
"special": true
|
| 476 |
+
},
|
| 477 |
+
"151702": {
|
| 478 |
+
"content": "<imageHere>",
|
| 479 |
+
"lstrip": false,
|
| 480 |
+
"normalized": false,
|
| 481 |
+
"rstrip": false,
|
| 482 |
+
"single_word": false,
|
| 483 |
+
"special": true
|
| 484 |
+
},
|
| 485 |
+
"151703": {
|
| 486 |
+
"content": "<end_of_chunk>",
|
| 487 |
+
"lstrip": false,
|
| 488 |
+
"normalized": false,
|
| 489 |
+
"rstrip": false,
|
| 490 |
+
"single_word": false,
|
| 491 |
+
"special": true
|
| 492 |
+
},
|
| 493 |
+
"151704": {
|
| 494 |
+
"content": "<end_of_audio>",
|
| 495 |
+
"lstrip": false,
|
| 496 |
+
"normalized": false,
|
| 497 |
+
"rstrip": false,
|
| 498 |
+
"single_word": false,
|
| 499 |
+
"special": true
|
| 500 |
+
},
|
| 501 |
+
"151705": {
|
| 502 |
+
"content": "<audioPatch>",
|
| 503 |
+
"lstrip": false,
|
| 504 |
+
"normalized": false,
|
| 505 |
+
"rstrip": false,
|
| 506 |
+
"single_word": false,
|
| 507 |
+
"special": true
|
| 508 |
+
},
|
| 509 |
+
"151706": {
|
| 510 |
+
"content": "<audio>",
|
| 511 |
+
"lstrip": false,
|
| 512 |
+
"normalized": false,
|
| 513 |
+
"rstrip": false,
|
| 514 |
+
"single_word": false,
|
| 515 |
+
"special": true
|
| 516 |
+
},
|
| 517 |
+
"151707": {
|
| 518 |
+
"content": "</audio>",
|
| 519 |
+
"lstrip": false,
|
| 520 |
+
"normalized": false,
|
| 521 |
+
"rstrip": false,
|
| 522 |
+
"single_word": false,
|
| 523 |
+
"special": true
|
| 524 |
+
},
|
| 525 |
+
"151708": {
|
| 526 |
+
"content": "<gen_audioPatch>",
|
| 527 |
+
"lstrip": false,
|
| 528 |
+
"normalized": false,
|
| 529 |
+
"rstrip": false,
|
| 530 |
+
"single_word": false,
|
| 531 |
+
"special": true
|
| 532 |
+
},
|
| 533 |
+
"151709": {
|
| 534 |
+
"content": "<gen_audio>",
|
| 535 |
+
"lstrip": false,
|
| 536 |
+
"normalized": false,
|
| 537 |
+
"rstrip": false,
|
| 538 |
+
"single_word": false,
|
| 539 |
+
"special": true
|
| 540 |
+
},
|
| 541 |
+
"151710": {
|
| 542 |
+
"content": "</gen_audio>",
|
| 543 |
+
"lstrip": false,
|
| 544 |
+
"normalized": false,
|
| 545 |
+
"rstrip": false,
|
| 546 |
+
"single_word": false,
|
| 547 |
+
"special": true
|
| 548 |
+
},
|
| 549 |
+
"151711": {
|
| 550 |
+
"content": "<audioHere>",
|
| 551 |
+
"lstrip": false,
|
| 552 |
+
"normalized": false,
|
| 553 |
+
"rstrip": false,
|
| 554 |
+
"single_word": false,
|
| 555 |
+
"special": true
|
| 556 |
+
},
|
| 557 |
+
"151712": {
|
| 558 |
+
"content": "<framePatch>",
|
| 559 |
+
"lstrip": false,
|
| 560 |
+
"normalized": false,
|
| 561 |
+
"rstrip": false,
|
| 562 |
+
"single_word": false,
|
| 563 |
+
"special": true
|
| 564 |
+
},
|
| 565 |
+
"151713": {
|
| 566 |
+
"content": "<text>",
|
| 567 |
+
"lstrip": false,
|
| 568 |
+
"normalized": false,
|
| 569 |
+
"rstrip": false,
|
| 570 |
+
"single_word": false,
|
| 571 |
+
"special": true
|
| 572 |
+
},
|
| 573 |
+
"151714": {
|
| 574 |
+
"content": "<asr>",
|
| 575 |
+
"lstrip": false,
|
| 576 |
+
"normalized": false,
|
| 577 |
+
"rstrip": false,
|
| 578 |
+
"single_word": false,
|
| 579 |
+
"special": true
|
| 580 |
+
},
|
| 581 |
+
"151715": {
|
| 582 |
+
"content": "<tts>",
|
| 583 |
+
"lstrip": false,
|
| 584 |
+
"normalized": false,
|
| 585 |
+
"rstrip": false,
|
| 586 |
+
"single_word": false,
|
| 587 |
+
"special": true
|
| 588 |
+
}
|
| 589 |
+
},
|
| 590 |
+
"additional_special_tokens": [
|
| 591 |
+
"[item]",
|
| 592 |
+
"<html>",
|
| 593 |
+
"</html>",
|
| 594 |
+
"<body>",
|
| 595 |
+
"</body>",
|
| 596 |
+
"<table>",
|
| 597 |
+
"</table>",
|
| 598 |
+
"<tr>",
|
| 599 |
+
"</tr>",
|
| 600 |
+
"<td>",
|
| 601 |
+
"</td>",
|
| 602 |
+
"<think>",
|
| 603 |
+
"</think>",
|
| 604 |
+
"<answer>",
|
| 605 |
+
"</answer>",
|
| 606 |
+
"<|startoftext|>",
|
| 607 |
+
"[gMASK]"
|
| 608 |
+
],
|
| 609 |
+
"bos_token": null,
|
| 610 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
|
| 611 |
+
"clean_up_tokenization_spaces": false,
|
| 612 |
+
"eos_token": "<|im_end|>",
|
| 613 |
+
"errors": "replace",
|
| 614 |
+
"model_max_length": 131072,
|
| 615 |
+
"pad_token": "<|endoftext|>",
|
| 616 |
+
"split_special_tokens": false,
|
| 617 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 618 |
+
"unk_token": null
|
| 619 |
+
}
|
talker/llm/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
talker/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7df7677cf9e9d76ecd3d8ea07606bb04249c72010f71827dd3daca3dfa7fd040
|
| 3 |
+
size 1398191068
|