Coder Social home page Coder Social logo

llm-finetuning's Issues

Error in 12_Fine_tuning_Microsoft_Phi_1_5b_on_custom_dataset(dialogstudio)

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.

can't find the model

"!autotrain llm --train --project_name mistral-7b-mj-finetuned --model bn22/Mistral-7B-Instruct-v0.1-sharded --data_path . --use_peft --use_int4 --learning_rate 2e-4 --train_batch_size 12 --num_train_epochs 3 --trainer sft --target_modules q_proj,v_proj --push_to_hub --repo_id ashishpatel26/mistral-7b-mj-finetuned"

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>`

Error in prepare model for training - AttributeError: 'CastOutputToFloat' object has no attribute 'weight'

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'

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.