piEsposito commited on
Commit
dc2c8d5
·
1 Parent(s): aca3c93

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -0
README.md CHANGED
@@ -6,6 +6,24 @@ language:
6
 
7
  # Cabrita: portuguese instructLLaMA
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ## Data
10
 
11
  We translated the [alpaca_data.json](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json) to portuguese using ChatGPT. Even if this translation was not the best, the tradeoff between costs and results were. We paid around US$ 8.00 to translate the full dataset to portuguese.
 
6
 
7
  # Cabrita: portuguese instructLLaMA
8
 
9
+ ## Usage
10
+
11
+ Check the Github repo with code: https://github.com/22-hours/cabrita
12
+
13
+ ```
14
+ from peft import PeftModel
15
+ from transformers import LLaMATokenizer, LLaMAForCausalLM, GenerationConfig
16
+
17
+ tokenizer = LLaMATokenizer.from_pretrained("decapoda-research/llama-7b-hf")
18
+ model = LLaMAForCausalLM.from_pretrained(
19
+ "decapoda-research/llama-7b-hf",
20
+ load_in_8bit=True,
21
+ device_map="auto",
22
+ )
23
+ model = PeftModel.from_pretrained(model, "22h/cabrita-lora-v0-1")
24
+ ```
25
+
26
+
27
  ## Data
28
 
29
  We translated the [alpaca_data.json](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json) to portuguese using ChatGPT. Even if this translation was not the best, the tradeoff between costs and results were. We paid around US$ 8.00 to translate the full dataset to portuguese.