Run this model with HF Jobs
Run BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny 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/BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny. 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/BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny 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/BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny") model = AutoModelForCausalLM.from_pretrained("BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny
- SGLang
How to use BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny 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 "BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny with Docker Model Runner:
docker model run hf.co/BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny")
model = AutoModelForCausalLM.from_pretrained("BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny", device_map="auto")llama2-13b-ft-mc4_nl_cleaned_tiny
This model is a fine-tuned version of meta-llama/Llama-2-13b-hf
on the yhavinga/mc4_nl_cleaned dataset (tiny partition) on a context of 4096 tokens.
See the original meta-llama/Llama-2-13b-hf for more information, intended use, and biases.
If you use this model or refer to it, please use the following citation:
Vanroy, B. (2023). Language Resources for Dutch Large Language Modelling. https://arxiv.org/abs/2312.12852
@article{vanroy2023language,
title={Language Resources for {Dutch} Large Language Modelling},
author={Vanroy, Bram},
journal={arXiv preprint arXiv:2312.12852},
year={2023}
}
Intended uses & limitations
While Llama 2 already contains some proficiency in Dutch, this finetune is intended to improve the fluency of Dutch (not increase its knowledge). It is therefore intended as a generative model for Dutch language. The biases, shortcomings and intended uses are otherwise the same as those of the original model. The model can be used for generative tasks or finetuned further on other tasks such as summarization, adaptation, instruction or chat finetuning.
Training and evaluation data
Trained on the yhavinga/mc4_nl_cleaned dataset (tiny partition) for one epoch. The canonical
validation split was not used but instead 5% of train was used as validation.
Training procedure
Trained with LoRA targetting ["q_proj", "v_proj"] in 4 bit and merged before upload. Trained with Flash Attention as borrowed from
here.
The adapters are in the adapters branch.
Initial training investigation on the Tier-1 HPC of Vlaams Supercomputer Centrum (VSC) and training on our own server of 4x 3090s.
Training hyperparameters
The following hyperparameters were used during training in the HPC investigation:
- learning_rate: 0.0003
- train_batch_size: 12
- eval_batch_size: 12
- seed: 42
- distributed_type: multi-GPU
- num_devices: 16
- gradient_accumulation_steps: 6
- total_train_batch_size: 1152
- total_eval_batch_size: 192
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.03
- num_epochs: 1
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.8784 | 0.09 | 90 | 1.8820 |
| 1.8344 | 0.19 | 180 | 1.8542 |
| 1.8351 | 0.28 | 270 | 1.8355 |
| 1.8206 | 0.37 | 360 | 1.8212 |
| 1.8021 | 0.47 | 450 | 1.8088 |
| 1.8102 | 0.56 | 540 | 1.7982 |
| 1.7991 | 0.65 | 630 | 1.7890 |
| 1.7788 | 0.74 | 720 | 1.7811 |
| 1.7915 | 0.84 | 810 | 1.7742 |
| 1.7715 | 0.93 | 900 | 1.7676 |
Framework versions
- Transformers 4.31.0.dev0
- Pytorch 2.0.1+cu117
- Datasets 2.13.1
- Tokenizers 0.13.3
Open LLM Leaderboard Evaluation Results
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 46.81 |
| ARC (25-shot) | 59.3 |
| HellaSwag (10-shot) | 82.04 |
| MMLU (5-shot) | 54.67 |
| TruthfulQA (0-shot) | 38.03 |
| Winogrande (5-shot) | 77.27 |
| GSM8K (5-shot) | 10.31 |
| DROP (3-shot) | 6.08 |
- Downloads last month
- 45
Model tree for BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny
Base model
meta-llama/Llama-2-13b-hf
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BramVanroy/llama2-13b-ft-mc4_nl_cleaned_tiny")