-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lora ckpt in HF format for NeMo AutoModel #11712
Merged
Merged
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
eae2eea
Save lora ckpt in safetensor and a config
oyilmaz-nvidia 99dc538
remove hf variable from peft
oyilmaz-nvidia 70bca02
vllm with automodel peft working
oyilmaz-nvidia 5540bb1
Apply isort and black reformatting
oyilmaz-nvidia 7bede6a
revert changes
oyilmaz-nvidia 035090e
update examples
oyilmaz-nvidia 11a370c
Fix a few minor issues
oyilmaz-nvidia d09c0af
Apply isort and black reformatting
oyilmaz-nvidia 895b284
resolve conflicts
oyilmaz-nvidia 49679a8
removed unused import
oyilmaz-nvidia 15d55e7
enable ckpt saving
oyilmaz-nvidia 6f68721
remove unused import
oyilmaz-nvidia 17afc4d
Apply isort and black reformatting
oyilmaz-nvidia 35609fd
Merge branch 'main' into onur/auto-model-peft-ckpt
oyilmaz-nvidia 9ee53a6
Merge branch 'main' into onur/auto-model-peft-ckpt
oyilmaz-nvidia 653ad7e
fix minor bug
oyilmaz-nvidia c9c7a09
Merge branch 'onur/auto-model-peft-ckpt' of https://github.com/NVIDIA…
oyilmaz-nvidia dd0bce1
Merge branch 'main' into onur/auto-model-peft-ckpt
oyilmaz-nvidia ff3eb44
fix circular import issue
oyilmaz-nvidia d0d9b74
Merge branch 'onur/auto-model-peft-ckpt' of https://github.com/NVIDIA…
oyilmaz-nvidia f57283d
Apply isort and black reformatting
oyilmaz-nvidia b0bfc67
Update cicd-main.yml
oyilmaz-nvidia da69286
Merge branch 'main' into onur/auto-model-peft-ckpt
oyilmaz-nvidia a18adab
fixing the datasource
oyilmaz-nvidia 29ee000
renaming to avoid import error
oyilmaz-nvidia dbd4e01
Update cicd-main.yml
oyilmaz-nvidia 8a47a7f
Merge branch 'main' into onur/auto-model-peft-ckpt
oyilmaz-nvidia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
try: | ||
from nemo.export.vllm_hf_exporter import vLLMHFExporter | ||
except Exception: | ||
raise Exception( | ||
"vLLM should be installed in the environment or import " | ||
"the vLLM environment in the NeMo FW container using " | ||
"source /opt/venv/bin/activate command" | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--model', required=True, type=str, help="Local path of the base model") | ||
parser.add_argument('--lora-model', required=True, type=str, help="Local path of the lora model") | ||
# parser.add_argument('--triton-model-name', required=True, type=str, help="Name for the service") | ||
args = parser.parse_args() | ||
|
||
lora_model_name = "lora_model" | ||
|
||
exporter = vLLMHFExporter() | ||
exporter.export(model=args.model, enable_lora=True) | ||
exporter.add_lora_models(lora_model_name=lora_model_name, lora_model=args.lora_model) | ||
|
||
print( | ||
"------------- Output: ", exporter.forward(input_texts=["How are you doing?"], lora_model_name=lora_model_name) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oyilmaz-nvidia thus still has --disable-ckpt