Spaces:
Sleeping
Sleeping
Update Milestone5API.py
Browse files- Milestone5API.py +1 -1
Milestone5API.py
CHANGED
|
@@ -20,7 +20,7 @@ def replace_video_audio(video_file_path, new_audio_file_path, output_video_file_
|
|
| 20 |
|
| 21 |
video.write_videofile(output_video_file_path, codec="libx264", audio_codec="aac", temp_audiofile='temp_audio.mp3', remove_temp=True)
|
| 22 |
def text_to_speech(translated_text, video_path):
|
| 23 |
-
device = "cuda" if torch.cuda.is_available() else "
|
| 24 |
tts = TTS("tts_models/fr/mai/tacotron2-DDC").to(device)
|
| 25 |
text_files_dir = f'CS370_Milestone5/captions/{translated_text}'
|
| 26 |
output_audio_dir = 'CS370_Milestone5/audio'
|
|
|
|
| 20 |
|
| 21 |
video.write_videofile(output_video_file_path, codec="libx264", audio_codec="aac", temp_audiofile='temp_audio.mp3', remove_temp=True)
|
| 22 |
def text_to_speech(translated_text, video_path):
|
| 23 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 24 |
tts = TTS("tts_models/fr/mai/tacotron2-DDC").to(device)
|
| 25 |
text_files_dir = f'CS370_Milestone5/captions/{translated_text}'
|
| 26 |
output_audio_dir = 'CS370_Milestone5/audio'
|