Commit
·
ede5760
1
Parent(s):
c302a3e
Update README.md
Browse files
README.md
CHANGED
@@ -27,10 +27,41 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
|
27 |
checkpoint = "automaise/quokka-7b"
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
30 |
-
model = AutoModelForCausalLM.from_pretrained(checkpoint)
|
31 |
|
32 |
generator = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
```
|
35 |
|
36 |
### Limitations and bias
|
@@ -42,11 +73,21 @@ and specific instructions.
|
|
42 |
It is fundamental to be aware of these limitations and exercise caution when using the model for human-facing interactions.
|
43 |
This bias will also impact all subsequent fine-tuned versions of this model.
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
## Training data
|
46 |
|
47 |
QUOKKA was fine-tuned on a dataset collected from different sources:
|
48 |
|
49 |
-
* Initially, we used the **[
|
50 |
translation of 67k English instructions (52k from Alpaca and 15k from Dolly v2) into 51 languages using Google Translate API.
|
51 |
For our intended purposes, we exclusively selected the Portuguese subset and focused on the samples pertaining to Dolly v2.
|
52 |
|
|
|
27 |
checkpoint = "automaise/quokka-7b"
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
30 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")
|
31 |
|
32 |
generator = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
|
33 |
+
```
|
34 |
+
|
35 |
+
Follows some examples of the capabilities of our model:
|
36 |
+
|
37 |
+
#### Text summarization
|
38 |
+
```python
|
39 |
+
prompt = "Quero que ajas como um sumarizador de texto e me ajudes a criar um sumário conciso do seguinte texto apresentado, realçando apenas os pontos essenciais do texto original: Rabo de Peixe, internacionalmente conhecida como Turn of the Tide, foi criada por Augusto Fraga e Patrícia Cerqueira; e produzida para a Netflix pela Ukbar Filmes. A história é protagonizada por um grupo de amigos numa freguesia da ilha de São Miguel e foi inspirada no surgimento, em 2001, de toneladas de cocaína na costa açoriana após ter sido largada no Oceano Atlântico por traficantes. \"Quando um barco carregado de cocaína naufraga na sua ilha natal, Eduardo vê uma oportunidade arriscada, mas empolgante, de ganhar dinheiro e realizar sonhos impossíveis\", diz a sinopse apresentada pela Netflix."
|
40 |
+
|
41 |
+
generator(f"<human>{prompt}<bot>")
|
42 |
+
|
43 |
+
>> Turn of the Tide é uma série de televisão portuguesa criada por Augusto Fraga e Patrícia Cerqueira para a Netflix. A história é ambientada em uma freguesia da ilha de São Miguel e segue um grupo de amigos que se envolvem em um mistério envolvendo a cocaína que foi largada no Oceano Atlântico em 2001. A série é inspirada em um evento real que ocorreu na costa açoriana.
|
44 |
+
```
|
45 |
+
|
46 |
+
#### Question answering
|
47 |
+
|
48 |
+
|
49 |
+
```python
|
50 |
+
prompt = "Lê o seguinte texto: Rabo de Peixe, internacionalmente conhecida como Turn of the Tide, foi criada por Augusto Fraga e Patrícia Cerqueira; e produzida para a Netflix pela Ukbar Filmes. A história é protagonizada por um grupo de amigos numa freguesia da ilha de São Miguel e foi inspirada no surgimento, em 2001, de toneladas de cocaína na costa açoriana após ter sido largada no Oceano Atlântico por traficantes. \"Quando um barco carregado de cocaína naufraga na sua ilha natal, Eduardo vê uma oportunidade arriscada, mas empolgante, de ganhar dinheiro e realizar sonhos impossíveis\", diz a sinopse apresentada pela Netflix. \n\n Onde foi filmada a série Rabo de Peixe?"
|
51 |
+
|
52 |
+
generator(f"<human>{prompt}<bot>")
|
53 |
+
|
54 |
+
>> A série Rabo de Peixe foi filmada na ilha de São Miguel, nos Açores.
|
55 |
+
```
|
56 |
+
|
57 |
+
#### Generate synthetic data
|
58 |
+
|
59 |
+
```python
|
60 |
+
prompt = "Gera uma frase semelhante à seguinte frase: Bom dia, em que posso ser útil?"
|
61 |
+
|
62 |
+
generator(f"<human>{prompt}<bot>")
|
63 |
+
|
64 |
+
>> Bom dia, como posso ajudá-lo?
|
65 |
```
|
66 |
|
67 |
### Limitations and bias
|
|
|
73 |
It is fundamental to be aware of these limitations and exercise caution when using the model for human-facing interactions.
|
74 |
This bias will also impact all subsequent fine-tuned versions of this model.
|
75 |
|
76 |
+
We did notice that the model avoids answering questions of religious or political nature:
|
77 |
+
|
78 |
+
````python
|
79 |
+
prompt = "Que partido político é que apoias?"
|
80 |
+
|
81 |
+
generator(f"<human>{prompt}<bot>")
|
82 |
+
|
83 |
+
>> Como uma IA, não tenho preferências políticas.
|
84 |
+
````
|
85 |
+
|
86 |
## Training data
|
87 |
|
88 |
QUOKKA was fine-tuned on a dataset collected from different sources:
|
89 |
|
90 |
+
* Initially, we used the **[Bactrian-X](https://huggingface.co/datasets/MBZUAI/Bactrian-X)** dataset, which involves the
|
91 |
translation of 67k English instructions (52k from Alpaca and 15k from Dolly v2) into 51 languages using Google Translate API.
|
92 |
For our intended purposes, we exclusively selected the Portuguese subset and focused on the samples pertaining to Dolly v2.
|
93 |
|