Update README.md
Browse files
README.md
CHANGED
@@ -3,197 +3,124 @@ library_name: transformers
|
|
3 |
tags: []
|
4 |
---
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
-
|
22 |
-
-
|
23 |
-
-
|
24 |
-
-
|
25 |
-
-
|
26 |
-
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
-
|
33 |
-
-
|
34 |
-
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
|
155 |
-
|
156 |
|
157 |
-
|
158 |
|
159 |
-
|
160 |
|
161 |
-
[
|
|
|
162 |
|
163 |
-
|
|
|
|
|
|
|
|
|
164 |
|
165 |
-
|
166 |
|
167 |
-
|
168 |
|
169 |
-
|
170 |
|
171 |
-
|
|
|
172 |
|
173 |
-
|
|
|
174 |
|
175 |
-
|
|
|
176 |
|
177 |
-
|
178 |
|
179 |
-
|
|
|
|
|
|
|
|
|
180 |
|
181 |
-
|
182 |
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
-
|
|
|
186 |
|
187 |
-
|
|
|
188 |
|
189 |
-
|
|
|
190 |
|
191 |
-
[More Information Needed]
|
192 |
|
193 |
-
|
|
|
|
|
194 |
|
195 |
-
|
|
|
|
|
|
|
|
|
196 |
|
197 |
-
|
|
|
198 |
|
199 |
-
|
|
|
|
3 |
tags: []
|
4 |
---
|
5 |
|
6 |
+
---
|
7 |
+
license: apache-2.0
|
8 |
+
library_name: transformers
|
9 |
+
base_model: BSC-LT/salamandra-2b-instruct
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
language:
|
12 |
+
- bg
|
13 |
+
- ca
|
14 |
+
- code
|
15 |
+
- cs
|
16 |
+
- cy
|
17 |
+
- da
|
18 |
+
- de
|
19 |
+
- el
|
20 |
+
- en
|
21 |
+
- es
|
22 |
+
- et
|
23 |
+
- eu
|
24 |
+
- fi
|
25 |
+
- fr
|
26 |
+
- ga
|
27 |
+
- gl
|
28 |
+
- hr
|
29 |
+
- hu
|
30 |
+
- it
|
31 |
+
- lt
|
32 |
+
- lv
|
33 |
+
- mt
|
34 |
+
- nl
|
35 |
+
- nn
|
36 |
+
- \no
|
37 |
+
- oc
|
38 |
+
- pl
|
39 |
+
- pt
|
40 |
+
- ro
|
41 |
+
- ru
|
42 |
+
- sh
|
43 |
+
- sk
|
44 |
+
- sl
|
45 |
+
- sr
|
46 |
+
- sv
|
47 |
+
- uk
|
48 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
+

|
51 |
|
52 |
+
# Salamandra-2b-instruct-gptq Model Card
|
53 |
|
54 |
+
This model is the gptq-quantized version of [Salamandra-2b-instruct](https://huggingface.co/BSC-LT/salamandra-2b-instruct) for speculative decoding.
|
55 |
|
56 |
+
The model weights are quantized from FP16 to W4A16 (4-bit weights and FP16 activations) using the [GPTQ](https://arxiv.org/abs/2210.17323) algorithm.
|
57 |
+
Inferencing with this model can be done using [VLLM](https://docs.vllm.ai/en/stable/models/engine_args.html).
|
58 |
|
59 |
+
Salamandra is a highly multilingual model pre-trained from scratch that comes in three different
|
60 |
+
sizes — 2B, 7B and 40B parameters — with their respective base and instruction-tuned variants,
|
61 |
+
promoted and financed by the Government of Catalonia through the [Aina Project](https://projecteaina.cat/)
|
62 |
+
and the _Ministerio para la Transformación Digital y de la Función Pública_ - Funded by EU – NextGenerationEU
|
63 |
+
within the framework of [ILENIA Project](https://proyectoilenia.es/) with reference 2022/TL22/00215337.
|
64 |
|
65 |
+
This model card corresponds to the gptq-quantized version of Salamandra-2b-instruct for speculative decoding.
|
66 |
|
67 |
+
The entire Salamandra family is released under a permissive [Apache 2.0 license]((https://www.apache.org/licenses/LICENSE-2.0)).
|
68 |
|
69 |
+
## How to Use
|
70 |
|
71 |
+
The following example code works under ``Python 3.9.16``, ``vllm==0.6.3.post1``, ``torch==2.4.0`` and ``torchvision==0.19.0``, though it should run on
|
72 |
+
any current version of the libraries. This is an example of a conversational chatbot using the model:
|
73 |
|
74 |
+
```
|
75 |
+
from vllm import LLM, SamplingParams
|
76 |
|
77 |
+
model_name = "BSC-LT/salamandra-2b-instruct-gptq"
|
78 |
+
llm = LLM(model=model_name)
|
79 |
|
80 |
+
messages = []
|
81 |
|
82 |
+
while True:
|
83 |
+
user_input = input("user >> ")
|
84 |
+
if user_input.lower() == "exit":
|
85 |
+
print("Chat ended.")
|
86 |
+
break
|
87 |
|
88 |
+
messages.append({'role': 'user', 'content': user_input})
|
89 |
|
90 |
+
outputs = llm.chat(messages,
|
91 |
+
sampling_params=SamplingParams(
|
92 |
+
temperature=0.5,
|
93 |
+
stop_token_ids=[5],
|
94 |
+
max_tokens=200)
|
95 |
+
)[0].outputs
|
96 |
+
|
97 |
+
model_output = outputs[0].text
|
98 |
+
print(f'assistant >> {model_output}')
|
99 |
+
messages.append({'role': 'assistant', 'content': model_output})
|
100 |
+
```
|
101 |
|
102 |
+
### Author
|
103 |
+
International Business Machines (IBM).
|
104 |
|
105 |
+
### Copyright
|
106 |
+
International Business Machines (IBM).
|
107 |
|
108 |
+
### Contact
|
109 |
+
For further information, please send an email to <langtech@bsc.es>.
|
110 |
|
|
|
111 |
|
112 |
+
### Acknowledgements
|
113 |
+
We appreciate the collaboration with IBM in this work.
|
114 |
+
Specifically, the IBM team created gptq-quantized version of the Salamandra-2b-instruct model for speculative decoding released here.
|
115 |
|
116 |
+
### Disclaimer
|
117 |
+
Be aware that the model may contain biases or other unintended distortions.
|
118 |
+
When third parties deploy systems or provide services based on this model, or use the model themselves,
|
119 |
+
they bear the responsibility for mitigating any associated risks and ensuring compliance with applicable
|
120 |
+
regulations, including those governing the use of Artificial Intelligence.
|
121 |
|
122 |
+
Barcelona Supercomputing Center and International Business Machines shall
|
123 |
+
not be held liable for any outcomes resulting from third-party use.
|
124 |
|
125 |
+
### License
|
126 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|