vince62s commited on
Commit
20f6b45
1 Parent(s): 093390c

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md CHANGED
@@ -1,3 +1,76 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ tags:
4
+ - merge
5
+ - mergekit
6
+ - lazymergekit
7
+ - rhysjones/phi-2-orange
8
+ - cognitivecomputations/dolphin-2_6-phi-2
9
+ base_model:
10
+ - rhysjones/phi-2-orange
11
+ - cognitivecomputations/dolphin-2_6-phi-2
12
  ---
13
+
14
+ # Phi-2-psy
15
+
16
+ Phi-2-psy is a merge of the following models:
17
+ * [rhysjones/phi-2-orange](https://huggingface.co/rhysjones/phi-2-orange)
18
+ * [cognitivecomputations/dolphin-2_6-phi-2](https://huggingface.co/cognitivecomputations/dolphin-2_6-phi-2)
19
+
20
+ ## 🏆 Evaluation
21
+
22
+ The evaluation was performed using [LLM AutoEval](https://github.com/mlabonne/llm-autoeval) on Nous suite.
23
+
24
+ | Model |AGIEval|GPT4All|TruthfulQA|Bigbench|Average|
25
+ |----------------------------------------------------------------|------:|------:|---------:|-------:|------:|
26
+ |[**phi-2-psy**](https://huggingface.co/vince62s/phi-2-psy)| **34.4**| **71.4**| **48.2**| **38.1**| **49.02**|
27
+ |[**phixtral-2x2_8**](https://huggingface.co/mlabonne/phixtral-2x2_8)| 34.1| 70.4| 48.8| 37.8| 47.8|
28
+ |[dolphin-2_6-phi-2](https://huggingface.co/cognitivecomputations/dolphin-2_6-phi-2)| 33.12| 69.85| 47.39| 37.2| 46.89|
29
+ |[phi-2-orange](https://huggingface.co/rhysjones/phi-2-orange)| 33.4| 71.3| 49.9| 37.3| 47.97|
30
+ |[phi-2](https://huggingface.co/microsoft/phi-2)| 27.98| 70.8| 44.43| 35.21| 44.61|
31
+
32
+ ## 🧩 Configuration
33
+
34
+ ```yaml
35
+ slices:
36
+ - sources:
37
+ - model: rhysjones/phi-2-orange
38
+ layer_range: [0, 32]
39
+ - model: cognitivecomputations/dolphin-2_6-phi-2
40
+ layer_range: [0, 32]
41
+ merge_method: slerp
42
+ base_model: rhysjones/phi-2-orange
43
+ parameters:
44
+ t:
45
+ - filter: self_attn
46
+ value: [0, 0.5, 0.3, 0.7, 1]
47
+ - filter: mlp
48
+ value: [1, 0.5, 0.7, 0.3, 0]
49
+ - value: 0.5
50
+ dtype: bfloat16
51
+ ```
52
+
53
+ ## 💻 Usage
54
+
55
+ ```python
56
+ !pip install -qU transformers accelerate
57
+
58
+ from transformers import AutoTokenizer
59
+ import transformers
60
+ import torch
61
+
62
+ model = "vince62s/Phi-2-psy"
63
+ messages = [{"role": "user", "content": "What is a large language model?"}]
64
+
65
+ tokenizer = AutoTokenizer.from_pretrained(model)
66
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
67
+ pipeline = transformers.pipeline(
68
+ "text-generation",
69
+ model=model,
70
+ torch_dtype=torch.float16,
71
+ device_map="auto",
72
+ )
73
+
74
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
75
+ print(outputs[0]["generated_text"])
76
+ ```