lglg666 commited on
Commit
c04851d
·
verified ·
1 Parent(s): 6d32e7f

Update VoxCPM/src/voxcpm/model/voxcpm.py

Browse files
Files changed (1) hide show
  1. VoxCPM/src/voxcpm/model/voxcpm.py +1 -17
VoxCPM/src/voxcpm/model/voxcpm.py CHANGED
@@ -385,23 +385,7 @@ class VoxCPMModel(nn.Module):
385
  if retry_badcase and streaming:
386
  warnings.warn("Retry on bad cases is not supported in streaming mode, setting retry_badcase=False.")
387
  retry_badcase = False
388
- if not target_text.strip() or not isinstance(target_text, str):
389
- raise ValueError("target text must be a non-empty string")
390
-
391
- if prompt_wav_path is not None:
392
- if not os.path.exists(prompt_wav_path):
393
- raise FileNotFoundError(f"prompt_wav_path does not exist: {prompt_wav_path}")
394
-
395
- if (prompt_wav_path is None) != (prompt_text is None):
396
- raise ValueError("prompt_wav_path and prompt_text must both be provided or both be None")
397
-
398
- target_text = target_text.replace("\n", " ")
399
- target_text = re.sub(r'\s+', ' ', target_text)
400
- if self.text_tokenizer is None:
401
- from ..utils.text_normalize import TextNormalizer
402
- self.text_tokenizer = TextNormalizer().tokenizer
403
- target_text = self.text_normalizer.normalize(target_text)
404
-
405
  if len(prompt_wav_path) == 0:
406
  text = target_text
407
  text_token = torch.LongTensor(self.text_tokenizer(text))
 
385
  if retry_badcase and streaming:
386
  warnings.warn("Retry on bad cases is not supported in streaming mode, setting retry_badcase=False.")
387
  retry_badcase = False
388
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  if len(prompt_wav_path) == 0:
390
  text = target_text
391
  text_token = torch.LongTensor(self.text_tokenizer(text))