Skip to content

Commit

Permalink
dont sample audio unless needed
Browse files Browse the repository at this point in the history
  • Loading branch information
cuuupid committed Feb 11, 2025
1 parent 84fd78a commit f2f5920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def setup(self, weights: Optional[Path] = None):
self.speaker_embedding = None

def predict(self, text: str = Input(description="Text to speak!"), audio: Path = Input(description="(Optional) Audio with voice to mimic", default=None)) -> Path:
wav, sampling_rate = torchaudio.load(audio)
if self.speaker_embedding is None:
wav, sampling_rate = torchaudio.load(audio)
spk_embedding = self.model.make_speaker_embedding(wav, sampling_rate)
else:
spk_embedding = self.speaker_embedding
Expand Down

0 comments on commit f2f5920

Please sign in to comment.