Code Monkey home page Code Monkey logo

sillm-examples's Introduction

Examples for using SiLLM

Make sure to install the requirements for these examples:

pip install -r requirements-examples.txt

HelpSteer LoRA

LoRA training Mistral-7B-Instruct-v0.2 with the Nvidia HelpSteer dataset.

Run train.sh in the helpsteer directory to download the dataset & model from HuggingFace and start the LoRA training. You can customize the training configuration by editing config.yml.

DPO-Mix-7K

DPO training Qwen1.5-7B-Chat with the DPO Mix 7K dataset. The training consists of a supervised fine tuning (SFT) followed by direct preference optimization (DPO).

Run train.sh in the dpo-mix-7k directory to download the dataset & model from HuggingFace and start the training. You can customize the training configuration by editing the config files sft.yml and dpo.yml.

MMLU Benchmark

Implementation of the "Massive Multitask Language Understanding" benchmark using the MMLU dataset.

Run mmlu.py with the model you would like to evaluate.

MMLU-Pro Benchmark

Implementation of the MMLU-Pro benchmark using the MMLU-Pro dataset.

Run mmlu-pro.py with the model you would like to evaluate.

Perplexity

Calculating perplexity scores for a sample dataset of entry paragraphs from Wikipedia articles.

Run perplexity.py with the model you would like to evaluate. Add quantization options to evaluate perplexity with quantized models.

sillm-examples's People

Contributors

armbues avatar

Stargazers

Cyclotomic Fields avatar Anvar Azizov avatar  avatar Adeel Ahmad avatar Lau Van Kiet avatar Fred Bliss avatar

Watchers

 avatar Kostas Georgiou avatar

Forkers

fiditenemini

sillm-examples's Issues

train.sh in the helpsteer and DPO examples errs with AttributeError: 'Linear' object has no attribute 'name'

train.sh loads models correctly but then throws an AttributeError when the linear variable as no field 'name'. Below is for helpsteer example but encountered this on DPO as well. This is with sillm-mx 0.1.2 installed via pip.

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/opt/anaconda3/envs/llm/lib/python3.12/site-packages/sillm/lora.py", line 78, in
model.init_lora(**lora_config)
File "/opt/anaconda3/envs/llm/lib/python3.12/site-packages/sillm/training/lora.py", line 234, in init_lora
(key, LoRALinear.from_linear(module, rank=rank, alpha=alpha, dropout=dropout, scale=scale))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/llm/lib/python3.12/site-packages/sillm/training/lora.py", line 60, in from_linear
lora_lin.name = linear.name
^^^^^^^^^^^
File "/opt/anaconda3/envs/llm/lib/python3.12/site-packages/mlx/nn/layers/base.py", line 137, in getattr
super(Module, self).getattribute(key)
AttributeError: 'Linear' object has no attribute 'name'

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.