Giter Site home page Giter Site logo

Comments (8)

kratorado avatar kratorado commented on June 1, 2024 1

My friends,how to fix it ?

insert the code, at the line 106 of the file vllm/config. before self.hf_config = get_config(self.model, trust_remote_code, revision, code_revision)

        if VLLM_USE_MODELSCOPE:
            from modelscope.hub.snapshot_download import snapshot_download

            if not os.path.exists(model):
                model_path = snapshot_download(model_id=model,
                                               revision=revision)
            else:
                model_path = model
            self.model = model_path
            self.download_dir = model_path
            self.tokenizer = model_path

Remember it is not the best way, just a temp workaround.

from vllm.

simon-mo avatar simon-mo commented on June 1, 2024

sorry why would it never work? if the env var is set VLLM_USE_MODELSCOPE=true then the statement would evaluate to true?

from vllm.

kratorado avatar kratorado commented on June 1, 2024

sorry why would it never work? if the env var is set VLLM_USE_MODELSCOPE=true then the statement would evaluate to true?

ah, I reread the code and found that I made a wrong debugging result.
Actually what I met is that when I run docker image vllm/vllm-openai:v0.4.1 , passing env with --env "VLLM_USE_MODELSCOPE=True" , vllm still visits huggingface.co to download models. It seems that vllm doesnot take this env var into account.

from vllm.

kratorado avatar kratorado commented on June 1, 2024

My temp workaround is adding the origin snippet to vllm/config.py line 106:

...
        if VLLM_USE_MODELSCOPE:
            # download model from ModelScope hub,
            # lazy import so that modelscope is not required for normal use.
            # pylint: disable=C.
            from modelscope.hub.snapshot_download import snapshot_download

            if not os.path.exists(model):
                model_path = snapshot_download(model_id=model, revision=revision)
            else:
                model_path = model
...

from vllm.

simon-mo avatar simon-mo commented on June 1, 2024

can you send a PR for what worked for you?

from vllm.

kratorado avatar kratorado commented on June 1, 2024

Sending a PR is easy. But my workaround is reverting some changes of a refactor which I think is the cause, I have to read the whole refactored code to confirm what to do is best.
related PR #4097

from vllm.

kratorado avatar kratorado commented on June 1, 2024

vllm/config.py , line 107

self.hf_config = get_config(self.model, trust_remote_code, revision,
                                    code_revision)

calls vllm/transformers_utils/config.py , line 23,

        config = AutoConfig.from_pretrained(
            model,
            trust_remote_code=trust_remote_code,
            revision=revision,
            code_revision=code_revision)

The code above does not check the environment variable VLLM_USE_MODELSCOPE and it will download config file from huggingface.co by default.

Have no clue how to fix it elegantly now.

from vllm.

dashi6174 avatar dashi6174 commented on June 1, 2024

My friends,how to fix it ?

from vllm.

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.