teilomillet commited on
Commit
d13cdbc
1 Parent(s): 8bb5a2d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -1
README.md CHANGED
@@ -9,4 +9,28 @@ widget:
9
  - text: "<s> [|User|] Comment faire un bon plat ? </s>[|Assistant|]"
10
  ---
11
  SFT on a synthetic custom (french) dataset (2k), from general question answering, problem solving to code question.
12
- It's a POC.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  - text: "<s> [|User|] Comment faire un bon plat ? </s>[|Assistant|]"
10
  ---
11
  SFT on a synthetic custom (french) dataset (2k), from general question answering, problem solving to code question.
12
+ It's a POC.
13
+
14
+
15
+ ```python
16
+ from transformers import AutoModelForCausalLM, AutoTokenizer
17
+ from peft import PeftModel
18
+ import torch
19
+
20
+ model = AutoModelForCausalLM.from_pretrained(
21
+ "teilomillet/MiniMerlin-3B",
22
+ revision="0.1",
23
+ return_dict=True,
24
+ torch_dtype=torch.bfloat16,
25
+ device_map='auto'
26
+ )
27
+
28
+ tokenizer = AutoTokenizer.from_pretrained("teilomillet/MiniMerlin-3B")
29
+ tokenizer.pad_token = tokenizer.eos_token
30
+
31
+ text = "[|User|] Comment faire un bon plat ? </s>[|Assistant|]"
32
+ inputs = tokenizer(text, return_tensors="pt").to(0)
33
+
34
+ outputs = model.generate(**inputs, max_new_tokens=800)
35
+ print(tokenizer.decode(outputs[0], skip_special_tokens=False))
36
+ ```