Update voice_processing.py
Browse files- voice_processing.py +2 -0
voice_processing.py
CHANGED
@@ -114,6 +114,7 @@ def process_audio(model, audio_file, logger, index_rate=0, use_uploaded_voice=Tr
|
|
114 |
# Process through model
|
115 |
with torch.no_grad():
|
116 |
# Prepare required arguments for model.infer()
|
|
|
117 |
phone_lengths = torch.LongTensor([len(input_tensor)]).to(input_tensor.device)
|
118 |
pitch = torch.zeros(1, len(input_tensor)).to(input_tensor.device) # Default pitch
|
119 |
nsff0 = torch.zeros_like(pitch).to(input_tensor.device)
|
@@ -121,6 +122,7 @@ def process_audio(model, audio_file, logger, index_rate=0, use_uploaded_voice=Tr
|
|
121 |
|
122 |
# Call infer with all required arguments
|
123 |
output = model.infer(
|
|
|
124 |
phone_lengths=phone_lengths,
|
125 |
pitch=pitch,
|
126 |
nsff0=nsff0,
|
|
|
114 |
# Process through model
|
115 |
with torch.no_grad():
|
116 |
# Prepare required arguments for model.infer()
|
117 |
+
phone = input_tensor.unsqueeze(0) # Add batch dimension [1, sequence_length]
|
118 |
phone_lengths = torch.LongTensor([len(input_tensor)]).to(input_tensor.device)
|
119 |
pitch = torch.zeros(1, len(input_tensor)).to(input_tensor.device) # Default pitch
|
120 |
nsff0 = torch.zeros_like(pitch).to(input_tensor.device)
|
|
|
122 |
|
123 |
# Call infer with all required arguments
|
124 |
output = model.infer(
|
125 |
+
phone=phone,
|
126 |
phone_lengths=phone_lengths,
|
127 |
pitch=pitch,
|
128 |
nsff0=nsff0,
|