Skip to content

Commit

Permalink
Merge pull request #190 from agwosdz/bug-cache_align_model
Browse files Browse the repository at this point in the history
"/" in whisper align model string get interpreted as path
  • Loading branch information
rakuri255 authored Dec 17, 2024
2 parents d2aa24e + e74c961 commit e9eba04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ contourpy==1.2.1
# via matplotlib
crepe==0.0.15
# via -r requirements.in
ctranslate2==4.3.1
ctranslate2==4.4.0
# via faster-whisper
cycler==0.12.1
# via matplotlib
Expand Down
4 changes: 3 additions & 1 deletion src/UltraSinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,10 @@ def CreateProcessAudio(process_data) -> str:
def transcribe_audio(cache_folder_path: str, processing_audio_path: str) -> TranscriptionResult:
"""Transcribe audio with AI"""
transcription_result = None
whisper_align_model_string = None
if settings.transcriber == "whisper":
transcription_config = f"{settings.transcriber}_{settings.whisper_model.value}_{settings.pytorch_device}_{settings.whisper_align_model}_{settings.whisper_align_model}_{settings.whisper_batch_size}_{settings.whisper_compute_type}_{settings.language}"
if not settings.whisper_align_model is None: whisper_align_model_string = settings.whisper_align_model.replace("/", "_")
transcription_config = f"{settings.transcriber}_{settings.whisper_model.value}_{settings.pytorch_device}_{whisper_align_model_string}_{settings.whisper_batch_size}_{settings.whisper_compute_type}_{settings.language}"
transcription_path = os.path.join(cache_folder_path, f"{transcription_config}.json")
cached_transcription_available = check_file_exists(transcription_path)
if settings.skip_cache_transcription or not cached_transcription_available:
Expand Down

0 comments on commit e9eba04

Please sign in to comment.