Open Tianci-King opened 6 months ago
`from typing import List
async def _infer(self, from_lang: str, to_lang: str, queries: List[str]) -> List[str]: if from_lang == 'auto': detected_lang = langid.classify('\n'.join(queries))[0] target_lang = self._map_detected_lang_to_translator(detected_lang)
if target_lang == None:
self.logger.warn('Could not detect language from over all sentence. Will try per sentence.')
else:
from_lang = target_lang
return [self._translate_sentence(from_lang, to_lang, query) for query in queries]
` this code can work
List[str] modify to List this can work
May I ask if this problem has been resolved? I also encountered the same error,
Issue
I've gone through the installation steps for dependencies as outlined in your readme document, yet I'm facing the issue
about "TypeError: 'type' object is not subscriptable" . I had installed all the requires , but it did not worked. My python version is 3.8.13. I would greatly appreciate your assistance !