Giter Club home page Giter Club logo

Comments (5)

nreimers avatar nreimers commented on July 30, 2024

When you start the docker, you must set the env. variable EASYNMT_MODEL to control which model to load:
https://github.com/UKPLab/EasyNMT/tree/main/docker#environment-variables

So pass to docker that the env. variable EASYNMT_MODEL should be e.g. the M2M model and then the docker will load this specific model

from easynmt.

4quen avatar 4quen commented on July 30, 2024

Hi,

ok, so it's not possible to load multiple models in the same container, right?

Best regards,
André

from easynmt.

nreimers avatar nreimers commented on July 30, 2024

No, that is not possible.

You can start multiple docker containers. The overhead is quite small compared to the model size.

from easynmt.

4quen avatar 4quen commented on July 30, 2024

Hi, ok thanks for the quick help and response!

from easynmt.

grantmk avatar grantmk commented on July 30, 2024

@4quen I ran into the same issue. Instead of docker I went straight to Python and servered it all with fastapi, uvicorn and Nginx reverse proxy. I load the models in a list on startup then select the model I need depending on language pair:

all_models = [
  Model(source_lang="en", target_lang="de", model=EasyNMT(translator=models.AutoModel('Helsinki-NLP/opus-mt-en-de'),device="cpu")),
  Model(source_lang="de", target_lang="en", model=EasyNMT(translator=models.AutoModel('Helsinki-NLP/opus-mt-de-en'),device="cpu"))
]

You need enough GPU/RAM to do this but also has the bonus of giving you control over the language codes and over the Huggingface model names. For example the Portuguese opus-mt model has "tc-big" inserted in the name, or Japanese is not "jp" but "jap". Those can cause the autoloader to fail miserably!

from easynmt.

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.