Update README.md
Browse files
README.md
CHANGED
@@ -1,33 +1,74 @@
|
|
1 |
---
|
2 |
-
license:
|
3 |
base_model: mistralai/Mistral-7B-v0.1
|
4 |
tags:
|
5 |
- generated_from_trainer
|
6 |
model-index:
|
7 |
-
- name: mistral-7b-
|
8 |
results: []
|
|
|
|
|
|
|
|
|
9 |
---
|
10 |
|
11 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
12 |
should probably proofread and complete it, then remove this comment. -->
|
13 |
|
14 |
-
#
|
|
|
|
|
15 |
|
16 |
-
This model is a fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) on the HuggingFaceH4/ultrachat_uncensored dataset.
|
17 |
It achieves the following results on the evaluation set:
|
18 |
- Loss: 0.9316
|
19 |
|
20 |
## Model description
|
21 |
|
22 |
-
|
|
|
|
|
|
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
|
|
|
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
## Training procedure
|
33 |
|
@@ -60,4 +101,4 @@ The following hyperparameters were used during training:
|
|
60 |
- Transformers 4.34.0
|
61 |
- Pytorch 2.0.1+cu118
|
62 |
- Datasets 2.12.0
|
63 |
-
- Tokenizers 0.14.0
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
base_model: mistralai/Mistral-7B-v0.1
|
4 |
tags:
|
5 |
- generated_from_trainer
|
6 |
model-index:
|
7 |
+
- name: mistral-7b-sft-alpha
|
8 |
results: []
|
9 |
+
datasets:
|
10 |
+
- stingning/ultrachat
|
11 |
+
language:
|
12 |
+
- en
|
13 |
---
|
14 |
|
15 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
16 |
should probably proofread and complete it, then remove this comment. -->
|
17 |
|
18 |
+
# Model Card for Mistral 7B SFT α
|
19 |
+
|
20 |
+
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.
|
21 |
|
|
|
22 |
It achieves the following results on the evaluation set:
|
23 |
- Loss: 0.9316
|
24 |
|
25 |
## Model description
|
26 |
|
27 |
+
- **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
|
28 |
+
- **Language(s) (NLP):** Primarily English
|
29 |
+
- **License:** MIT
|
30 |
+
- **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
31 |
|
32 |
+
### Model Sources
|
33 |
|
34 |
+
<!-- Provide the basic links for the model. -->
|
35 |
|
36 |
+
- **Repository:** https://github.com/huggingface/alignment-handbook
|
37 |
+
|
38 |
+
## Intended uses & limitations
|
39 |
|
40 |
+
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.
|
41 |
+
|
42 |
+
Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
|
43 |
+
|
44 |
+
```python
|
45 |
+
# Install transformers from source - only needed for versions <= v4.34
|
46 |
+
# pip install git+https://github.com/huggingface/transformers.git
|
47 |
+
# pip install accelerate
|
48 |
+
|
49 |
+
import torch
|
50 |
+
from transformers import pipeline
|
51 |
+
|
52 |
+
pipe = pipeline("text-generation", model="HuggingFaceH4/mistral-7b-sft-alpha", torch_dtype=torch.bfloat16, device_map="auto")
|
53 |
+
|
54 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
55 |
+
messages = [
|
56 |
+
{
|
57 |
+
"role": "system",
|
58 |
+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
|
59 |
+
},
|
60 |
+
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
|
61 |
+
]
|
62 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
63 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
64 |
+
print(outputs[0]["generated_text"])
|
65 |
+
# <|system|>
|
66 |
+
# You are a friendly chatbot who always responds in the style of a pirate.</s>
|
67 |
+
# <|user|>
|
68 |
+
# How many helicopters can a human eat in one sitting?</s>
|
69 |
+
# <|assistant|>
|
70 |
+
# 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!
|
71 |
+
```
|
72 |
|
73 |
## Training procedure
|
74 |
|
|
|
101 |
- Transformers 4.34.0
|
102 |
- Pytorch 2.0.1+cu118
|
103 |
- Datasets 2.12.0
|
104 |
+
- Tokenizers 0.14.0
|