nunonmg commited on
Commit
73fc0a0
1 Parent(s): 59e1b7d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +131 -0
README.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ language:
4
+ - en
5
+ - de
6
+ - fr
7
+ - zh
8
+ - pt
9
+ - nl
10
+ - ru
11
+ - ko
12
+ - it
13
+ - es
14
+ metrics:
15
+ - comet
16
+ pipeline_tag: translation
17
+ ---
18
+ # Model Card for TowerInstruct-13B-v0.1
19
+
20
+ ## Model Details
21
+
22
+ ### Model Description
23
+
24
+ TowerInstruct-13B is a language model that results from fine-tuning TowerBase on the TowerBlocks supervised fine-tuning dataset. TowerInstruct-13B-v0.1 is the first model in the series.
25
+ The model is trained to handle several translation-related tasks, such as general machine translation (e.g., sentence- and paragraph-level translation, terminology-aware translation, context-aware translation), automatic post edition, named-entity recognition, gramatical error correction, and paraphrase generation.
26
+ We will release more details in the upcoming technical report.
27
+
28
+ - **Developed by:** Unbabel, Instituto Superior Técnico, CentraleSupélec University of Paris-Saclay
29
+ - **Model type:** A 13B parameter model fine-tuned on a mix of publicly available, synthetic datasets on translation-related tasks, as well as conversational datasets and code instructions.
30
+ - **Language(s) (NLP):** English, Portuguese, Spanish, French, German, Dutch, Italian, Korean, Chinese, Russian
31
+ - **License:** CC-BY-NC-4.0, Llama 2 is licensed under the [LLAMA 2 Community License](https://ai.meta.com/llama/license/), Copyright © Meta Platforms, Inc. All Rights Reserved.
32
+ - **Finetuned from model:** [TowerBase](https://huggingface.co/Unbabel/TowerBase-13B-v0.1)
33
+
34
+ ## Intended uses & limitations
35
+
36
+ The model was initially fine-tuned on a filtered and preprocessed supervised fine-tuning dataset ([TowerBlocks](https://huggingface.co/datasets/Unbabel/TowerBlocks-v0.1)), which contains a diverse range of data sources:
37
+ - Translation (sentence and paragraph-level)
38
+ - Automatic Post Edition
39
+ - Machine Translation Evaluation
40
+ - Context-aware Translation
41
+ - Terminology-aware Translation
42
+ - Multi-reference Translation
43
+ - Named-entity Recognition
44
+ - Paraphrase Generation
45
+ - Synthetic Chat data
46
+ - Code instructions
47
+
48
+ You can find the dataset and all data sources of [TowerBlocks](https://huggingface.co/datasets/Unbabel/TowerBlocks-v0.1) here.
49
+
50
+ Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
51
+
52
+ ```python
53
+ # Install transformers from source - only needed for versions <= v4.34
54
+ # pip install git+https://github.com/huggingface/transformers.git
55
+ # pip install accelerate
56
+
57
+ import torch
58
+ from transformers import pipeline
59
+
60
+ pipe = pipeline("text-generation", model="Unbabel/TowerInstruct-v0.1", torch_dtype=torch.bfloat16, device_map="auto")
61
+ # We use the tokenizer’s chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
62
+ messages = [
63
+ {"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:"},
64
+ ]
65
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
66
+ outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
67
+ print(outputs[0]["generated_text"])
68
+ # <|im_start|>user
69
+ # Translate the following text from Portuguese into English.
70
+ # Portuguese: Um grupo de investigadores lançou um novo modelo para tarefas relacionadas com tradução.
71
+ # English:<|im_end|>
72
+ # <|im_start|>assistant
73
+ # A group of researchers has launched a new model for translation-related tasks.
74
+ ```
75
+
76
+ ### Out-of-Scope Use
77
+
78
+ The model is not guaranteed to perform for languages other than the 10 languages it supports. Even though we trained the model on conversational data and code instructions, it is not intended to be used as a conversational chatbot or code assistant.
79
+ We are currently working on improving quality and consistency on document-level translation. This model should is not intended to be use as a document-level translator.
80
+
81
+ ## Bias, Risks, and Limitations
82
+
83
+ TowerInstruct-v0.1 has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
84
+
85
+ ## Prompt Format
86
+
87
+ TowerInstruct-v0.1 was trained using the ChatML prompt templates without any system prompts. An example follows below:
88
+ ```
89
+ <|im_start|>user
90
+ {USER PROMPT}<|im_end|>
91
+ <|im_start|>assistant
92
+ {MODEL RESPONSE}<|im_end|>
93
+ <|im_start|>user
94
+ [...]
95
+ ```
96
+
97
+ ### Supervised tasks
98
+
99
+ The prompts for all supervised tasks can be found in [TowerBlocks](https://huggingface.co/datasets/Unbabel/TowerBlocks-v0.1). We have used multiple prompt templates for each task. While different prompts may offer different outputs, the difference in downstream performance should be very minimal.
100
+
101
+ ## Training Details
102
+
103
+ ### Training Data
104
+
105
+ Link to [TowerBlocks](https://huggingface.co/datasets/Unbabel/TowerBlocks-v0.1).
106
+
107
+ #### Training Hyperparameters
108
+
109
+ The following hyperparameters were used during training:
110
+
111
+ - total_train_batch_size: 256
112
+
113
+ - learning_rate: 7e-06
114
+
115
+ - lr_scheduler_type: cosine
116
+
117
+ - lr_scheduler_warmup_steps: 500
118
+
119
+ - weight_decay: 0.01
120
+
121
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
122
+
123
+ - num_epochs: 4
124
+
125
+ - max_seq_length: 2048
126
+
127
+ ## Citation
128
+
129
+ To be completed.
130
+
131
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)