improve readme
Browse files
README.md
CHANGED
@@ -51,38 +51,23 @@ gemma-2b-orpo performs well on Nous' benchmark suite (evaluation performed using
|
|
51 |
is a simplified version of [`argilla/dpo-mix-7k`](https://huggingface.co/datasets/argilla/dpo-mix-7k).
|
52 |
You can find more information [here](https://huggingface.co/alvarobartt/Mistral-7B-v0.1-ORPO#about-the-dataset).
|
53 |
|
54 |
-
## Model
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
- learning_rate: 5e-05
|
72 |
-
- train_batch_size: 2
|
73 |
-
- eval_batch_size: 8
|
74 |
-
- seed: 42
|
75 |
-
- gradient_accumulation_steps: 2
|
76 |
-
- total_train_batch_size: 4
|
77 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
78 |
-
- lr_scheduler_type: cosine
|
79 |
-
- lr_scheduler_warmup_ratio: 0.1
|
80 |
-
- lr_scheduler_warmup_steps: 100
|
81 |
-
- num_epochs: 3
|
82 |
-
|
83 |
-
### Training results
|
84 |
-
|
85 |
-
|
86 |
|
87 |
### Framework versions
|
88 |
|
|
|
51 |
is a simplified version of [`argilla/dpo-mix-7k`](https://huggingface.co/datasets/argilla/dpo-mix-7k).
|
52 |
You can find more information [here](https://huggingface.co/alvarobartt/Mistral-7B-v0.1-ORPO#about-the-dataset).
|
53 |
|
54 |
+
## ๐ฎ Model in action
|
55 |
+
### [๐ Examples: Chat and RAG using Haystack](./notebooks/usage.ipynb)
|
56 |
+
### Simple text generation with Transformers
|
57 |
+
The model is small, so runs smoothly on Colab. *It is also fine to load the model using quantization*.
|
58 |
+
```python
|
59 |
+
# pip install transformers accelerate
|
60 |
+
import torch
|
61 |
+
from transformers import pipeline
|
62 |
+
pipe = pipeline("text-generation", model="anakin87/gemma-2b-orpo", torch_dtype=torch.bfloat16, device_map="auto")
|
63 |
+
messages = [{"role": "user", "content": "Write a rap song on Vim vs VSCode."}]
|
64 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False)
|
65 |
+
outputs = pipe(prompt, max_new_tokens=500, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
66 |
+
print(outputs[0]["generated_text"])
|
67 |
+
```
|
68 |
+
## Training
|
69 |
+
The model was trained using HF TRL.
|
70 |
+
[๐ Training notebook](./notebooks/training.ipynb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
### Framework versions
|
73 |
|