Fix LM loading error
Fixes https://demo.arkindex.org/process/13d1c2ad-d7e0-4a6f-9ef5-0f86bccecbeb/0
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
1. torchaudio.flashlight_lib_text_dictionary.Dictionary()
2. torchaudio.flashlight_lib_text_dictionary.Dictionary(filename: str)
3. torchaudio.flashlight_lib_text_dictionary.Dictionary(tkns: List[str])
Invoked with: PosixPath('/data/current/tokens.txt')
The CTC loader, only used when the model needs a LM, expects either str
or List[str]
and doesn't like our PosixPath
instances here.
So for now I cast these to str
.