teknium commited on
Commit
225e5cc
·
1 Parent(s): bfc684f

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -0
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ language:
4
+ - en
5
+ pipeline_tag: text-generation
6
+ datasets:
7
+ - teknium/openhermes
8
+ ---
9
+
10
+ # Model Card for Puffin-Phi V2
11
+
12
+ Phi-1.5 fine tuned with Hermes Dataset
13
+
14
+ ## Model Details
15
+
16
+ ### Model Sources
17
+
18
+ This model was trained on the OpenHermes Dataset, made by me, which is over 240,000 mostly GPT-4 generated synthetic datapoints
19
+
20
+ ## Uses
21
+
22
+ Let me know!
23
+
24
+ ## How to Get Started with the Model
25
+
26
+ Phi does not support device_map "auto", and does not seem to want to inference in fp16, so use bf16.
27
+
28
+ Here is working code to inference, though it can be improved:
29
+
30
+ ```python
31
+ import torch
32
+ from transformers import AutoModelForCausalLM, AutoTokenizer
33
+
34
+ sysprompt = "The assistant gives helpful, detailed, and polite answers to the user's questions.\n"
35
+
36
+ model = AutoModelForCausalLM.from_pretrained("teknium/Puffin-Phi-v2", trust_remote_code=True, torch_dtype=torch.bfloat16).to("cuda")
37
+ tokenizer = AutoTokenizer.from_pretrained("teknium/Puffin-Phi-v2", trust_remote_code=True, torch_dtype=torch.bfloat16)
38
+ inputs = tokenizer(f"{sysprompt}USER: Write a negative review for the website Twitter.\nASSISTANT:", return_tensors="pt", return_attention_mask=False)
39
+ outputs = model.generate(**inputs, max_length=128, do_sample=True, temperature=0.2, top_p=0.9, use_cache=True, repetition_penalty=1.2, eos_token_id=tokenizer.eos_token_id)
40
+ text = tokenizer.batch_decode(outputs)[0]
41
+ print(text)
42
+ ```
43
+
44
+ The prompt format is ShareGPT/Vicuna, so it uses the sysprompt (defualt in sysprompt variable)
45
+ then is prompted like so:
46
+
47
+ ```
48
+ USER: <prompt>
49
+ ASSISTANT:
50
+ ```
51
+
52
+ ## Training Details
53
+
54
+ ### Training Procedure
55
+
56
+ Trained with Axolotl. View the wandb runs for all my puffin runs (this is puffin-phi-4 on wandb):
57
+ https://wandb.ai/teknium1/puffin-phi/runs/puffin-phi-4
58
+
59
+ ## Evaluation
60
+
61
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/sQqgzk6dM7mxbyVloFMa1.png)