Update README.md
Browse files
README.md
CHANGED
@@ -61,21 +61,21 @@ Here's how you can run the model using the `pipeline()` function from 🤗 Trans
|
|
61 |
import torch
|
62 |
from transformers import pipeline
|
63 |
|
64 |
-
pipe = pipeline(
|
65 |
|
66 |
-
# We use the tokenizer
|
67 |
messages = [
|
68 |
-
{
|
69 |
]
|
70 |
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
71 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
|
72 |
-
print(outputs[0][
|
73 |
-
# <|
|
74 |
-
#
|
75 |
-
#
|
76 |
-
#
|
77 |
-
# <|assistant
|
78 |
-
#
|
79 |
```
|
80 |
|
81 |
|
@@ -125,18 +125,17 @@ Write sth about Axolotl.
|
|
125 |
|
126 |
The following hyperparameters were used during training:
|
127 |
|
128 |
-
learning_rate:
|
129 |
-
train_batch_size: 2
|
130 |
-
eval_batch_size: 4
|
131 |
seed: 42
|
132 |
distributed_type: multi-GPU
|
133 |
-
num_devices:
|
134 |
-
total_train_batch_size:
|
135 |
-
total_eval_batch_size: 64
|
136 |
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
137 |
-
lr_scheduler_type:
|
138 |
-
|
139 |
-
|
|
|
|
|
140 |
|
141 |
## Citation
|
142 |
|
|
|
61 |
import torch
|
62 |
from transformers import pipeline
|
63 |
|
64 |
+
pipe = pipeline(“text-generation”, model=“Unbabel/TowerInstruct-v0.1", torch_dtype=torch.bfloat16, device_map=“cuda:3”)
|
65 |
|
66 |
+
# We use the tokenizer’s chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
67 |
messages = [
|
68 |
+
{“role”: “user”, “content”: “Translate the following text from Portuguese into English.\nPortuguese: Um grupo de investigadores lançou um novo modelo para tarefas relacionadas com tradução.\nEnglish:“},
|
69 |
]
|
70 |
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
71 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
|
72 |
+
print(outputs[0][“generated_text”])
|
73 |
+
# <|im_start|>user
|
74 |
+
# Translate the following text from Portuguese into English.
|
75 |
+
# Portuguese: Um grupo de investigadores lançou um novo modelo para tarefas relacionadas com tradução.
|
76 |
+
# English:<|im_end|>
|
77 |
+
# <|im_start|>assistant
|
78 |
+
# A group of researchers has launched a new model for translation-related tasks.
|
79 |
```
|
80 |
|
81 |
|
|
|
125 |
|
126 |
The following hyperparameters were used during training:
|
127 |
|
128 |
+
learning_rate: 7e-06
|
|
|
|
|
129 |
seed: 42
|
130 |
distributed_type: multi-GPU
|
131 |
+
num_devices: 4
|
132 |
+
total_train_batch_size: 256
|
|
|
133 |
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
134 |
+
lr_scheduler_type: cosine
|
135 |
+
lr_scheduler_warmup_steps: 500
|
136 |
+
weight_decay: 0.01
|
137 |
+
num_epochs: 4
|
138 |
+
max_seq_length: 2048
|
139 |
|
140 |
## Citation
|
141 |
|