Clarify --translate vs --enable_translation CLI flags

- --translate: Whisper built-in to-English translation (task=translate)
- --enable_translation: M2M100 any-to-any translation backend
- Added warning when both flags are used simultaneously
- Updated help text to distinguish the two features
This commit is contained in:
Aaron Boxer
2026-04-17 09:31:38 -04:00
parent 9a71a95ca8
commit b534f9d249
+9 -2
View File
@@ -33,7 +33,8 @@ if __name__ == '__main__':
help='Language code for transcription, e.g., "en" for English.')
parser.add_argument('--translate', '-t',
action='store_true',
help='Enable translation of the transcription output.')
help='Use Whisper built-in translation to English (sets task=translate). '
'For any-to-any translation, use --enable_translation instead.')
parser.add_argument('--mute_audio_playback', '-a',
action='store_true',
help='Mute audio playback during transcription.')
@@ -42,7 +43,7 @@ if __name__ == '__main__':
help='Save the output recording, only used for microphone input.')
parser.add_argument('--enable_translation',
action='store_true',
help='Enable translation of the transcription output.')
help='Enable any-to-any translation via M2M100 model (separate from Whisper --translate).')
parser.add_argument('--target_language', '-tl',
type=str,
default='fr',
@@ -57,6 +58,12 @@ if __name__ == '__main__':
args = parser.parse_args()
if args.translate and args.enable_translation:
print("[WARN]: Both --translate and --enable_translation are set. "
"--translate uses Whisper's built-in to-English translation, "
"while --enable_translation uses M2M100 for any-to-any. "
"Both will be active.")
client = TranscriptionClient(
args.server,
args.port,