uploaded readme
Browse files
README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Quantization made by Richard Erkhov.
|
| 2 |
+
|
| 3 |
+
[Github](https://github.com/RichardErkhov)
|
| 4 |
+
|
| 5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
| 6 |
+
|
| 7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
mistral-7b-sft-alpha - bnb 8bits
|
| 11 |
+
- Model creator: https://huggingface.co/HuggingFaceH4/
|
| 12 |
+
- Original model: https://huggingface.co/HuggingFaceH4/mistral-7b-sft-alpha/
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
Original model description:
|
| 18 |
+
---
|
| 19 |
+
license: mit
|
| 20 |
+
base_model: mistralai/Mistral-7B-v0.1
|
| 21 |
+
tags:
|
| 22 |
+
- generated_from_trainer
|
| 23 |
+
model-index:
|
| 24 |
+
- name: mistral-7b-sft-alpha
|
| 25 |
+
results: []
|
| 26 |
+
datasets:
|
| 27 |
+
- stingning/ultrachat
|
| 28 |
+
language:
|
| 29 |
+
- en
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 33 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 34 |
+
|
| 35 |
+
# Model Card for Mistral 7B SFT α
|
| 36 |
+
|
| 37 |
+
This model is a fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) on the UltraChat dataset.
|
| 38 |
+
|
| 39 |
+
It achieves the following results on the evaluation set:
|
| 40 |
+
- Loss: 0.9316
|
| 41 |
+
|
| 42 |
+
## Model description
|
| 43 |
+
|
| 44 |
+
- **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
| 45 |
+
- **Language(s) (NLP):** Primarily English
|
| 46 |
+
- **License:** MIT
|
| 47 |
+
- **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
| 48 |
+
|
| 49 |
+
### Model Sources
|
| 50 |
+
|
| 51 |
+
<!-- Provide the basic links for the model. -->
|
| 52 |
+
|
| 53 |
+
- **Repository:** https://github.com/huggingface/alignment-handbook
|
| 54 |
+
|
| 55 |
+
## Intended uses & limitations
|
| 56 |
+
|
| 57 |
+
The model was fine-tuned with [🤗 TRL's](https://github.com/huggingface/trl) `SFTTrainer` on a filtered and preprocessed of the [`UltraChat`](https://huggingface.co/datasets/stingning/ultrachat) dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT.
|
| 58 |
+
|
| 59 |
+
Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
|
| 60 |
+
|
| 61 |
+
```python
|
| 62 |
+
# Install transformers from source - only needed for versions <= v4.34
|
| 63 |
+
# pip install git+https://github.com/huggingface/transformers.git
|
| 64 |
+
# pip install accelerate
|
| 65 |
+
|
| 66 |
+
import torch
|
| 67 |
+
from transformers import pipeline
|
| 68 |
+
|
| 69 |
+
pipe = pipeline("text-generation", model="HuggingFaceH4/mistral-7b-sft-alpha", torch_dtype=torch.bfloat16, device_map="auto")
|
| 70 |
+
|
| 71 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
| 72 |
+
messages = [
|
| 73 |
+
{
|
| 74 |
+
"role": "system",
|
| 75 |
+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
|
| 76 |
+
},
|
| 77 |
+
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
|
| 78 |
+
]
|
| 79 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 80 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 81 |
+
print(outputs[0]["generated_text"])
|
| 82 |
+
# <|system|>
|
| 83 |
+
# You are a friendly chatbot who always responds in the style of a pirate.</s>
|
| 84 |
+
# <|user|>
|
| 85 |
+
# How many helicopters can a human eat in one sitting?</s>
|
| 86 |
+
# <|assistant|>
|
| 87 |
+
# Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
## Training procedure
|
| 91 |
+
|
| 92 |
+
### Training hyperparameters
|
| 93 |
+
|
| 94 |
+
The following hyperparameters were used during training:
|
| 95 |
+
- learning_rate: 2e-05
|
| 96 |
+
- train_batch_size: 8
|
| 97 |
+
- eval_batch_size: 16
|
| 98 |
+
- seed: 42
|
| 99 |
+
- distributed_type: multi-GPU
|
| 100 |
+
- num_devices: 16
|
| 101 |
+
- gradient_accumulation_steps: 4
|
| 102 |
+
- total_train_batch_size: 512
|
| 103 |
+
- total_eval_batch_size: 256
|
| 104 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 105 |
+
- lr_scheduler_type: cosine
|
| 106 |
+
- lr_scheduler_warmup_ratio: 0.1
|
| 107 |
+
- num_epochs: 1
|
| 108 |
+
|
| 109 |
+
### Training results
|
| 110 |
+
|
| 111 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
| 112 |
+
|:-------------:|:-----:|:----:|:---------------:|
|
| 113 |
+
| 0.9276 | 0.66 | 296 | 0.9315 |
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
### Framework versions
|
| 117 |
+
|
| 118 |
+
- Transformers 4.34.0
|
| 119 |
+
- Pytorch 2.0.1+cu118
|
| 120 |
+
- Datasets 2.12.0
|
| 121 |
+
- Tokenizers 0.14.0
|
| 122 |
+
|