ashishpatel26 / llm-finetuning Goto Github PK
View Code? Open in Web Editor NEWLLM Finetuning with peft
LLM Finetuning with peft
In the notebook from the title, the following line raises an error:
model = get_peft_model(model, peft_config)
The error is the following:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-20-2327ea630778>](https://localhost:8080/#) in <cell line: 1>()
----> 1 model = get_peft_model(model, peft_config)
2 model.print_trainable_parameters()
5 frames
[/usr/local/lib/python3.10/dist-packages/peft/tuners/tuners_utils.py](https://localhost:8080/#) in inject_adapter(self, model, adapter_name)
303
304 if not is_target_modules_in_base_model:
--> 305 raise ValueError(
306 f"Target modules {peft_config.target_modules} not found in the base model. "
307 f"Please check the target modules and try again."
ValueError: Target modules {'Wqkv', 'out_proj'} not found in the base model. Please check the target modules and try again.
OSError: bn22/Mistral-7B-Instruct-v0.1-sharded is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`
I run the fil 1. Efficiently_train_Large_Language_Models_with_LoRA_and_Hugging_Face.ipynb and in step "Now, we can prepare our model for the LoRA int-8 training using peft." I got following error. Can you tell me what's going on?
I am running on Google Colab and here is what I have:
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.105.17 Driver Version: 525.105.17 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... Off | 00000000:00:04.0 Off | 0 | | N/A 33C P0 52W / 400W | 18393MiB / 40960MiB | 0% Default | | | | Disabled |
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <cell line: 13>:13 │
│ │
│ /usr/local/lib/python3.10/dist-packages/peft/utils/other.py:72 in │
│ prepare_model_for_int8_training │
│ │
│ 69 │ │
│ 70 │ if hasattr(model, output_embedding_layer_name): │
│ 71 │ │ output_embedding_layer = getattr(model, output_embedding_layer_name) │
│ ❱ 72 │ │ input_dtype = output_embedding_layer.weight.dtype │
│ 73 │ │ │
│ 74 │ │ class CastOutputToFloat(torch.nn.Sequential): │
│ 75 │ │ │ r""" │
│ │
│ /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1614 in __getattr__ │
│ │
│ 1611 │ │ │ modules = self.__dict__['_modules'] │
│ 1612 │ │ │ if name in modules: │
│ 1613 │ │ │ │ return modules[name] │
│ ❱ 1614 │ │ raise AttributeError("'{}' object has no attribute '{}'".format( │
│ 1615 │ │ │ type(self).__name__, name)) │
│ 1616 │ │
│ 1617 │ def __setattr__(self, name: str, value: Union[Tensor, 'Module']) -> None: │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'CastOutputToFloat' object has no attribute 'weight'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.