File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ dependencies = [
3636 " addict" ,
3737 " wetext" ,
3838 " modelscope>=1.22.0" ,
39- " datasets>=2 ,<4" ,
39+ " datasets>=3 ,<4" ,
4040 " huggingface-hub" ,
4141 " pydantic" ,
4242 " tqdm" ,
Original file line number Diff line number Diff line change 11import torch
22import torchaudio
33import os
4+ import re
45import tempfile
56from huggingface_hub import snapshot_download
67from .model .voxcpm import VoxCPMModel
@@ -131,6 +132,7 @@ def generate(self,
131132 raise ValueError ("prompt_wav_path and prompt_text must both be provided or both be None" )
132133
133134 text = text .replace ("\n " , " " )
135+ text = re .sub (r'\s+' , ' ' , text )
134136 temp_prompt_wav_path = None
135137
136138 try :
Original file line number Diff line number Diff line change @@ -160,8 +160,8 @@ def optimize(self):
160160 self .feat_encoder_step = torch .compile (self .feat_encoder , mode = "reduce-overhead" , fullgraph = True )
161161 self .feat_decoder .estimator = torch .compile (self .feat_decoder .estimator , mode = "reduce-overhead" , fullgraph = True )
162162 except Exception as e :
163- print (e )
164- print ("VoxCPMModel can not be optimized by torch.compile, using original forward_step functions" )
163+ print (f"Error: { e } " )
164+ print ("Warning: VoxCPMModel can not be optimized by torch.compile, using original forward_step functions" )
165165 self .base_lm .forward_step = self .base_lm .forward_step
166166 self .residual_lm .forward_step = self .residual_lm .forward_step
167167 self .feat_encoder_step = self .feat_encoder
You can’t perform that action at this time.
0 commit comments