[quantization] Resolve bugs and warnings in example script#546
Merged
mhs4670go merged 1 commit intoSamsung:mainfrom Mar 10, 2026
Merged
[quantization] Resolve bugs and warnings in example script#546mhs4670go merged 1 commit intoSamsung:mainfrom
mhs4670go merged 1 commit intoSamsung:mainfrom
Conversation
This commit resolves bugs and warnings in example sciprts. TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
mhs4670go
commented
Mar 10, 2026
| from tico.utils.utils import SuppressWarning | ||
|
|
||
| name = "meta-llama/Llama-3.2-1B-Instruct" | ||
| name = "Maykeye/TinyLLama-v0" |
Contributor
Author
There was a problem hiding this comment.
I accidentally changed this part of code before.
| args.model, | ||
| trust_remote_code=args.trust_remote_code, | ||
| token=args.hf_token, | ||
| legacy=False, |
Contributor
Author
There was a problem hiding this comment.
This resolves following warning.
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 - if you loaded a llama tokenizer from a GGUF file you can ignore this message.
| AutoModelForCausalLM.from_pretrained( | ||
| args.model, | ||
| torch_dtype=dtype, | ||
| dtype=dtype, |
Contributor
Author
There was a problem hiding this comment.
This resolves following warning.
`torch_dtype` is deprecated! Use `dtype` instead!
| return {m: n for n, m in root.named_modules()} | ||
|
|
||
|
|
||
| def extract_tensor(output: Any) -> Optional[torch.Tensor]: |
Contributor
Author
There was a problem hiding this comment.
To extract tensors from transformers.modeling_outputs.BaseModelOutputWithPast.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit resolves bugs and warnings in example sciprts.
TICO-DCO-1.0-Signed-off-by: seongwoo mhs4670go@naver.com