Git Product home page Git Product logo

sar-llm's Introduction

SAR-LLM

Code: https://github.com/LiqunMa/SAR-LLM

How to finetuning LLMs with soft targets

Requirements

accelerate==0.29.3

datasets==2.19.0

lm_eval==0.4.2

tokenizers==0.19.1

torch==2.2.2

transformers==4.40.0

wandb==0.16.2

vllm==0.3.2

Download data

  1. Alpaca: https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json. Please save in finetuning_data/.
  2. RedPajama-Data-1T-Sample: https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T-Sample. Please save in finetuning_data/Redpajama-Sample.

Preprocess data

To get the tokenized data for calculate the n-gram distribution:

python preprocess_data.py

Calculate the n-gram distribution

python n_gram.py

Finetuning model

Please adjust the specific configuration parameters based on your Slurm setup:

sbatch sbatch.sh

Eval downstream task

bash eval_vllm.sh

Eval PPL

bash eval_ppl.sh

AlpacaEval

Get the output of the AlpacaEval dataset:

bash alpaca_eval_output.sh

Get the win rate:

alpaca_eval.sh

For more information, please refer to AlpacaEval.

sar-llm's People

Contributors

liqunma avatar

Watchers

 avatar

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.