Update README.md
Browse files
README.md
CHANGED
@@ -1,25 +1,24 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
language:
|
3 |
- pt
|
4 |
- en
|
5 |
-
|
6 |
library_name: transformers
|
|
|
|
|
|
|
7 |
tags:
|
8 |
- Portuguese
|
9 |
- Llama
|
10 |
- Tiny-Llama
|
11 |
- LLM
|
12 |
- PEFT
|
13 |
-
datasets:
|
14 |
-
- ju-resplande/rebel-pt
|
15 |
-
- paulofinardi/OIG_small_chip2_portuguese_brasil
|
16 |
-
- Guilherme34/Cabrita-lora-ptbr
|
17 |
-
- dominguesm/Canarim-Instruct-PTBR-Dataset
|
18 |
-
pipeline_tag: text-generation
|
19 |
-
widget:
|
20 |
-
- text: 'Como ficar mais inteligente?
|
21 |
-
|
22 |
-
'
|
23 |
---
|
24 |
|
25 |
<hr>
|
@@ -37,16 +36,9 @@ Samba é um LLM treinado em dados da língua portuguesa. O modelo é baseado no
|
|
37 |
|
38 |
O projeto do LLM Samba tem como objetivo fornecer mais opções de LLMs para língua portuguesa, ao mesmo tempo que disponibiliza um modelo menos complexo para que, dessa forma, usuários com menos poder computacional possam usufruir das LLMs.
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
Esse modelo foi fine-tunado em quatro datasets ([rebel-pt](https://huggingface.co/datasets/ju-resplande/rebel-pt), [OIG_small_chip2_portuguese_brasil](https://huggingface.co/datasets/paulofinardi/OIG_small_chip2_portuguese_brasil), [Cabrita-lora-ptbr](https://huggingface.co/datasets/Guilherme34/Cabrita-lora-ptbr) e [Canarim-Instruct-PTBR-Dataset](https://huggingface.co/datasets/dominguesm/Canarim-Instruct-PTBR-Dataset)) com dados de texto na língua portuguesa, contendo aproximadamente 1.4 million de amostras.
|
45 |
-
|
46 |
-
## Atualizações Futuras
|
47 |
-
|
48 |
-
- Adicionar mais dados de textos da língua portuguesa.
|
49 |
-
- Disponibilizar versões quantizadas.
|
50 |
|
51 |
### Descrição do Modelo
|
52 |
|
@@ -58,23 +50,19 @@ Esse modelo foi fine-tunado em quatro datasets ([rebel-pt](https://huggingface.c
|
|
58 |
## Como usar
|
59 |
|
60 |
```python
|
61 |
-
|
62 |
-
|
63 |
-
model = AutoModelForCausalLM.from_pretrained('lrds-code/samba-1.1B')
|
64 |
-
tokenizer = AutoTokenizer.from_pretrained('lrds-code/samba-1.1B')
|
65 |
-
|
66 |
-
text = 'Como desenvolver habilidades de programação em python?'
|
67 |
-
inputs = tokenizer(text, return_tensors='pt')
|
68 |
|
69 |
-
|
70 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
## Além disso, você precisa entender como usar o IDE (Integrated Development Environment) para desenvolver e testar seu código.
|
77 |
|
|
|
|
|
|
|
78 |
```
|
79 |
|
80 |
<hr>
|
@@ -93,16 +81,9 @@ Samba is a LLM trained on portuguese language data. The model is based on [TinyL
|
|
93 |
|
94 |
The LLM Samba project aims to provide more LLM options in Portuguese, while also providing less complex models so that users with less computational power can take advantage of the LLMs.
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
This model was fine-tuned on four datasets ([rebel-pt](https://huggingface.co/datasets/ju-resplande/rebel-pt), [OIG_small_chip2_portuguese_brasil](https://huggingface.co/datasets/paulofinardi/OIG_small_chip2_portuguese_brasil), [Cabrita-lora-ptbr](https://huggingface.co/datasets/Guilherme34/Cabrita-lora-ptbr) and [Canarim-Instruct-PTBR-Dataset](https://huggingface.co/datasets/dominguesm/Canarim-Instruct-PTBR-Dataset)) with portuguese data that total approximately 1.4 million samples.
|
101 |
-
|
102 |
-
## Future Updates
|
103 |
-
|
104 |
-
- Add more data from the portuguese language.
|
105 |
-
- Make quantized versions available.
|
106 |
|
107 |
### Model Description
|
108 |
|
@@ -114,21 +95,17 @@ This model was fine-tuned on four datasets ([rebel-pt](https://huggingface.co/da
|
|
114 |
## How to Use
|
115 |
|
116 |
```python
|
117 |
-
|
118 |
-
|
119 |
-
model = AutoModelForCausalLM.from_pretrained('lrds-code/samba-1.1B')
|
120 |
-
tokenizer = AutoTokenizer.from_pretrained('lrds-code/samba-1.1B')
|
121 |
-
|
122 |
-
text = 'Como desenvolver habilidades de programação em python?'
|
123 |
-
inputs = tokenizer(text, return_tensors='pt')
|
124 |
|
125 |
-
|
126 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
## Além disso, você precisa entender como usar o IDE (Integrated Development Environment) para desenvolver e testar seu código.
|
133 |
|
|
|
|
|
|
|
134 |
```
|
|
|
1 |
---
|
2 |
+
license: llama2
|
3 |
+
datasets:
|
4 |
+
- ju-resplande/rebel-pt
|
5 |
+
- paulofinardi/OIG_small_chip2_portuguese_brasil
|
6 |
+
- Guilherme34/Cabrita-lora-ptbr
|
7 |
+
- dominguesm/Canarim-Instruct-PTBR-Dataset
|
8 |
language:
|
9 |
- pt
|
10 |
- en
|
11 |
+
pipeline_tag: text-generation
|
12 |
library_name: transformers
|
13 |
+
widget:
|
14 |
+
- text: |
|
15 |
+
Como ficar mais inteligente?
|
16 |
tags:
|
17 |
- Portuguese
|
18 |
- Llama
|
19 |
- Tiny-Llama
|
20 |
- LLM
|
21 |
- PEFT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
---
|
23 |
|
24 |
<hr>
|
|
|
36 |
|
37 |
O projeto do LLM Samba tem como objetivo fornecer mais opções de LLMs para língua portuguesa, ao mesmo tempo que disponibiliza um modelo menos complexo para que, dessa forma, usuários com menos poder computacional possam usufruir das LLMs.
|
38 |
|
39 |
+
<p align="center">
|
40 |
+
<img width="250" alt="Countries Logo" src="https://cdn-uploads.huggingface.co/production/uploads/658c21f4c1229bf113295773/d3twZrXng5eDjg_LbH4pF.png">
|
41 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
### Descrição do Modelo
|
44 |
|
|
|
50 |
## Como usar
|
51 |
|
52 |
```python
|
53 |
+
import torch
|
54 |
+
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
samba = pipeline('text-generation', model='lrds-code/samba-1.1B', torch_dtype=torch.bfloat16, device_map='auto')
|
|
|
57 |
|
58 |
+
messages = [{"role": "system",
|
59 |
+
"content": ""},
|
60 |
+
{"role": "user",
|
61 |
+
"content": "Quantos planetas existem no sistema solar?"}]
|
|
|
62 |
|
63 |
+
prompt = samba.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
64 |
+
outputs = samba(prompt, max_new_tokens=256, do_sample=False, temperature=0.1, top_k=50, top_p=0.95)
|
65 |
+
print(outputs[0]['generated_text'])
|
66 |
```
|
67 |
|
68 |
<hr>
|
|
|
81 |
|
82 |
The LLM Samba project aims to provide more LLM options in Portuguese, while also providing less complex models so that users with less computational power can take advantage of the LLMs.
|
83 |
|
84 |
+
<p align="center">
|
85 |
+
<img width="250" alt="Countries Logo" src="https://cdn-uploads.huggingface.co/production/uploads/658c21f4c1229bf113295773/d3twZrXng5eDjg_LbH4pF.png">
|
86 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
### Model Description
|
89 |
|
|
|
95 |
## How to Use
|
96 |
|
97 |
```python
|
98 |
+
import torch
|
99 |
+
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
+
samba = pipeline('text-generation', model='lrds-code/samba-1.1B', torch_dtype=torch.bfloat16, device_map='auto')
|
|
|
102 |
|
103 |
+
messages = [{"role": "system",
|
104 |
+
"content": ""},
|
105 |
+
{"role": "user",
|
106 |
+
"content": "Quantos planetas existem no sistema solar?"}]
|
|
|
107 |
|
108 |
+
prompt = samba.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
109 |
+
outputs = samba(prompt, max_new_tokens=256, do_sample=False, temperature=0.1, top_k=50, top_p=0.95)
|
110 |
+
print(outputs[0]['generated_text'])
|
111 |
```
|