Skip to content

added model_kwargs to huggingface model#1417

Merged
adriangonz merged 7 commits into
SeldonIO:masterfrom
nanbo-liu:issue_1344
Oct 18, 2023
Merged

added model_kwargs to huggingface model#1417
adriangonz merged 7 commits into
SeldonIO:masterfrom
nanbo-liu:issue_1344

Conversation

@nanbo-liu

@nanbo-liu nanbo-liu commented Sep 27, 2023

Copy link
Copy Markdown
Contributor

This is for issue 1344
This allow model-settings.json to take model_kwargs:
example below:

{
    "name": "llama",
    "implementation": "mlserver_huggingface.HuggingFaceRuntime",
    "parameters": {
        "extra": {
            "task": "text-generation",
            "pretrained_model": "daryl149/llama-2-7b-hf",
            "model_kwargs": {
                "device_map": "auto",
                "load_in_8bit": true
            }
        }
    }
}

@nanbo-liu

Copy link
Copy Markdown
Contributor Author

@adriangonz ,could you review it when you have a chance

@adriangonz adriangonz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @nanbo-liu! This would be a great addition to the HF runtime - thanks for contributing it 🚀

Changes look good - although, could you add some tests to validate that the model kwargs get used? Once tests are in, we should be good to land this one. 👍

@nanbo-liu

Copy link
Copy Markdown
Contributor Author

@adriangonz ,added unit tests from the latest commit.

@adriangonz adriangonz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant! Thanks for the changes @nanbo-liu !

This should be good to go now 🚀

@nanbo-liu

nanbo-liu commented Oct 4, 2023

Copy link
Copy Markdown
Contributor Author

@adriangonz ,I rewrite the unit test a little bit. The previous version depends on package accelerate.
I don't want to introduce extra dependency into this repo. Would you take another look when you have a chance.
Need to rerun workflow

@nanbo-liu

Copy link
Copy Markdown
Contributor Author

@adriangonz, just fixed the unit test bug. would you try again

@nanbo-liu

nanbo-liu commented Oct 10, 2023

Copy link
Copy Markdown
Contributor Author

@adriangonz ,CICD keeps getting runtime error for catboost.
I see other PRs also got runtime error for catboost

@adriangonz

Copy link
Copy Markdown
Contributor

Yuuup, it seems there's an unrelated error in the catboost runtime causing some actions to fail. Which means this PR should be good to go as-is 👍

@adriangonz
adriangonz merged commit 02e95d1 into SeldonIO:master Oct 18, 2023
@nanbo-liu
nanbo-liu deleted the issue_1344 branch December 5, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants