TaiYouWeb commited on
Commit
51c71fc
·
verified ·
1 Parent(s): 5a12fa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -35,7 +35,7 @@ def synthesize_tts(
35
  language: str = 'ja',
36
  temperature: float = 0.65,
37
  length_penalty: float = 1.0,
38
- repetition_penalty: float = 2.0,
39
  top_k: int = 50,
40
  top_p: float = 0.8,
41
  speed: float = 1.0,
@@ -46,7 +46,8 @@ def synthesize_tts(
46
  if speaker_wavs:
47
  # Process each uploaded file
48
  for speaker_wav in speaker_wavs:
49
- speaker_wav_bytes = speaker_wav.read()
 
50
  # Convert the uploaded audio file to a WAV format using pydub
51
  try:
52
  audio = AudioSegment.from_file(io.BytesIO(speaker_wav_bytes))
 
35
  language: str = 'ja',
36
  temperature: float = 0.65,
37
  length_penalty: float = 1.0,
38
+ repetition_penalty: int = 2.0,
39
  top_k: int = 50,
40
  top_p: float = 0.8,
41
  speed: float = 1.0,
 
46
  if speaker_wavs:
47
  # Process each uploaded file
48
  for speaker_wav in speaker_wavs:
49
+ with open(speaker_wav.name, "rb") as f:
50
+ speaker_wav_bytes = f.read()
51
  # Convert the uploaded audio file to a WAV format using pydub
52
  try:
53
  audio = AudioSegment.from_file(io.BytesIO(speaker_wav_bytes))