Raise error when alphabet and bytes_mode both specified
This commit is contained in:
parent
0389560a92
commit
6da7b5fc26
@ -104,7 +104,11 @@ class _SttConfig(Coqpit):
|
|||||||
if not self.available_devices:
|
if not self.available_devices:
|
||||||
self.available_devices = [self.cpu_device]
|
self.available_devices = [self.cpu_device]
|
||||||
|
|
||||||
if self.bytes_output_mode:
|
if self.bytes_output_mode and self.alphabet_config_path:
|
||||||
|
raise RuntimeError(
|
||||||
|
"You cannot set --alphabet_config_path *and* --bytes_output_mode"
|
||||||
|
)
|
||||||
|
elif self.bytes_output_mode:
|
||||||
self.alphabet = UTF8Alphabet()
|
self.alphabet = UTF8Alphabet()
|
||||||
elif self.alphabet_config_path:
|
elif self.alphabet_config_path:
|
||||||
self.alphabet = Alphabet(os.path.abspath(self.alphabet_config_path))
|
self.alphabet = Alphabet(os.path.abspath(self.alphabet_config_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user