jishengpeng / Languagecodec

Language-Codec: Reducing the Gaps Between Discrete Codec Representation and Speech Language Models
MIT License
209 stars 16 forks source link

Batch inference #9

Closed anhnh2002 closed 2 months ago

anhnh2002 commented 2 months ago

How can i preprocess inputs (eg: padding) for batch inference?

jishengpeng commented 2 months ago

How can i preprocess inputs (eg: padding) for batch inference?

The current code framework does not support batch reasoning because the training process is randomly selected for one second. You can split the inference data set or try to multi-process to achieve the goal of multiple batches in the inference

anhnh2002 commented 2 months ago

How can i preprocess inputs (eg: padding) for batch inference?

The current code framework does not support batch reasoning because the training process is randomly selected for one second. You can split the inference data set or try to multi-process to achieve the goal of multiple batches in the inference

Can I adjust the code for batch inference (e.g., padding the input, then truncating codes using a padding mask)? If so, how can I do it?

jishengpeng commented 2 months ago

How can i preprocess inputs (eg: padding) for batch inference?

The current code framework does not support batch reasoning because the training process is randomly selected for one second. You can split the inference data set or try to multi-process to achieve the goal of multiple batches in the inference

Can I adjust the code for batch inference (e.g., padding the input, then truncating codes using a padding mask)? If so, how can I do it?

You can add padding when inference, but you must record the corresponding mask position, and make sure that each neural network module during inference only deals with the non-zero part of the audio