Skip to content

Commit

Permalink
Update subgen.py
Browse files Browse the repository at this point in the history
Fixed removing failed items from the queue.
  • Loading branch information
McCloudS authored Feb 5, 2024
1 parent 52aa32e commit 4cb836b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subgen/subgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ def gen_subtitles(file_path: str, transcribe_or_translate_str: str, front=True)
elapsed_time = time.time() - start_time
minutes, seconds = divmod(int(elapsed_time), 60)
print(f"Transcription of {os.path.basename(file_path)} is completed, it took {minutes} minutes and {seconds} seconds to complete.")
files_to_transcribe.remove(file_path)
else:
print(f"File {os.path.basename(file_path)} is already in the transcription list. Skipping.")

except Exception as e:
print(f"Error processing or transcribing {file_path}: {e}")
finally:
files_to_transcribe.remove(file_path)
delete_model()

def has_subtitle_language(video_file, target_language):
Expand Down

0 comments on commit 4cb836b

Please sign in to comment.