mariagrandury
commited on
Commit
•
fb75879
1
Parent(s):
f4215fa
Update README.md
Browse files
README.md
CHANGED
@@ -1,53 +1,198 @@
|
|
1 |
---
|
2 |
model-index:
|
3 |
-
- name: lince-zero
|
4 |
-
|
5 |
license: apache-2.0
|
6 |
language:
|
7 |
-
- es
|
8 |
-
thumbnail: https://huggingface.co/clibrain/lince-zero/resolve/main/
|
9 |
pipeline_tag: text-generation
|
|
|
10 |
---
|
11 |
|
12 |
-
|
|
|
|
|
13 |
|
14 |
<div style="text-align:center;width:250px;height:250px;">
|
15 |
<img src="https://huggingface.co/clibrain/lince-zero/resolve/main/LINCE-CLIBRAIN-HD.jpg" alt="lince logo"">
|
16 |
</div>
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
|
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
|
|
|
30 |
|
31 |
-
###
|
32 |
|
33 |
-
|
34 |
|
35 |
-
###
|
36 |
|
37 |
-
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
-
### Example of usage 👩💻
|
41 |
```py
|
42 |
import torch
|
43 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoTokenizer
|
44 |
|
45 |
model_id = "clibrain/lince-zero"
|
46 |
|
47 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
48 |
-
|
49 |
model = AutoModelForCausalLM.from_pretrained(model_id).to("cuda")
|
50 |
-
|
51 |
|
52 |
def create_instruction(instruction, input_data=None, context=None):
|
53 |
sections = {
|
@@ -79,7 +224,7 @@ def generate(
|
|
79 |
num_beams=4,
|
80 |
**kwargs
|
81 |
):
|
82 |
-
|
83 |
prompt = create_instruction(instruction, input, context)
|
84 |
print(prompt)
|
85 |
inputs = tokenizer(prompt, return_tensors="pt")
|
@@ -108,4 +253,4 @@ def generate(
|
|
108 |
|
109 |
instruction = "Dame una lista de lugares a visitar en España."
|
110 |
print(generate(instruction))
|
111 |
-
```
|
|
|
1 |
---
|
2 |
model-index:
|
3 |
+
- name: lince-zero
|
4 |
+
results: []
|
5 |
license: apache-2.0
|
6 |
language:
|
7 |
+
- es
|
8 |
+
thumbnail: https://huggingface.co/clibrain/lince-zero/resolve/main/LINCE-CLIBRAIN-HD.jpg
|
9 |
pipeline_tag: text-generation
|
10 |
+
library_name: transformers
|
11 |
---
|
12 |
|
13 |
+
**LINCE-ZERO** (Llm for Instructions from Natural Corpus en Español) is a state-of-the-art Spanish instruction-tuned large language model. Developed by [Clibrain](https://www.clibrain.com/), it is a causal decoder-only model with 7B parameters. LINCE-ZERO is based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) and has been fine-tuned using an 80k examples proprietary dataset inspired in famous instruction datasets such as Alpaca and Dolly.
|
14 |
+
|
15 |
+
The model is released under the Apache 2.0 license.
|
16 |
|
17 |
<div style="text-align:center;width:250px;height:250px;">
|
18 |
<img src="https://huggingface.co/clibrain/lince-zero/resolve/main/LINCE-CLIBRAIN-HD.jpg" alt="lince logo"">
|
19 |
</div>
|
20 |
|
21 |
+
# Table of Contents
|
22 |
+
|
23 |
+
- [Model Details](#model-details)
|
24 |
+
- [Model Description](#model-description)
|
25 |
+
- [Uses](#uses)
|
26 |
+
- [Direct Use](#direct-use)
|
27 |
+
- [Downstream Use](#downstream-use)
|
28 |
+
- [Out-of-Scope Use](#out-of-scope-use)
|
29 |
+
- [Bias, Risks, and Limitations](#bias-risks-and-limitations)
|
30 |
+
- [Recommendations](#recommendations)
|
31 |
+
- [Training Details](#training-details)
|
32 |
+
- [Training Data](#training-data)
|
33 |
+
- [Training Procedure](#training-procedure)
|
34 |
+
- [Preprocessing](#preprocessing)
|
35 |
+
- [Speeds, Sizes, Times](#speeds-sizes-times)
|
36 |
+
- [Evaluation](#evaluation)
|
37 |
+
- [Testing Data, Factors & Metrics](#testing-data-factors--metrics)
|
38 |
+
- [Testing Data](#testing-data)
|
39 |
+
- [Factors](#factors)
|
40 |
+
- [Metrics](#metrics)
|
41 |
+
- [Results](#results)
|
42 |
+
- [Model Examination](#model-examination)
|
43 |
+
- [Environmental Impact](#environmental-impact)
|
44 |
+
- [Technical Specifications](#technical-specifications)
|
45 |
+
- [Model Architecture and Objective](#model-architecture-and-objective)
|
46 |
+
- [Compute Infrastructure](#compute-infrastructure)
|
47 |
+
- [Hardware](#hardware)
|
48 |
+
- [Software](#software)
|
49 |
+
- [Citation](#citation)
|
50 |
+
- [Contact](#contact)
|
51 |
+
- [How to Get Started with the Model](#how-to-get-started-with-the-model)
|
52 |
+
|
53 |
+
# Model Details
|
54 |
+
|
55 |
+
## Model Description
|
56 |
+
|
57 |
+
LINCE-ZERO (Llm for Instructions from Natural Corpus en Español) is a state-of-the-art Spanish instruction-tuned large language model. Developed by [Clibrain](https://www.clibrain.com/), it is a causal decoder-only model with 7B parameters. LINCE-ZERO is based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) and has been fine-tuned using an 80k examples proprietary dataset.
|
58 |
+
|
59 |
+
- **Developed by:** [Clibrain](https://www.clibrain.com/)
|
60 |
+
- **Model type:** Language model, instruction model, causal decoder-only
|
61 |
+
- **Language(s) (NLP):** es
|
62 |
+
- **License:** apache-2.0
|
63 |
+
- **Parent Model:** [https://huggingface.co/tiiuae/falcon-7b](https://huggingface.co/tiiuae/falcon-7b)
|
64 |
+
|
65 |
+
## Model Sources
|
66 |
+
|
67 |
+
- **Paper**: Coming soon!
|
68 |
+
- **Demo**: Coming soon!
|
69 |
+
|
70 |
+
# Uses
|
71 |
+
|
72 |
+
## Direct Use
|
73 |
+
|
74 |
+
LINCE-ZERO's fine-tuning on an instructions dataset enables it to follow natural language instructions in Spanish. The direct use cases include virtual assistants and content generation.
|
75 |
+
|
76 |
+
Please note that running inference with LINCE-ZERO efficiently requires a minimum of XGB of memory.
|
77 |
+
|
78 |
+
## Downstream Use
|
79 |
+
|
80 |
+
LINCE-ZERO is an instruct model, it’s primarily intended for direct use and may not be ideal for further fine-tuning. It serves as a general model suitable for a wide range of applications. However, for specific use cases within certain domains, fine-tuning with domain-specific data may improve LINCE-ZERO's performance.
|
81 |
+
|
82 |
+
## Out-of-Scope Use
|
83 |
+
|
84 |
+
LINCE-ZERO should not be used for production purposes without conducting a thorough assessment of risks and mitigation strategies.
|
85 |
+
|
86 |
+
# Bias, Risks, and Limitations
|
87 |
+
|
88 |
+
LINCE-ZERO has limitations associated with both the underlying language model and the instruction tuning data. It is crucial to acknowledge that predictions generated by the model may inadvertently exhibit common deficiencies of language models, including hallucination, toxicity, and perpetuate harmful stereotypes across protected classes, identity characteristics, and sensitive, social, and occupational groups.
|
89 |
+
|
90 |
+
## Recommendations
|
91 |
+
|
92 |
+
Please, when utilizing LINCE-ZERO, exercise caution and critically assess the output to mitigate the potential impact of biased or inaccurate information.
|
93 |
+
|
94 |
+
If considering LINCE-ZERO for production use, it is crucial to thoroughly evaluate the associated risks and adopt suitable precautions. Conduct a comprehensive assessment to address any potential biases and ensure compliance with legal and ethical standards.
|
95 |
+
|
96 |
+
# Training Details
|
97 |
+
|
98 |
+
## Training Data
|
99 |
+
|
100 |
+
LINCE-ZERO is based on **[Falcon-7B](https://huggingface.co/tiiuae/falcon-7b)** and has been fine-tuned using an 80k examples proprietary dataset inspired in famous instruction datasets such as Alpaca and Dolly.
|
101 |
+
|
102 |
+
## Training Procedure
|
103 |
+
|
104 |
+
For detailed information about the model architecture and compute infrastructure, please refer to the Technical Specifications section.
|
105 |
+
|
106 |
+
### Preprocessing
|
107 |
|
108 |
+
The training data was tokenized using LINCE-ZERO’s tokenizer, which is based on the Falcon-**[7B](https://huggingface.co/tiiuae/falcon-7b)**/**[40B](https://huggingface.co/tiiuae/falcon-40b)** tokenizer.
|
109 |
|
110 |
+
### Training Hyperparameters
|
111 |
|
112 |
+
More information needed
|
113 |
|
114 |
+
### Speeds, Sizes, Times
|
115 |
|
116 |
+
More information needed (throughput, start/end time, checkpoint size if relevant, etc.)
|
117 |
|
118 |
+
# Evaluation
|
119 |
|
120 |
+
## Testing Data, Factors & Metrics
|
121 |
|
122 |
+
### Testing Data
|
123 |
|
124 |
+
More information needed
|
125 |
|
126 |
+
### Metrics
|
127 |
|
128 |
+
Since LINCE-ZERO is an instruction model, the metrics used to evaluate it are:
|
129 |
|
130 |
+
- X: <value>
|
131 |
+
|
132 |
+
### Results
|
133 |
+
|
134 |
+
Paper coming soon. Meanwhile, check the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
|
135 |
+
|
136 |
+
# Technical Specifications
|
137 |
+
|
138 |
+
## Model Architecture and Objective
|
139 |
+
|
140 |
+
LINCE-ZERO is a causal decoder-only model trained on a causal language modeling task. Its objective is to predict the next token in a sequence based on the context provided.
|
141 |
+
|
142 |
+
The architecture of LINCE-ZERO is based on Falcon-7B, which itself is adapted from the GPT-3 paper (Brown et al., 2020) with the following modifications:
|
143 |
+
|
144 |
+
- Positional embeddings: rotary (Su et al., 2021);
|
145 |
+
- Attention: multiquery (Shazeer et al., 2019) and FlashAttention (Dao et al., 2022);
|
146 |
+
- Decoder-block: parallel attention/MLP with a single-layer norm.
|
147 |
+
|
148 |
+
## Compute Infrastructure
|
149 |
+
|
150 |
+
### Hardware
|
151 |
+
|
152 |
+
LINCE-ZERO was trained on AWS SageMaker, on ... GPUs in ... instances.
|
153 |
+
|
154 |
+
### Software
|
155 |
+
|
156 |
+
More information needed
|
157 |
+
|
158 |
+
# Environmental Impact
|
159 |
+
|
160 |
+
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).
|
161 |
+
|
162 |
+
- **Hardware Type:** More information needed
|
163 |
+
- **Hours used:** More information needed
|
164 |
+
- **Cloud Provider:** More information needed
|
165 |
+
- **Compute Region:** More information needed
|
166 |
+
- **Carbon Emitted:** More information needed
|
167 |
+
|
168 |
+
# Citation
|
169 |
+
|
170 |
+
There is a paper coming soon! Meanwhile, when using LINCE-ZERO please use the following information to cite:
|
171 |
+
|
172 |
+
```markdown
|
173 |
+
@article{lince-zero,
|
174 |
+
title={{LINCE}: Llm for Instructions from Natural Corpus en Español},
|
175 |
+
author={},
|
176 |
+
year={2023}
|
177 |
+
}
|
178 |
+
```
|
179 |
+
|
180 |
+
# Contact
|
181 |
+
|
182 |
+
[contacto@clibrain.com](mailto:contacto@clibrain.com)
|
183 |
+
|
184 |
+
# How to Get Started with LINCE-ZERO
|
185 |
+
|
186 |
+
Use the code below to get started with LINCE-ZERO 🔥
|
187 |
|
|
|
188 |
```py
|
189 |
import torch
|
190 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoTokenizer
|
191 |
|
192 |
model_id = "clibrain/lince-zero"
|
193 |
|
|
|
|
|
194 |
model = AutoModelForCausalLM.from_pretrained(model_id).to("cuda")
|
195 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
196 |
|
197 |
def create_instruction(instruction, input_data=None, context=None):
|
198 |
sections = {
|
|
|
224 |
num_beams=4,
|
225 |
**kwargs
|
226 |
):
|
227 |
+
|
228 |
prompt = create_instruction(instruction, input, context)
|
229 |
print(prompt)
|
230 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
|
253 |
|
254 |
instruction = "Dame una lista de lugares a visitar en España."
|
255 |
print(generate(instruction))
|
256 |
+
```
|