encodec
mindnlp.transformers.models.encodec.modeling_encodec
¶
PyTorch EnCodec model.
mindnlp.transformers.models.encodec.modeling_encodec.EncodecConv1d
¶
Bases: Module
Conv1d with asymmetric or causal padding and normalization.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecConvTranspose1d
¶
Bases: Module
ConvTranspose1d with asymmetric or causal padding and normalization.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecDecoder
¶
Bases: Module
SEANet decoder as used by EnCodec.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecDecoderOutput
dataclass
¶
Bases: ModelOutput
| PARAMETER | DESCRIPTION |
|---|---|
audio_values
|
Decoded audio values, obtained using the decoder part of Encodec.
TYPE:
|
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
67 68 69 70 71 72 73 74 75 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecEncoder
¶
Bases: Module
SEANet encoder as used by EnCodec.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecEncoderOutput
dataclass
¶
Bases: ModelOutput
| PARAMETER | DESCRIPTION |
|---|---|
audio_codes
|
Discret code embeddings computed using
TYPE:
|
audio_scales
|
Scaling factor for each
TYPE:
|
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
53 54 55 56 57 58 59 60 61 62 63 64 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecEuclideanCodebook
¶
Bases: Module
Codebook with Euclidean distance.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecLSTM
¶
Bases: Module
LSTM without worrying about the hidden state, nor the layout of the data. Expects input as convolutional layout.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecModel
¶
Bases: EncodecPreTrainedModel
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecModel.decode(audio_codes, audio_scales, padding_mask=None, return_dict=None)
¶
Decodes the given frames into an output audio waveform.
Note that the output might be a bit bigger than the input. In that case, any extra steps at the end can be trimmed.
| PARAMETER | DESCRIPTION |
|---|---|
audio_codes
|
Discret code embeddings computed using
TYPE:
|
audio_scales
|
Scaling factor for each
TYPE:
|
padding_mask
|
Padding mask used to pad the
TYPE:
|
return_dict
|
Whether or not to return a [
TYPE:
|
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecModel.encode(input_values, padding_mask=None, bandwidth=None, return_dict=None)
¶
Encodes the input audio waveform into discrete codes.
| PARAMETER | DESCRIPTION |
|---|---|
input_values
|
Float values of the input audio waveform.
TYPE:
|
padding_mask
|
Padding mask used to pad the
TYPE:
|
bandwidth
|
The target bandwidth. Must be one of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[Tuple[Tensor, Optional[Tensor]], EncodecEncoderOutput]
|
A list of frames containing the discrete encoded codes for the input audio waveform, along with rescaling |
Union[Tuple[Tensor, Optional[Tensor]], EncodecEncoderOutput]
|
factors for each chunk when |
Union[Tuple[Tensor, Optional[Tensor]], EncodecEncoderOutput]
|
|
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecModel.forward(input_values, padding_mask=None, bandwidth=None, audio_codes=None, audio_scales=None, return_dict=None)
¶
Examples:
>>> from datasets import load_dataset
>>> from transformers import AutoProcessor, EncodecModel
>>> dataset = load_dataset("hf-internal-testing/ashraq-esc50-1-dog-example")
>>> audio_sample = dataset["train"]["audio"][0]["array"]
>>> model_id = "facebook/encodec_24khz"
>>> model = EncodecModel.from_pretrained(model_id)
>>> processor = AutoProcessor.from_pretrained(model_id)
>>> inputs = processor(raw_audio=audio_sample, return_tensors="ms")
>>> outputs = model(**inputs)
>>> audio_codes = outputs.audio_codes
>>> audio_values = outputs.audio_values
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecOutput
dataclass
¶
Bases: ModelOutput
| PARAMETER | DESCRIPTION |
|---|---|
audio_codes
|
Discret code embeddings computed using
TYPE:
|
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
39 40 41 42 43 44 45 46 47 48 49 50 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecPreTrainedModel
¶
Bases: PreTrainedModel
An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecResidualVectorQuantizer
¶
Bases: Module
Residual Vector Quantizer.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecResidualVectorQuantizer.decode(codes)
¶
Decode the given codes to the quantized representation.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
427 428 429 430 431 432 433 434 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecResidualVectorQuantizer.encode(embeddings, bandwidth=None)
¶
Encode a given input tensor with the specified frame rate at the given bandwidth. The RVQ encode method sets the appropriate number of quantizers to use and returns indices for each quantizer.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecResidualVectorQuantizer.get_num_quantizers_for_bandwidth(bandwidth=None)
¶
Return num_quantizers based on specified target bandwidth.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
403 404 405 406 407 408 409 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecResnetBlock
¶
Bases: Module
Residual block from SEANet model as used by EnCodec.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
mindnlp.transformers.models.encodec.modeling_encodec.EncodecVectorQuantization
¶
Bases: Module
Vector quantization implementation. Currently supports only euclidean distance.
Source code in mindnlp\transformers\models\encodec\modeling_encodec.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | |
mindnlp.transformers.models.encodec.configuration_encodec
¶
Encodec Model config
mindnlp.transformers.models.encodec.configuration_encodec.EncodecConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of an [EncodecModel]. It is used to instantiate a
Encodec model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
facebook/encodec_24khz architecture.
Configuration objects inherit from [PretrainedConfig] and can be used to control the model outputs. Read the
documentation from [PretrainedConfig] for more information.
| PARAMETER | DESCRIPTION |
|---|---|
target_bandwidths
|
The range of diffent bandwiths the model can encode audio with.
TYPE:
|
sampling_rate
|
The sampling rate at which the audio waveform should be digitalized expressed in hertz (Hz).
TYPE:
|
audio_channels
|
Number of channels in the audio data. Either 1 for mono or 2 for stereo.
TYPE:
|
normalize
|
Whether the audio shall be normalized when passed.
TYPE:
|
chunk_length_s
|
If defined the audio is pre-processed into chunks of lengths
TYPE:
|
overlap
|
Defines the overlap between each chunk. It is used to compute the
TYPE:
|
hidden_size
|
Intermediate representation dimension.
TYPE:
|
num_filters
|
Number of convolution kernels of first
TYPE:
|
num_residual_layers
|
Number of residual layers.
TYPE:
|
upsampling_ratios
|
Kernel size and stride ratios. The encoder uses downsampling ratios instead of upsampling ratios, hence it will use the ratios in the reverse order to the ones specified here that must match the decoder order.
TYPE:
|
norm_type
|
Normalization method. Should be in
TYPE:
|
kernel_size
|
Kernel size for the initial convolution.
TYPE:
|
last_kernel_size
|
Kernel size for the last convolution layer.
TYPE:
|
residual_kernel_size
|
Kernel size for the residual layers.
TYPE:
|
dilation_growth_rate
|
How much to increase the dilation with each layer.
TYPE:
|
use_causal_conv
|
Whether to use fully causal convolution.
TYPE:
|
pad_mode
|
Padding mode for the convolutions.
TYPE:
|
compress
|
Reduced dimensionality in residual branches (from Demucs v3).
TYPE:
|
num_lstm_layers
|
Number of LSTM layers at the end of the encoder.
TYPE:
|
trim_right_ratio
|
Ratio for trimming at the right of the transposed convolution under the
TYPE:
|
codebook_size
|
Number of discret codes that make up VQVAE.
TYPE:
|
codebook_dim
|
Dimension of the codebook vectors. If not defined, uses
TYPE:
|
use_conv_shortcut
|
Whether to use a convolutional layer as the 'skip' connection in the
TYPE:
|
Example
>>> from transformers import EncodecModel, EncodecConfig
...
>>> # Initializing a "facebook/encodec_24khz" style configuration
>>> configuration = EncodecConfig()
...
>>> # Initializing a model (with random weights) from the "facebook/encodec_24khz" style configuration
>>> model = EncodecModel(configuration)
...
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in mindnlp\transformers\models\encodec\configuration_encodec.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
mindnlp.transformers.models.encodec.configuration_encodec.EncodecConfig.chunk_length: Optional[int]
property
¶
chunk_length
mindnlp.transformers.models.encodec.configuration_encodec.EncodecConfig.chunk_stride: Optional[int]
property
¶
chunk_stride
mindnlp.transformers.models.encodec.configuration_encodec.EncodecConfig.frame_rate: int
property
¶
frame_rate
mindnlp.transformers.models.encodec.configuration_encodec.EncodecConfig.num_quantizers: int
property
¶
num_quantizers
mindnlp.transformers.models.encodec.configuration_encodec.EncodecConfig.__init__(target_bandwidths=[1.5, 3.0, 6.0, 12.0, 24.0], sampling_rate=24000, audio_channels=1, normalize=False, chunk_length_s=None, overlap=None, hidden_size=128, num_filters=32, num_residual_layers=1, upsampling_ratios=[8, 5, 4, 2], norm_type='weight_norm', kernel_size=7, last_kernel_size=7, residual_kernel_size=3, dilation_growth_rate=2, use_causal_conv=True, pad_mode='reflect', compress=2, num_lstm_layers=2, trim_right_ratio=1.0, codebook_size=1024, codebook_dim=None, use_conv_shortcut=True, **kwargs)
¶
Initializes an instance of the EncodecConfig class.
| PARAMETER | DESCRIPTION |
|---|---|
self
|
The instance of the class.
|
target_bandwidths
|
List of target bandwidths in kHz. Default is [1.5, 3.0, 6.0, 12.0, 24.0].
TYPE:
|
sampling_rate
|
The audio sampling rate in Hz. Default is 24000.
TYPE:
|
audio_channels
|
The number of audio channels. Default is 1.
TYPE:
|
normalize
|
Flag indicating whether to normalize the audio. Default is False.
TYPE:
|
chunk_length_s
|
The length of audio chunks in seconds. Default is None.
TYPE:
|
overlap
|
The overlap ratio between audio chunks. Default is None.
TYPE:
|
hidden_size
|
The size of the hidden state in the model. Default is 128.
TYPE:
|
num_filters
|
The number of filters in the model. Default is 32.
TYPE:
|
num_residual_layers
|
The number of residual layers in the model. Default is 1.
TYPE:
|
upsampling_ratios
|
List of upsampling ratios. Default is [8, 5, 4, 2].
TYPE:
|
norm_type
|
The type of normalization. Must be either 'weight_norm' or 'time_group_norm'. Default is 'weight_norm'.
TYPE:
|
kernel_size
|
The size of the convolutional kernel. Default is 7.
TYPE:
|
last_kernel_size
|
The size of the last convolutional kernel. Default is 7.
TYPE:
|
residual_kernel_size
|
The size of the residual convolutional kernel. Default is 3.
TYPE:
|
dilation_growth_rate
|
The growth rate of dilation in the model. Default is 2.
TYPE:
|
use_causal_conv
|
Flag indicating whether to use causal convolution. Default is True.
TYPE:
|
pad_mode
|
The padding mode for convolution. Default is 'reflect'.
TYPE:
|
compress
|
The compression factor for audio. Default is 2.
TYPE:
|
num_lstm_layers
|
The number of LSTM layers in the model. Default is 2.
TYPE:
|
trim_right_ratio
|
The ratio of trimming audio from the right. Default is 1.0.
TYPE:
|
codebook_size
|
The size of the codebook. Default is 1024.
TYPE:
|
codebook_dim
|
The dimension of the codebook. Default is equal to hidden_size if not provided.
TYPE:
|
use_conv_shortcut
|
Flag indicating whether to use convolution shortcut. Default is True.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
None. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If norm_type is not 'weight_norm' or 'time_group_norm'. |
Source code in mindnlp\transformers\models\encodec\configuration_encodec.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
mindnlp.transformers.models.encodec.feature_extraction_encodec
¶
Feature extractor class for EnCodec.
mindnlp.transformers.models.encodec.feature_extraction_encodec.EncodecFeatureExtractor
¶
Bases: SequenceFeatureExtractor
Constructs an EnCodec feature extractor.
This feature extractor inherits from [~feature_extraction_sequence_utils.SequenceFeatureExtractor] which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.
Instantiating a feature extractor with the defaults will yield a similar configuration to that of the facebook/encodec_24khz architecture.
| PARAMETER | DESCRIPTION |
|---|---|
feature_size
|
The feature dimension of the extracted features. Use 1 for mono, 2 for stereo.
TYPE:
|
sampling_rate
|
The sampling rate at which the audio waveform should be digitalized expressed in hertz (Hz).
TYPE:
|
padding_value
|
The value that is used to fill the padding values.
TYPE:
|
chunk_length_s
|
If defined the audio is pre-processed into chunks of lengths
TYPE:
|
overlap
|
Defines the overlap between each chunk. It is used to compute the
TYPE:
|
Source code in mindnlp\transformers\models\encodec\feature_extraction_encodec.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
mindnlp.transformers.models.encodec.feature_extraction_encodec.EncodecFeatureExtractor.chunk_length: Optional[int]
property
¶
This is a property because you might want to change the chunk_length_s on the fly¶
mindnlp.transformers.models.encodec.feature_extraction_encodec.EncodecFeatureExtractor.chunk_stride: Optional[int]
property
¶
This is a property because you might want to change the chunk_length_s on the fly¶
mindnlp.transformers.models.encodec.feature_extraction_encodec.EncodecFeatureExtractor.__call__(raw_audio, padding=None, truncation=False, max_length=None, return_tensors=None, sampling_rate=None)
¶
Main method to featurize and prepare for the model one or several sequence(s).
| PARAMETER | DESCRIPTION |
|---|---|
raw_audio
|
The sequence or batch of sequences to be processed. Each sequence can be a numpy array, a list of float
values, a list of numpy arrays or a list of list of float values. The numpy array must be of shape
TYPE:
|
padding
|
Select a strategy to pad the returned sequences (according to the model's padding side and padding index) among:
TYPE:
|
truncation
|
Activates truncation to cut input sequences longer than
TYPE:
|
max_length
|
Maximum length of the returned list and optionally padding length (see above).
TYPE:
|
return_tensors
|
If set, will return tensors instead of list of python integers. Acceptable values are:
TYPE:
|
sampling_rate
|
The sampling rate at which the
TYPE:
|
Source code in mindnlp\transformers\models\encodec\feature_extraction_encodec.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
mindnlp.transformers.models.encodec.feature_extraction_encodec.EncodecFeatureExtractor.__init__(feature_size=1, sampling_rate=24000, padding_value=0.0, chunk_length_s=None, overlap=None, **kwargs)
¶
Initialize the EncodecFeatureExtractor class with the given parameters.
| PARAMETER | DESCRIPTION |
|---|---|
self
|
The instance of the class.
|
feature_size
|
The size of the feature. Default is 1.
TYPE:
|
sampling_rate
|
The sampling rate in Hz. Default is 24000.
TYPE:
|
padding_value
|
The value used for padding. Default is 0.0.
TYPE:
|
chunk_length_s
|
The length of each chunk in seconds. Default is None.
TYPE:
|
overlap
|
The overlap between chunks in seconds. Default is None.
TYPE:
|
**kwargs
|
Additional keyword arguments.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
|
None. |
Source code in mindnlp\transformers\models\encodec\feature_extraction_encodec.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |