Merge pull request #2812 from lissyx/real-alphabet-path

Show actual alphabet path in error message
This commit is contained in:
lissyx 2020-03-06 10:58:03 +01:00 committed by GitHub
commit b52a4a96c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -33,9 +33,9 @@ class Alphabet(object):
return self._str_to_label[string] return self._str_to_label[string]
except KeyError as e: except KeyError as e:
raise KeyError( raise KeyError(
'ERROR: Your transcripts contain characters (e.g. \'{}\') which do not occur in data/alphabet.txt! Use ' \ 'ERROR: Your transcripts contain characters (e.g. \'{}\') which do not occur in \'{}\'! Use ' \
'util/check_characters.py to see what characters are in your [train,dev,test].csv transcripts, and ' \ 'util/check_characters.py to see what characters are in your [train,dev,test].csv transcripts, and ' \
'then add all these to data/alphabet.txt.'.format(string) 'then add all these to \'{}\'.'.format(string, self._config_file, self._config_file)
).with_traceback(e.__traceback__) ).with_traceback(e.__traceback__)
def has_char(self, char): def has_char(self, char):