yueyulin commited on
Commit
eb16d30
·
verified ·
1 Parent(s): f7f43b8

Upload folder using huggingface_hub

Browse files
rwkv7-0.4B-g1-respark-voice-tunable/__init__.py ADDED
File without changes
rwkv7-0.4B-g1-respark-voice-tunable/config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "a_low_rank_dim": 64,
3
+ "architectures": [
4
+ "RWKV7ForSpeech"
5
+ ],
6
+ "attn": null,
7
+ "attn_mode": "chunk",
8
+ "audio_global_vocab_size": 4096,
9
+ "auto_map": {
10
+ "AutoConfig": "spark_llm.RWKV7SpeechConfig",
11
+ "AutoModel": "spark_llm.RWKV7Model",
12
+ "AutoModelForCausalLM": "spark_llm.RWKV7ForSpeech"
13
+ },
14
+ "bos_token_id": 0,
15
+ "decay_low_rank_dim": 64,
16
+ "eos_token_id": 0,
17
+ "fuse_cross_entropy": true,
18
+ "fuse_norm": false,
19
+ "gate_low_rank_dim": 128,
20
+ "head_dim": 64,
21
+ "hidden_act": "sqrelu",
22
+ "hidden_ratio": 4.0,
23
+ "hidden_size": 1024,
24
+ "initializer_range": 0.006,
25
+ "intermediate_size": 4096,
26
+ "max_position_embeddings": 2048,
27
+ "model_type": "rwkv7",
28
+ "norm_bias": true,
29
+ "norm_eps": 1e-05,
30
+ "norm_first": true,
31
+ "num_heads": 32,
32
+ "num_hidden_layers": 24,
33
+ "text_vocab_size": 65631,
34
+ "tie_word_embeddings": false,
35
+ "torch_dtype": "float32",
36
+ "transformers_version": "4.52.4",
37
+ "use_cache": true,
38
+ "v_low_rank_dim": 32,
39
+ "value_dim": [
40
+ 1024,
41
+ 1024,
42
+ 1024,
43
+ 1024,
44
+ 1024,
45
+ 1024,
46
+ 1024,
47
+ 1024,
48
+ 1024,
49
+ 1024,
50
+ 1024,
51
+ 1024,
52
+ 1024,
53
+ 1024,
54
+ 1024,
55
+ 1024,
56
+ 1024,
57
+ 1024,
58
+ 1024,
59
+ 1024,
60
+ 1024,
61
+ 1024,
62
+ 1024,
63
+ 1024
64
+ ],
65
+ "vocab_size": 8193
66
+ }
rwkv7-0.4B-g1-respark-voice-tunable/configuration_rwkv7.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from typing import Dict, Optional
4
+
5
+ from transformers.configuration_utils import PretrainedConfig
6
+
7
+
8
+ class RWKV7Config(PretrainedConfig):
9
+
10
+ model_type = 'rwkv7'
11
+ keys_to_ignore_at_inference = ['past_key_values']
12
+
13
+ def __init__(
14
+ self,
15
+ attn_mode: str = "chunk",
16
+ hidden_size: int = 2048,
17
+ hidden_ratio: Optional[int] = 4,
18
+ intermediate_size: Optional[int] = None,
19
+ num_hidden_layers: int = 24,
20
+ head_dim: Optional[int] = 64,
21
+ num_heads: Optional[int] = None,
22
+ decay_low_rank_dim: int = 64,
23
+ gate_low_rank_dim: int = 128,
24
+ a_low_rank_dim: int = 64,
25
+ v_low_rank_dim: int = 16,
26
+ hidden_act: str = "sqrelu",
27
+ max_position_embeddings: int = 2048,
28
+ norm_first: bool = True,
29
+ norm_bias: bool = True,
30
+ norm_eps: float = 1e-5,
31
+ attn: Optional[Dict] = None,
32
+ use_cache: bool = True,
33
+ pad_token_id: int = None,
34
+ bos_token_id: int = 1,
35
+ eos_token_id: int = 2,
36
+ tie_word_embeddings: bool = False,
37
+ initializer_range: float = 0.006,
38
+ fuse_norm: bool = True,
39
+ fuse_cross_entropy: bool = True,
40
+ vocab_size: int = 32000,
41
+ **kwargs
42
+ ):
43
+ self.attn_mode = attn_mode
44
+ self.hidden_size = hidden_size
45
+ self.hidden_ratio = hidden_ratio
46
+ self.intermediate_size = intermediate_size
47
+ self.norm_first = norm_first
48
+ self.num_hidden_layers = num_hidden_layers
49
+
50
+ if head_dim is None and num_heads is not None:
51
+ head_dim = int(hidden_size // num_heads)
52
+ elif head_dim is not None and num_heads is None:
53
+ num_heads = int(hidden_size // head_dim)
54
+
55
+ self.head_dim = head_dim
56
+ self.num_heads = num_heads
57
+
58
+ self.decay_low_rank_dim = decay_low_rank_dim
59
+ self.gate_low_rank_dim = gate_low_rank_dim
60
+ self.a_low_rank_dim = a_low_rank_dim
61
+ self.v_low_rank_dim = v_low_rank_dim
62
+ self.hidden_act = hidden_act
63
+ self.max_position_embeddings = max_position_embeddings
64
+ self.norm_bias = norm_bias
65
+ self.norm_eps = norm_eps
66
+ self.attn = attn
67
+ self.use_cache = use_cache
68
+ self.initializer_range = initializer_range
69
+ self.fuse_norm = fuse_norm
70
+ self.fuse_cross_entropy = fuse_cross_entropy
71
+ self.vocab_size = vocab_size
72
+
73
+ if attn is not None:
74
+ if not isinstance(attn, Dict):
75
+ raise ValueError("attn must be a dictionary")
76
+ if 'layers' not in attn:
77
+ raise ValueError("Layer indices must be provided to initialize hybrid attention layers")
78
+ if 'num_heads' not in attn:
79
+ raise ValueError("Number of heads must be provided to initialize hybrid attention layers")
80
+ attn['num_kv_heads'] = attn.get('num_kv_heads', attn['num_heads'])
81
+ attn['qkv_bias'] = attn.get('qkv_bias', False)
82
+ attn['window_size'] = attn.get('window_size', None)
83
+ attn['rope_theta'] = attn.get('rope_theta', 10000.)
84
+
85
+ super().__init__(
86
+ pad_token_id=pad_token_id,
87
+ bos_token_id=bos_token_id,
88
+ eos_token_id=eos_token_id,
89
+ tie_word_embeddings=tie_word_embeddings,
90
+ **kwargs,
91
+ )
rwkv7-0.4B-g1-respark-voice-tunable/generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "transformers_version": "4.52.4"
6
+ }
rwkv7-0.4B-g1-respark-voice-tunable/hf_rwkv_tokenizer.py ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 The HuggingFace Inc. team.
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
+ """Tokenization classes for RWKV."""
16
+
17
+ import os
18
+ import re
19
+ from typing import TYPE_CHECKING, List, Optional, Tuple
20
+
21
+ from transformers.tokenization_utils import AddedToken, PreTrainedTokenizer
22
+ from transformers.utils import logging
23
+
24
+
25
+ if TYPE_CHECKING:
26
+ pass
27
+
28
+ logger = logging.get_logger(__name__)
29
+
30
+
31
+ VOCAB_FILES_NAMES = {
32
+ "vocab_file": "rwkv_vocab_v20230424.txt",
33
+ }
34
+
35
+ class TRIE:
36
+ __slots__ = tuple("ch,to,values,front".split(","))
37
+ to: list
38
+ values: set
39
+
40
+ def __init__(self, front=None, ch=None):
41
+ self.ch = ch
42
+ self.to = [None for ch in range(256)]
43
+ self.values = set()
44
+ self.front = front
45
+
46
+ def __repr__(self):
47
+ fr = self
48
+ ret = []
49
+ while fr != None:
50
+ if fr.ch != None:
51
+ ret.append(fr.ch)
52
+ fr = fr.front
53
+ return "<TRIE %s %s>" % (ret[::-1], self.values)
54
+
55
+ def add(self, key: bytes, idx: int = 0, val=None):
56
+ if idx == len(key):
57
+ if val is None:
58
+ val = key
59
+ self.values.add(val)
60
+ return self
61
+ ch = key[idx]
62
+ if self.to[ch] is None:
63
+ self.to[ch] = TRIE(front=self, ch=ch)
64
+ return self.to[ch].add(key, idx=idx + 1, val=val)
65
+
66
+ def find_longest(self, key: bytes, idx: int = 0):
67
+ u: TRIE = self
68
+ ch: int = key[idx]
69
+
70
+ while u.to[ch] is not None:
71
+ u = u.to[ch]
72
+ idx += 1
73
+ if u.values:
74
+ ret = idx, u, u.values
75
+ if idx == len(key):
76
+ break
77
+ ch = key[idx]
78
+ return ret
79
+
80
+
81
+ class RWKV_TOKENIZER:
82
+ def __init__(self, file_name):
83
+ self.idx2token = {}
84
+ sorted = [] # must be already sorted
85
+ with open(file_name, "r", encoding="utf-8") as f:
86
+ lines = f.readlines()
87
+ for l in lines:
88
+ idx = int(l[: l.index(" ")])
89
+ x = eval(l[l.index(" ") : l.rindex(" ")])
90
+ x = x.encode("utf-8") if isinstance(x, str) else x
91
+ assert isinstance(x, bytes)
92
+
93
+ assert len(x) == int(l[l.rindex(" ") :])
94
+ sorted += [x]
95
+ self.idx2token[idx] = x
96
+
97
+ self.token2idx = {}
98
+ for k, v in self.idx2token.items():
99
+ self.token2idx[v] = int(k)
100
+
101
+ self.root = TRIE()
102
+ for t, i in self.token2idx.items():
103
+ _ = self.root.add(t, val=(t, i))
104
+
105
+ def encodeBytes(self, src: bytes):
106
+ idx: int = 0
107
+ tokens = []
108
+ while idx < len(src):
109
+ _idx: int = idx
110
+ idx, _, values = self.root.find_longest(src, idx)
111
+ assert idx != _idx
112
+ _, token = next(iter(values))
113
+ tokens.append(token)
114
+ return tokens
115
+
116
+ def decodeBytes(self, tokens):
117
+ return b"".join(map(lambda i: self.idx2token[i], tokens))
118
+
119
+ def encode(self, src):
120
+ if isinstance(src, str):
121
+ return [self.encodeBytes(src.encode("utf-8"))]
122
+ elif isinstance(src, list):
123
+ return [self.encodeBytes(s.encode("utf-8")) for s in src]
124
+
125
+ def decode(self, tokens):
126
+ return [self.decodeBytes(batch).decode("utf-8") for batch in tokens]
127
+ # try:
128
+ # return self.decodeBytes(tokens).decode('utf-8')
129
+ # except:
130
+ # return '\ufffd' # bad utf-8
131
+
132
+ def printTokens(self, tokens):
133
+ for i in tokens:
134
+ s = self.idx2token[i]
135
+ try:
136
+ s = s.decode("utf-8")
137
+ except:
138
+ pass
139
+ print(f"{repr(s)}{i}", end=" ")
140
+ print()
141
+
142
+
143
+ class RwkvTokenizer(PreTrainedTokenizer):
144
+ vocab_files_names = VOCAB_FILES_NAMES
145
+ model_input_names = ["input_ids", "attention_mask"]
146
+
147
+ def __init__(
148
+ self, vocab_file, bos_token="<|rwkv_tokenizer_end_of_text|>", eos_token="<|rwkv_tokenizer_end_of_text|>", unk_token="<|rwkv_tokenizer_end_of_text|>", **kwargs
149
+ ):
150
+ if not os.path.isfile(vocab_file):
151
+ raise ValueError(
152
+ f"Can't find a vocabulary file at path '{vocab_file}'."
153
+ )
154
+
155
+ with open(vocab_file, "r", encoding="utf-8") as reader:
156
+ tokens = reader.readlines()
157
+
158
+ if "add_bos_token" in kwargs:
159
+ self.add_bos_token = kwargs["add_bos_token"]
160
+ else:
161
+ self.add_bos_token = False
162
+ self.trie_tokenizer = RWKV_TOKENIZER(vocab_file)
163
+ vocab = self.trie_tokenizer.token2idx
164
+ self.encoder = vocab
165
+ self.decoder = {v: k for k, v in vocab.items()}
166
+ self._added_tokens_decoder = {0: AddedToken(str(bos_token))}
167
+ super().__init__(
168
+ bos_token=bos_token, eos_token=eos_token, unk_token=unk_token, **kwargs
169
+ )
170
+
171
+ @property
172
+ def vocab_size(self):
173
+ return len(self.encoder)
174
+
175
+ def get_vocab(self):
176
+ vocab = self.encoder
177
+ vocab.update(self.added_tokens_encoder)
178
+ vocab = dict(sorted(vocab.items(), key=lambda item: item[1]))
179
+ return vocab
180
+
181
+ def _tokenize(self, text, split_special_tokens=False):
182
+ # return self.wordpiece_tokenizer.tokenize(text.encode("utf-8"))
183
+ return self.trie_tokenizer.encode(text)[0]
184
+
185
+ def _convert_token_to_id(self, token):
186
+ return token
187
+
188
+ def _convert_id_to_token(self, index):
189
+ """Converts an index (integer) in a token (byte) using the vocab."""
190
+ token = self.decoder.get(index, self.unk_token)
191
+ if isinstance(token, (bytes)):
192
+ token = token.decode("utf-8", errors="replace")
193
+ return token
194
+
195
+ def convert_tokens_to_string(self, tokens):
196
+ """Converts a sequence of tokens (bytes) in a single string. Additional tokens are encoded to bytes"""
197
+ out_string = b"".join(
198
+ [k.encode(errors="replace") if isinstance(k, str) else k for k in tokens]
199
+ ).decode("utf-8")
200
+ return out_string
201
+
202
+ def save_vocabulary(
203
+ self, save_directory: str, filename_prefix: Optional[str] = None
204
+ ) -> Tuple[str]:
205
+ index = 0
206
+ if os.path.isdir(save_directory):
207
+ vocab_file = os.path.join(
208
+ save_directory,
209
+ (filename_prefix + "-" if filename_prefix else "") + "vocab.txt",
210
+ )
211
+ else:
212
+ vocab_file = (
213
+ filename_prefix + "-" if filename_prefix else ""
214
+ ) + save_directory
215
+ with open(vocab_file, "w", encoding="utf-8") as writer:
216
+ for token, token_index in sorted(
217
+ self.encoder.items(), key=lambda kv: kv[1]
218
+ ):
219
+ if index != token_index:
220
+ logger.warning(
221
+ f"Saving vocabulary to {vocab_file}: vocabulary indices are not consecutive."
222
+ " Please check that the vocabulary is not corrupted!"
223
+ )
224
+ index = token_index
225
+ writer.write(str(token) + "\n")
226
+ index += 1
227
+ return (vocab_file,)
228
+
229
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
230
+ if self.add_bos_token:
231
+ bos_token_ids = [self.bos_token_id]
232
+ else:
233
+ bos_token_ids = []
234
+
235
+ output = bos_token_ids + token_ids_0
236
+
237
+ if token_ids_1 is None:
238
+ return output
239
+
240
+ return output + bos_token_ids + token_ids_1
241
+
242
+ def get_special_tokens_mask(
243
+ self,
244
+ token_ids_0: List[int],
245
+ token_ids_1: Optional[List[int]] = None,
246
+ already_has_special_tokens: bool = False,
247
+ ) -> List[int]:
248
+ """
249
+ Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
250
+ special tokens using the tokenizer `prepare_for_model` or `encode_plus` methods.
251
+
252
+ Args:
253
+ token_ids_0 (`List[int]`):
254
+ List of IDs.
255
+ token_ids_1 (`List[int]`, *optional*):
256
+ Optional second list of IDs for sequence pairs.
257
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
258
+ Whether or not the token list is already formatted with special tokens for the model.
259
+
260
+ Returns:
261
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
262
+ """
263
+ if already_has_special_tokens:
264
+ return super().get_special_tokens_mask(
265
+ token_ids_0=token_ids_0,
266
+ token_ids_1=token_ids_1,
267
+ already_has_special_tokens=True,
268
+ )
269
+
270
+ if not self.add_bos_token:
271
+ return super().get_special_tokens_mask(
272
+ token_ids_0=token_ids_0,
273
+ token_ids_1=token_ids_1,
274
+ already_has_special_tokens=False,
275
+ )
276
+
277
+ if token_ids_1 is None:
278
+ return [1] + ([0] * len(token_ids_0))
279
+ return [1] + ([0] * len(token_ids_0)) + [1] + ([0] * len(token_ids_1))
280
+
rwkv7-0.4B-g1-respark-voice-tunable/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1a5073f8de7273ae0e2ea9b9baa5c6417ffeb7fd75454abc0814e58ab94a011
3
+ size 1619016168
rwkv7-0.4B-g1-respark-voice-tunable/model_converted.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b12489fc40149dc3239169662acc66ff196f2ce81c2d469026afce3be4260d5
3
+ size 1619174929
rwkv7-0.4B-g1-respark-voice-tunable/model_padded.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7aff221eee7ae652e6788b85dc3e32888d46da432729eda2a7f36a3723090878
3
+ size 1904786606
rwkv7-0.4B-g1-respark-voice-tunable/modeling_rwkv7.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from fla.models.rwkv7 import RWKV7ForCausalLM, RWKV7Model, RWKV7Config
2
+ RWKV7ForCausalLM = RWKV7ForCausalLM
3
+ RWKV7Model = RWKV7Model
4
+ RWKV7Config = RWKV7Config
rwkv7-0.4B-g1-respark-voice-tunable/modeling_rwkvspeech.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from spark_llm import RWKV7SpeechConfig,RWKV7ForSpeech
2
+ from rwkvfla.models.rwkv7 import RWKV7Model
3
+
4
+ RWKV7ForCausalLM = RWKV7ForSpeech
5
+ RWKV7Model = RWKV7Model
6
+ RWKV7Config = RWKV7SpeechConfig
rwkv7-0.4B-g1-respark-voice-tunable/rwkv_vocab_v20230424.txt ADDED
The diff for this file is too large to render. See raw diff
 
rwkv7-0.4B-g1-respark-voice-tunable/spark_llm.py ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+ from typing import Optional, Union, Tuple, Dict, Unpack
4
+ from transformers.modeling_utils import PreTrainedModel
5
+ from transformers.modeling_outputs import CausalLMOutputWithPast
6
+ from transformers.utils.deprecation import deprecate_kwarg
7
+ from rwkvfla.models.rwkv7.modeling_rwkv7 import RWKV7Model, RWKV7PreTrainedModel, Cache,RWKV7ForCausalLM
8
+ from rwkvfla.models.rwkv7.modeling_rwkv7 import FusedLinearCrossEntropyLoss, FusedCrossEntropyLoss
9
+ from transformers.generation.utils import GenerationMixin
10
+
11
+ from rwkvfla.models.rwkv7.configuration_rwkv7 import RWKV7Config
12
+
13
+ class RWKV7SpeechConfig(RWKV7Config):
14
+ def __init__(self, **kwargs):
15
+ super().__init__(**kwargs)
16
+ self.text_vocab_size = kwargs.get("text_vocab_size", kwargs.get("text_vocab_size"))
17
+ self.audio_global_vocab_size = kwargs.get("audio_global_vocab_size", kwargs.get("audio_global_vocab_size"))
18
+
19
+
20
+ class RWKV7ForSpeech(RWKV7ForCausalLM):
21
+ config_class = RWKV7SpeechConfig
22
+ def __init__(self, config: RWKV7SpeechConfig):
23
+ super().__init__(config)
24
+ self.model = RWKV7Model(config)
25
+ self.vocab_size = config.vocab_size
26
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)#Spark 0.5B vocab size is 8192 + 1 for eos resulting in 8193
27
+ self.criterion = None
28
+ self.text_embedder = nn.Embedding(config.text_vocab_size, config.hidden_size)
29
+ self.global_embedder = nn.Embedding(config.audio_global_vocab_size, config.hidden_size)#Spark 0.5B global token size is 4096
30
+ #TTS Tag includes GLOBAL=0, SEMANTIC=1,START_TTS=2
31
+ self.tts_tag_embedder = nn.Embedding(3, config.hidden_size)
32
+ # Initialize weights and apply final processing
33
+ self.post_init()
34
+ self.dropout = torch.nn.Dropout(0.02)
35
+
36
+ def get_input_embeddings(self):
37
+ return self.model.embeddings
38
+
39
+ def set_input_embeddings(self, value):
40
+ self.model.embeddings = value
41
+
42
+ def get_output_embeddings(self):
43
+ return self.lm_head
44
+
45
+ def set_output_embeddings(self, new_embeddings):
46
+ self.lm_head = new_embeddings
47
+
48
+ def set_decoder(self, decoder):
49
+ self.model = decoder
50
+
51
+ def get_decoder(self):
52
+ return self.model
53
+
54
+ def generate(self, *args, **kwargs):
55
+ try:
56
+ return super().generate(*args, **kwargs)
57
+ except AttributeError as exception:
58
+ if 'past_key_values' in str(exception):
59
+ raise AttributeError(
60
+ f"You tried to call `generate` with a decoding strategy that manipulates `past_key_values`, "
61
+ f"which is not supported for {self.__class__.__name__}. "
62
+ f"Try another generation strategy instead. "
63
+ f"For the available generation strategies, check this doc: "
64
+ f"https://huggingface.co/docs/transformers/en/generation_strategies#decoding-strategies"
65
+ )
66
+ else:
67
+ raise exception
68
+
69
+ @deprecate_kwarg("num_logits_to_keep", version="4.50", new_name="logits_to_keep")
70
+ def prepare_inputs_for_generation(
71
+ self,
72
+ input_ids: torch.LongTensor = None,
73
+ past_key_values: Optional[Cache] = None,
74
+ attention_mask: Optional[torch.Tensor] = None,
75
+ inputs_embeds: Optional[torch.Tensor] = None,
76
+ use_cache: bool = True,
77
+ logits_to_keep: Optional[int] = None,
78
+ **kwargs
79
+ ):
80
+ # only last token for `inputs_ids` if the `past_key_values` is not empty.
81
+ if past_key_values is not None and len(past_key_values) > 0:
82
+ input_ids = input_ids[:, -1:]
83
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
84
+ if inputs_embeds is not None and len(past_key_values) == 0:
85
+ model_inputs = {'inputs_embeds': inputs_embeds}
86
+ else:
87
+ # The `contiguous()` here is necessary to have a static stride during decoding. torchdynamo otherwise
88
+ # recompiles graphs as the stride of the inputs is a guard.
89
+ # Ref: https://github.com/huggingface/transformers/pull/29114
90
+ # TODO: use `next_tokens` directly instead.
91
+ model_inputs = {'input_ids': input_ids.contiguous()}
92
+
93
+ if logits_to_keep is not None:
94
+ model_inputs['logits_to_keep'] = logits_to_keep
95
+
96
+ model_inputs.update({
97
+ 'past_key_values': past_key_values,
98
+ 'use_cache': use_cache,
99
+ 'attention_mask': attention_mask,
100
+ 'logits_to_keep': logits_to_keep,
101
+ })
102
+ return model_inputs
103
+
104
+ @deprecate_kwarg("num_logits_to_keep", version="4.50", new_name="logits_to_keep")
105
+ def forward(
106
+ self,
107
+ input_ids: torch.LongTensor = None,
108
+ attention_mask: Optional[torch.Tensor] = None,
109
+ inputs_embeds: Optional[torch.Tensor] = None,
110
+ past_key_values: Optional[Cache] = None,
111
+ labels: Optional[torch.LongTensor] = None,
112
+ use_cache: Optional[bool] = None,
113
+ output_attentions: Optional[bool] = None,
114
+ output_hidden_states: Optional[bool] = None,
115
+ return_dict: Optional[bool] = None,
116
+ logits_to_keep: Optional[int] = 0,
117
+ **kwargs: Unpack[Dict]
118
+ ) -> Union[Tuple, CausalLMOutputWithPast]:
119
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
120
+ output_hidden_states = (
121
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
122
+ )
123
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
124
+ if self.training and inputs_embeds is not None:
125
+ inputs_embeds = self.dropout(inputs_embeds)
126
+ outputs = self.model(
127
+ input_ids=input_ids,
128
+ attention_mask=attention_mask,
129
+ inputs_embeds=inputs_embeds,
130
+ past_key_values=past_key_values,
131
+ use_cache=use_cache,
132
+ output_attentions=output_attentions,
133
+ output_hidden_states=output_hidden_states,
134
+ return_dict=return_dict,
135
+ **kwargs
136
+ )
137
+
138
+ hidden_states = outputs[0]
139
+ fuse_linear_and_cross_entropy = self.config.fuse_cross_entropy and self.training
140
+
141
+ loss, logits = None, None
142
+ if not fuse_linear_and_cross_entropy or labels is None:
143
+ logits = self.lm_head(hidden_states if logits_to_keep is None else hidden_states[:, -logits_to_keep:])
144
+ if labels is not None:
145
+ if getattr(self, 'criterion', None) is None:
146
+ if fuse_linear_and_cross_entropy:
147
+ criterion = FusedLinearCrossEntropyLoss()
148
+ elif self.config.fuse_cross_entropy:
149
+ criterion = FusedCrossEntropyLoss(inplace_backward=True)
150
+ else:
151
+ criterion = nn.CrossEntropyLoss()
152
+ else:
153
+ criterion = self.criterion
154
+ # Enable model parallelism
155
+ labels = labels.to(hidden_states.device)
156
+ labels = torch.cat((labels[..., 1:], torch.full_like(labels[:, :1], criterion.ignore_index)), 1)
157
+ if fuse_linear_and_cross_entropy:
158
+ loss = criterion(hidden_states, labels, self.lm_head.weight, self.lm_head.bias)
159
+ else:
160
+ loss = criterion(logits.view(labels.numel(), -1), labels.view(-1))
161
+
162
+ if not return_dict:
163
+ output = (logits,) + outputs[1:]
164
+ return (loss,) + output if loss is not None else output
165
+
166
+ return CausalLMOutputWithPast(
167
+ loss=loss,
168
+ logits=logits,
169
+ past_key_values=outputs.past_key_values,
170
+ hidden_states=outputs.hidden_states,
171
+ attentions=outputs.attentions,
172
+ )
173
+
174
+ def copy_state_dict(self, state_dict: dict):
175
+ """从源 state dict 复制参数到当前模型,排除 embeddings 和 lm_head
176
+ The state dict is from original RWKV7 language model
177
+ Args:
178
+ state_dict: 源 state dict
179
+ """
180
+ # 获取当前模型的 state dict
181
+ target_dict = self.state_dict()
182
+
183
+ # 创建新的 state dict 用于存储要复制的参数
184
+ new_state_dict = {}
185
+
186
+ # 遍历源 state dict 的键
187
+ for key in state_dict.keys():
188
+ # 跳过 embeddings 和 lm_head 相关的参数
189
+ if key == 'model.embeddings.weight':
190
+ new_state_dict['text_embedder.weight'] = state_dict[key]
191
+ continue
192
+ if 'embeddings' in key or 'lm_head' in key:
193
+ continue
194
+ # 如果键在当前模型中存在,则复制参数
195
+ if key in target_dict:
196
+ new_state_dict[key] = state_dict[key]
197
+
198
+ # 加载新的 state dict 到当前模型
199
+ info = self.load_state_dict(new_state_dict, strict=False)
200
+ print(info)
201
+ return self
202
+
rwkv7-0.4B-g1-respark-voice-tunable/special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|rwkv_tokenizer_end_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": "\n\n",
10
+ "pad_token": {
11
+ "content": "<|rwkv_tokenizer_end_of_text|>",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ },
17
+ "unk_token": {
18
+ "content": "<|rwkv_tokenizer_end_of_text|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
rwkv7-0.4B-g1-respark-voice-tunable/tokenizer_config.json ADDED
@@ -0,0 +1,836 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<|rwkv_tokenizer_end_of_text|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "65530": {
13
+ "content": "\n\n",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "65531": {
21
+ "content": "SPCT_0",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": false
27
+ },
28
+ "65532": {
29
+ "content": "SPCT_1",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": false
35
+ },
36
+ "65533": {
37
+ "content": "SPCT_2",
38
+ "lstrip": false,
39
+ "normalized": true,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": false
43
+ },
44
+ "65534": {
45
+ "content": "SPCT_3",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": false
51
+ },
52
+ "65535": {
53
+ "content": "SPCT_4",
54
+ "lstrip": false,
55
+ "normalized": true,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": false
59
+ },
60
+ "65536": {
61
+ "content": "SPCT_5",
62
+ "lstrip": false,
63
+ "normalized": true,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": false
67
+ },
68
+ "65537": {
69
+ "content": "SPCT_6",
70
+ "lstrip": false,
71
+ "normalized": true,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": false
75
+ },
76
+ "65538": {
77
+ "content": "SPCT_7",
78
+ "lstrip": false,
79
+ "normalized": true,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": false
83
+ },
84
+ "65539": {
85
+ "content": "SPCT_8",
86
+ "lstrip": false,
87
+ "normalized": true,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": false
91
+ },
92
+ "65540": {
93
+ "content": "SPCT_9",
94
+ "lstrip": false,
95
+ "normalized": true,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": false
99
+ },
100
+ "65541": {
101
+ "content": "SPCT_10",
102
+ "lstrip": false,
103
+ "normalized": true,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": false
107
+ },
108
+ "65542": {
109
+ "content": "SPCT_11",
110
+ "lstrip": false,
111
+ "normalized": true,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": false
115
+ },
116
+ "65543": {
117
+ "content": "SPCT_12",
118
+ "lstrip": false,
119
+ "normalized": true,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": false
123
+ },
124
+ "65544": {
125
+ "content": "SPCT_13",
126
+ "lstrip": false,
127
+ "normalized": true,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": false
131
+ },
132
+ "65545": {
133
+ "content": "SPCT_14",
134
+ "lstrip": false,
135
+ "normalized": true,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": false
139
+ },
140
+ "65546": {
141
+ "content": "SPCT_15",
142
+ "lstrip": false,
143
+ "normalized": true,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": false
147
+ },
148
+ "65547": {
149
+ "content": "SPCT_16",
150
+ "lstrip": false,
151
+ "normalized": true,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": false
155
+ },
156
+ "65548": {
157
+ "content": "SPCT_17",
158
+ "lstrip": false,
159
+ "normalized": true,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": false
163
+ },
164
+ "65549": {
165
+ "content": "SPCT_18",
166
+ "lstrip": false,
167
+ "normalized": true,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": false
171
+ },
172
+ "65550": {
173
+ "content": "SPCT_19",
174
+ "lstrip": false,
175
+ "normalized": true,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": false
179
+ },
180
+ "65551": {
181
+ "content": "SPCT_20",
182
+ "lstrip": false,
183
+ "normalized": true,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": false
187
+ },
188
+ "65552": {
189
+ "content": "SPCT_21",
190
+ "lstrip": false,
191
+ "normalized": true,
192
+ "rstrip": false,
193
+ "single_word": false,
194
+ "special": false
195
+ },
196
+ "65553": {
197
+ "content": "SPCT_22",
198
+ "lstrip": false,
199
+ "normalized": true,
200
+ "rstrip": false,
201
+ "single_word": false,
202
+ "special": false
203
+ },
204
+ "65554": {
205
+ "content": "SPCT_23",
206
+ "lstrip": false,
207
+ "normalized": true,
208
+ "rstrip": false,
209
+ "single_word": false,
210
+ "special": false
211
+ },
212
+ "65555": {
213
+ "content": "SPCT_24",
214
+ "lstrip": false,
215
+ "normalized": true,
216
+ "rstrip": false,
217
+ "single_word": false,
218
+ "special": false
219
+ },
220
+ "65556": {
221
+ "content": "SPCT_25",
222
+ "lstrip": false,
223
+ "normalized": true,
224
+ "rstrip": false,
225
+ "single_word": false,
226
+ "special": false
227
+ },
228
+ "65557": {
229
+ "content": "SPCT_26",
230
+ "lstrip": false,
231
+ "normalized": true,
232
+ "rstrip": false,
233
+ "single_word": false,
234
+ "special": false
235
+ },
236
+ "65558": {
237
+ "content": "SPCT_27",
238
+ "lstrip": false,
239
+ "normalized": true,
240
+ "rstrip": false,
241
+ "single_word": false,
242
+ "special": false
243
+ },
244
+ "65559": {
245
+ "content": "SPCT_28",
246
+ "lstrip": false,
247
+ "normalized": true,
248
+ "rstrip": false,
249
+ "single_word": false,
250
+ "special": false
251
+ },
252
+ "65560": {
253
+ "content": "SPCT_29",
254
+ "lstrip": false,
255
+ "normalized": true,
256
+ "rstrip": false,
257
+ "single_word": false,
258
+ "special": false
259
+ },
260
+ "65561": {
261
+ "content": "SPCT_30",
262
+ "lstrip": false,
263
+ "normalized": true,
264
+ "rstrip": false,
265
+ "single_word": false,
266
+ "special": false
267
+ },
268
+ "65562": {
269
+ "content": "SPCT_31",
270
+ "lstrip": false,
271
+ "normalized": true,
272
+ "rstrip": false,
273
+ "single_word": false,
274
+ "special": false
275
+ },
276
+ "65563": {
277
+ "content": "SPCT_32",
278
+ "lstrip": false,
279
+ "normalized": true,
280
+ "rstrip": false,
281
+ "single_word": false,
282
+ "special": false
283
+ },
284
+ "65564": {
285
+ "content": "SPCT_33",
286
+ "lstrip": false,
287
+ "normalized": true,
288
+ "rstrip": false,
289
+ "single_word": false,
290
+ "special": false
291
+ },
292
+ "65565": {
293
+ "content": "SPCT_34",
294
+ "lstrip": false,
295
+ "normalized": true,
296
+ "rstrip": false,
297
+ "single_word": false,
298
+ "special": false
299
+ },
300
+ "65566": {
301
+ "content": "SPCT_35",
302
+ "lstrip": false,
303
+ "normalized": true,
304
+ "rstrip": false,
305
+ "single_word": false,
306
+ "special": false
307
+ },
308
+ "65567": {
309
+ "content": "SPCT_36",
310
+ "lstrip": false,
311
+ "normalized": true,
312
+ "rstrip": false,
313
+ "single_word": false,
314
+ "special": false
315
+ },
316
+ "65568": {
317
+ "content": "SPCT_37",
318
+ "lstrip": false,
319
+ "normalized": true,
320
+ "rstrip": false,
321
+ "single_word": false,
322
+ "special": false
323
+ },
324
+ "65569": {
325
+ "content": "SPCT_38",
326
+ "lstrip": false,
327
+ "normalized": true,
328
+ "rstrip": false,
329
+ "single_word": false,
330
+ "special": false
331
+ },
332
+ "65570": {
333
+ "content": "SPCT_39",
334
+ "lstrip": false,
335
+ "normalized": true,
336
+ "rstrip": false,
337
+ "single_word": false,
338
+ "special": false
339
+ },
340
+ "65571": {
341
+ "content": "SPCT_40",
342
+ "lstrip": false,
343
+ "normalized": true,
344
+ "rstrip": false,
345
+ "single_word": false,
346
+ "special": false
347
+ },
348
+ "65572": {
349
+ "content": "SPCT_41",
350
+ "lstrip": false,
351
+ "normalized": true,
352
+ "rstrip": false,
353
+ "single_word": false,
354
+ "special": false
355
+ },
356
+ "65573": {
357
+ "content": "SPCT_42",
358
+ "lstrip": false,
359
+ "normalized": true,
360
+ "rstrip": false,
361
+ "single_word": false,
362
+ "special": false
363
+ },
364
+ "65574": {
365
+ "content": "SPCT_43",
366
+ "lstrip": false,
367
+ "normalized": true,
368
+ "rstrip": false,
369
+ "single_word": false,
370
+ "special": false
371
+ },
372
+ "65575": {
373
+ "content": "SPCT_44",
374
+ "lstrip": false,
375
+ "normalized": true,
376
+ "rstrip": false,
377
+ "single_word": false,
378
+ "special": false
379
+ },
380
+ "65576": {
381
+ "content": "SPCT_45",
382
+ "lstrip": false,
383
+ "normalized": true,
384
+ "rstrip": false,
385
+ "single_word": false,
386
+ "special": false
387
+ },
388
+ "65577": {
389
+ "content": "SPCT_46",
390
+ "lstrip": false,
391
+ "normalized": true,
392
+ "rstrip": false,
393
+ "single_word": false,
394
+ "special": false
395
+ },
396
+ "65578": {
397
+ "content": "SPCT_47",
398
+ "lstrip": false,
399
+ "normalized": true,
400
+ "rstrip": false,
401
+ "single_word": false,
402
+ "special": false
403
+ },
404
+ "65579": {
405
+ "content": "SPCT_48",
406
+ "lstrip": false,
407
+ "normalized": true,
408
+ "rstrip": false,
409
+ "single_word": false,
410
+ "special": false
411
+ },
412
+ "65580": {
413
+ "content": "SPCT_49",
414
+ "lstrip": false,
415
+ "normalized": true,
416
+ "rstrip": false,
417
+ "single_word": false,
418
+ "special": false
419
+ },
420
+ "65581": {
421
+ "content": "SPCT_50",
422
+ "lstrip": false,
423
+ "normalized": true,
424
+ "rstrip": false,
425
+ "single_word": false,
426
+ "special": false
427
+ },
428
+ "65582": {
429
+ "content": "SPCT_51",
430
+ "lstrip": false,
431
+ "normalized": true,
432
+ "rstrip": false,
433
+ "single_word": false,
434
+ "special": false
435
+ },
436
+ "65583": {
437
+ "content": "SPCT_52",
438
+ "lstrip": false,
439
+ "normalized": true,
440
+ "rstrip": false,
441
+ "single_word": false,
442
+ "special": false
443
+ },
444
+ "65584": {
445
+ "content": "SPCT_53",
446
+ "lstrip": false,
447
+ "normalized": true,
448
+ "rstrip": false,
449
+ "single_word": false,
450
+ "special": false
451
+ },
452
+ "65585": {
453
+ "content": "SPCT_54",
454
+ "lstrip": false,
455
+ "normalized": true,
456
+ "rstrip": false,
457
+ "single_word": false,
458
+ "special": false
459
+ },
460
+ "65586": {
461
+ "content": "SPCT_55",
462
+ "lstrip": false,
463
+ "normalized": true,
464
+ "rstrip": false,
465
+ "single_word": false,
466
+ "special": false
467
+ },
468
+ "65587": {
469
+ "content": "SPCT_56",
470
+ "lstrip": false,
471
+ "normalized": true,
472
+ "rstrip": false,
473
+ "single_word": false,
474
+ "special": false
475
+ },
476
+ "65588": {
477
+ "content": "SPCT_57",
478
+ "lstrip": false,
479
+ "normalized": true,
480
+ "rstrip": false,
481
+ "single_word": false,
482
+ "special": false
483
+ },
484
+ "65589": {
485
+ "content": "SPCT_58",
486
+ "lstrip": false,
487
+ "normalized": true,
488
+ "rstrip": false,
489
+ "single_word": false,
490
+ "special": false
491
+ },
492
+ "65590": {
493
+ "content": "SPCT_59",
494
+ "lstrip": false,
495
+ "normalized": true,
496
+ "rstrip": false,
497
+ "single_word": false,
498
+ "special": false
499
+ },
500
+ "65591": {
501
+ "content": "SPCT_60",
502
+ "lstrip": false,
503
+ "normalized": true,
504
+ "rstrip": false,
505
+ "single_word": false,
506
+ "special": false
507
+ },
508
+ "65592": {
509
+ "content": "SPCT_61",
510
+ "lstrip": false,
511
+ "normalized": true,
512
+ "rstrip": false,
513
+ "single_word": false,
514
+ "special": false
515
+ },
516
+ "65593": {
517
+ "content": "SPCT_62",
518
+ "lstrip": false,
519
+ "normalized": true,
520
+ "rstrip": false,
521
+ "single_word": false,
522
+ "special": false
523
+ },
524
+ "65594": {
525
+ "content": "SPCT_63",
526
+ "lstrip": false,
527
+ "normalized": true,
528
+ "rstrip": false,
529
+ "single_word": false,
530
+ "special": false
531
+ },
532
+ "65595": {
533
+ "content": "SPCT_64",
534
+ "lstrip": false,
535
+ "normalized": true,
536
+ "rstrip": false,
537
+ "single_word": false,
538
+ "special": false
539
+ },
540
+ "65596": {
541
+ "content": "SPCT_65",
542
+ "lstrip": false,
543
+ "normalized": true,
544
+ "rstrip": false,
545
+ "single_word": false,
546
+ "special": false
547
+ },
548
+ "65597": {
549
+ "content": "SPCT_66",
550
+ "lstrip": false,
551
+ "normalized": true,
552
+ "rstrip": false,
553
+ "single_word": false,
554
+ "special": false
555
+ },
556
+ "65598": {
557
+ "content": "SPCT_67",
558
+ "lstrip": false,
559
+ "normalized": true,
560
+ "rstrip": false,
561
+ "single_word": false,
562
+ "special": false
563
+ },
564
+ "65599": {
565
+ "content": "SPCT_68",
566
+ "lstrip": false,
567
+ "normalized": true,
568
+ "rstrip": false,
569
+ "single_word": false,
570
+ "special": false
571
+ },
572
+ "65600": {
573
+ "content": "SPCT_69",
574
+ "lstrip": false,
575
+ "normalized": true,
576
+ "rstrip": false,
577
+ "single_word": false,
578
+ "special": false
579
+ },
580
+ "65601": {
581
+ "content": "SPCT_70",
582
+ "lstrip": false,
583
+ "normalized": true,
584
+ "rstrip": false,
585
+ "single_word": false,
586
+ "special": false
587
+ },
588
+ "65602": {
589
+ "content": "SPCT_71",
590
+ "lstrip": false,
591
+ "normalized": true,
592
+ "rstrip": false,
593
+ "single_word": false,
594
+ "special": false
595
+ },
596
+ "65603": {
597
+ "content": "SPCT_72",
598
+ "lstrip": false,
599
+ "normalized": true,
600
+ "rstrip": false,
601
+ "single_word": false,
602
+ "special": false
603
+ },
604
+ "65604": {
605
+ "content": "SPCT_73",
606
+ "lstrip": false,
607
+ "normalized": true,
608
+ "rstrip": false,
609
+ "single_word": false,
610
+ "special": false
611
+ },
612
+ "65605": {
613
+ "content": "SPCT_74",
614
+ "lstrip": false,
615
+ "normalized": true,
616
+ "rstrip": false,
617
+ "single_word": false,
618
+ "special": false
619
+ },
620
+ "65606": {
621
+ "content": "SPCT_75",
622
+ "lstrip": false,
623
+ "normalized": true,
624
+ "rstrip": false,
625
+ "single_word": false,
626
+ "special": false
627
+ },
628
+ "65607": {
629
+ "content": "SPCT_76",
630
+ "lstrip": false,
631
+ "normalized": true,
632
+ "rstrip": false,
633
+ "single_word": false,
634
+ "special": false
635
+ },
636
+ "65608": {
637
+ "content": "SPCT_77",
638
+ "lstrip": false,
639
+ "normalized": true,
640
+ "rstrip": false,
641
+ "single_word": false,
642
+ "special": false
643
+ },
644
+ "65609": {
645
+ "content": "SPCT_78",
646
+ "lstrip": false,
647
+ "normalized": true,
648
+ "rstrip": false,
649
+ "single_word": false,
650
+ "special": false
651
+ },
652
+ "65610": {
653
+ "content": "SPCT_79",
654
+ "lstrip": false,
655
+ "normalized": true,
656
+ "rstrip": false,
657
+ "single_word": false,
658
+ "special": false
659
+ },
660
+ "65611": {
661
+ "content": "SPCT_80",
662
+ "lstrip": false,
663
+ "normalized": true,
664
+ "rstrip": false,
665
+ "single_word": false,
666
+ "special": false
667
+ },
668
+ "65612": {
669
+ "content": "SPCT_81",
670
+ "lstrip": false,
671
+ "normalized": true,
672
+ "rstrip": false,
673
+ "single_word": false,
674
+ "special": false
675
+ },
676
+ "65613": {
677
+ "content": "SPCT_82",
678
+ "lstrip": false,
679
+ "normalized": true,
680
+ "rstrip": false,
681
+ "single_word": false,
682
+ "special": false
683
+ },
684
+ "65614": {
685
+ "content": "SPCT_83",
686
+ "lstrip": false,
687
+ "normalized": true,
688
+ "rstrip": false,
689
+ "single_word": false,
690
+ "special": false
691
+ },
692
+ "65615": {
693
+ "content": "SPCT_84",
694
+ "lstrip": false,
695
+ "normalized": true,
696
+ "rstrip": false,
697
+ "single_word": false,
698
+ "special": false
699
+ },
700
+ "65616": {
701
+ "content": "SPCT_85",
702
+ "lstrip": false,
703
+ "normalized": true,
704
+ "rstrip": false,
705
+ "single_word": false,
706
+ "special": false
707
+ },
708
+ "65617": {
709
+ "content": "SPCT_86",
710
+ "lstrip": false,
711
+ "normalized": true,
712
+ "rstrip": false,
713
+ "single_word": false,
714
+ "special": false
715
+ },
716
+ "65618": {
717
+ "content": "SPCT_87",
718
+ "lstrip": false,
719
+ "normalized": true,
720
+ "rstrip": false,
721
+ "single_word": false,
722
+ "special": false
723
+ },
724
+ "65619": {
725
+ "content": "SPCT_88",
726
+ "lstrip": false,
727
+ "normalized": true,
728
+ "rstrip": false,
729
+ "single_word": false,
730
+ "special": false
731
+ },
732
+ "65620": {
733
+ "content": "SPCT_89",
734
+ "lstrip": false,
735
+ "normalized": true,
736
+ "rstrip": false,
737
+ "single_word": false,
738
+ "special": false
739
+ },
740
+ "65621": {
741
+ "content": "SPCT_90",
742
+ "lstrip": false,
743
+ "normalized": true,
744
+ "rstrip": false,
745
+ "single_word": false,
746
+ "special": false
747
+ },
748
+ "65622": {
749
+ "content": "SPCT_91",
750
+ "lstrip": false,
751
+ "normalized": true,
752
+ "rstrip": false,
753
+ "single_word": false,
754
+ "special": false
755
+ },
756
+ "65623": {
757
+ "content": "SPCT_92",
758
+ "lstrip": false,
759
+ "normalized": true,
760
+ "rstrip": false,
761
+ "single_word": false,
762
+ "special": false
763
+ },
764
+ "65624": {
765
+ "content": "SPCT_93",
766
+ "lstrip": false,
767
+ "normalized": true,
768
+ "rstrip": false,
769
+ "single_word": false,
770
+ "special": false
771
+ },
772
+ "65625": {
773
+ "content": "SPCT_94",
774
+ "lstrip": false,
775
+ "normalized": true,
776
+ "rstrip": false,
777
+ "single_word": false,
778
+ "special": false
779
+ },
780
+ "65626": {
781
+ "content": "SPCT_95",
782
+ "lstrip": false,
783
+ "normalized": true,
784
+ "rstrip": false,
785
+ "single_word": false,
786
+ "special": false
787
+ },
788
+ "65627": {
789
+ "content": "SPCT_96",
790
+ "lstrip": false,
791
+ "normalized": true,
792
+ "rstrip": false,
793
+ "single_word": false,
794
+ "special": false
795
+ },
796
+ "65628": {
797
+ "content": "SPCT_97",
798
+ "lstrip": false,
799
+ "normalized": true,
800
+ "rstrip": false,
801
+ "single_word": false,
802
+ "special": false
803
+ },
804
+ "65629": {
805
+ "content": "SPCT_98",
806
+ "lstrip": false,
807
+ "normalized": true,
808
+ "rstrip": false,
809
+ "single_word": false,
810
+ "special": false
811
+ },
812
+ "65630": {
813
+ "content": "SPCT_99",
814
+ "lstrip": false,
815
+ "normalized": true,
816
+ "rstrip": false,
817
+ "single_word": false,
818
+ "special": false
819
+ }
820
+ },
821
+ "auto_map": {
822
+ "AutoTokenizer": [
823
+ "hf_rwkv_tokenizer.RwkvTokenizer",
824
+ null
825
+ ]
826
+ },
827
+ "bos_token": "<|rwkv_tokenizer_end_of_text|>",
828
+ "clean_up_tokenization_spaces": false,
829
+ "eos_token": "\n\n",
830
+ "extra_special_tokens": {},
831
+ "model_max_length": 1000000000000000019884624838656,
832
+ "pad_token": "<|rwkv_tokenizer_end_of_text|>",
833
+ "tokenizer_class": "RwkvTokenizer",
834
+ "unk_token": "<|rwkv_tokenizer_end_of_text|>",
835
+ "use_fast": false
836
+ }
rwkv7-0.4B-g1-respark-voice-tunable/vocab.txt ADDED
The diff for this file is too large to render. See raw diff