Views
No views yet
mistralai/Mistral-7B-v0.1| Parameters | Hidden Size | Layers | Vocab Size | Sequence Length |
|---|---|---|---|---|
| 7B | 4096 | 32 | 32000 | 2048 |
bfloat16 |
| Optimizer | AdamW |
| Learning rate | 3e-5 |
| LR cooldown end | 1e-5 |
| Warmup steps | 1000 |
| Batch size | 2M |
| QK norm | False |pip install git+https://github.com/tri-ml/linear_open_lm.gitfrom open_lm.open_lm_hf import *AutoTokenizer and AutoModelForCausalLM as follows:1from open_lm.open_lm_hf import *
2from transformers import AutoTokenizer, AutoModelForCausalLM
3tokenizer = AutoTokenizer.from_pretrained("tri-ml/mistral-supra")
4model = AutoModelForCausalLM.from_pretrained("tri-ml/mistral-supra")
5
6inputs = tokenizer(["Machine learning is"], return_tensors="pt")
7gen_kwargs = {"max_new_tokens": 50, "top_p": 0.8, "temperature": 0.8, "do_sample": True, "repetition_penalty": 1.1}
8output = model.generate(inputs['input_ids'], **gen_kwargs)
9output = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
10print(output)
11# Machine learning is a branch of artificial intelligence (AI) that enables computers to learn from experience without being explicitly programmed. Machine learning is used in a wide range of applications, including spam filtering, image recognition, speech recognition, and computer-based medical diagnosisuse_cache is set to False for model.generate(...), then it will use parallel mode; otherwise, it will use recurrent mode.
The recurrent model uses xformers and requires the inputs and models to be loaded to GPU.1# Recurrent mode
2output = model.to('cuda').generate(inputs['input_ids'].to('cuda'), use_cache=True, **gen_kwargs)
3
4# Parallel mode
5output = model.to('cuda').generate(inputs['input_ids'].to('cuda'), use_cache=False, **gen_kwargs)| HellaSwag | PIQA | Winogrande | ARC-E | ARC-C | MMLU (5-shot) | |
|---|---|---|---|---|---|---|
| Llama2-7B | 76.0 | 79.1 | 69.1 | 76.3 | 46.3 | 45.9 |
| Gemma-7B | 80.7 | 81.9 | 73.7 | 81.1 | 53.2 | 62.9 |
| Mistral-7B | 81.0 | 82.1 | 74.0 | 80.9 | 53.8 | 62.4 |
| RWKV5-1.7T-7B | 73.0 | 78.6 | 72.9 | 75.8 | 45.6 | 34.9 |
| Mamba-7B | 77.9 | 81.0 | 71.8 | 77.5 | 46.7 | 33.3 |
| Mistral-SUPRA | 77.1 | 80.4 | 70.3 | 75.9 | 45.8 | 34.2 |
@article{Mercat2024Linearizing,
title={Linearizing Large Language Models},
author={Jean Mercat and Igor Vasiljevic and Sedrick Keh and Kushal Arora and Achal Dave and Adrien Gaidon and Thomas Kollar},
year={2024},
journal={arXiv preprint arXiv:2405.06640},
}@misc{open_lm,
author = {Gururangan, Suchin and Wortsman, Mitchell and Gadre, Samir Yitzhak and Dave, Achal and Kilian, Maciej and Shi, Weijia and Mercat, Jean and Smyrnis, Georgios and Ilharco, Gabriel and Jordan, Matt and Heckel, Reinhard and Dimakis, Alex and Farhadi, Ali and Shankar, Vaishaal and Schmidt, Ludwig},
title = {{open_lm}: a minimal but performative language modeling (LM) repository},
year = {2023},
note = {GitHub repository},
url = {https://github.com/mlfoundations/open_lm/}
}