GithubHelp home page GithubHelp logo

Comments (3)

grassroadsZ avatar grassroadsZ commented on June 24, 2024 4

`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

from manga-image-translator.

AI-confused avatar AI-confused commented on June 24, 2024

List[str] modify to List
this can work

from manga-image-translator.

starise-wg avatar starise-wg commented on June 24, 2024

May I ask if this problem has been resolved? I also encountered the same error,
微信截图_20240612153225 - 副本
微信截图_20240612153324

from manga-image-translator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.