Run this model with HF Jobs
Run alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca") model = AutoModelForCausalLM.from_pretrained("alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca
- SGLang
How to use alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca with Docker Model Runner:
docker model run hf.co/alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca
This is a model from blockchainlab test 2.4 which are merged - alnrg2arg/blockchainlabs_7B_merged_test2_4.
The project is running to make a small LLM for a on-device purpose.
Overall pipeline for this iteration is
1.Merging to make a base model (7B) 2.Prune the model to reduce the parameter (50% sparcity) 3.For recovery phase of the pruning, the DPO is chosen.
This model which is not pruned is intended to compare with the pruned model.
This is the code and parameters I chose for this model(DPO).
from transformers import TrainingArguments, AutoModelForCausalLM
from trl import DPOTrainer
dpo_trainer = DPOTrainer(
model = model,
ref_model = None,
args = TrainingArguments(
per_device_train_batch_size = 8,
gradient_accumulation_steps = 8,
warmup_ratio = 0.1,
num_train_epochs = 3,
learning_rate = 5e-6,
fp16 = not torch.cuda.is_bf16_supported(),
bf16 = torch.cuda.is_bf16_supported(),
logging_steps = 1,
optim = "adamw_8bit",
weight_decay = 0.0,
lr_scheduler_type = "linear",
seed = 42,
output_dir = "output_DPO",
),
beta = 0.1,
train_dataset = dataset,
# eval_dataset = raw_datasets["test"],
tokenizer = tokenizer,
max_length = 1024,
max_prompt_length = 512,
)
The code and parameters are borrowed from https://colab.research.google.com/drive/1SKrKGV-BZoU4kv5q3g0jtE_OhRgPtrrQ?usp=sharing
Benchmark scores
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | |
|---|---|---|---|---|---|---|---|
| winogrande | 1 | none | 5 | acc | 0.8248 | ± | 0.0107 |
- Downloads last month
- 12
Model tree for alnrg2arg/blockchainlabs_7B_merged_test2_4_sft_4bit_DPO_orca
Base model
alnrg2arg/blockchainlabs_7B_merged_test2_4