miguelcarv commited on
Commit
314538e
1 Parent(s): 5dcd24e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +51 -0
README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ # For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
3
+ # Doc / guide: https://huggingface.co/docs/hub/model-cards
4
+ {}
5
+ ---
6
+
7
+ # Model Card for Phi 1.5 SlimOrca
8
+
9
+ <!-- Provide a quick summary of what the model is/does. -->
10
+
11
+ Phi 1.5 finetuned on SlimOrca-Dedup. This model was trained with the goal of giving Phi 1.5 the ablity to generate the EOS token together with being capable of doing beam search.
12
+
13
+ ## Model Details
14
+
15
+ ## How to Get Started with the Model
16
+
17
+ ```python
18
+ import torch
19
+ import transformers
20
+
21
+ model = transformers.AutoModelForCausalLM.from_pretrained(
22
+ "miguelcarv/phi-1_5-slimorca",
23
+ trust_remote_code=True
24
+ )
25
+ tokenizer = transformers.AutoTokenizer.from_pretrained("microsoft/phi-1_5")
26
+
27
+
28
+ SYSTEM_PROMPT = "You are an AI assistant. You will be given a task. You must generate a detailed and long answer."
29
+ input_text = f"""{SYSTEM_PROMPT}
30
+
31
+ Instruction: Give me the first 5 prime numbers and explain what prime numbers are.
32
+ Output:"""
33
+
34
+ with torch.no_grad():
35
+ outputs = model.generate(
36
+ tokenizer(input_text, return_tensors="pt")['input_ids'],
37
+ max_length=256,
38
+ num_beams = 3,
39
+ eos_token_id = tokenizer.eos_token_id
40
+ )
41
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
42
+ ```
43
+
44
+ ## Training Details
45
+
46
+ - Trained for one epoch on SlimOrca-Dedup
47
+ - Learning rate: 1e-5
48
+ - Optimizer: AdamW
49
+ - Effective batch size: 64
50
+ - Gradient accumulation steps (mini batch size): 16 (4)
51
+ - Trained with FP32