mgoin commited on
Commit
5198e7f
1 Parent(s): 0dd18e2

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +63 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: meta-llama/Llama-2-7b-hf
3
+ inference: true
4
+ model_type: llama
5
+ datasets:
6
+ - cerebras/SlimPajama-627B
7
+ tags:
8
+ - sparse
9
+ ---
10
+
11
+ # Llama-2-7b-pruned50-retrained
12
+
13
+ This repo contains model files for a [Llama 2 7B](https://huggingface.co/meta-llama/Llama-2-7b-hf) model that has had 50% of the parameters pruned in one-shot with [SparseGPT](https://arxiv.org/abs/2301.00774), then retrained by [Cerebras](https://huggingface.co/cerebras) with 45B tokens from SlimPajama while maintaining sparsity.
14
+
15
+ **Authors**: Neural Magic, Cerebras
16
+
17
+ ## Usage
18
+
19
+ Below we share some code snippets on how to get quickly started with running the model.
20
+
21
+ ### Fine-tuning examples
22
+
23
+ Coming soon.
24
+
25
+ ### Running the model
26
+
27
+ ```python
28
+ # pip install transformers accelerate
29
+ from transformers import AutoTokenizer, AutoModelForCausalLM
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained("neuralmagic/Llama-2-7b-pruned50-retrained")
32
+ model = AutoModelForCausalLM.from_pretrained("neuralmagic/Llama-2-7b-pruned50-retrained", device_map="auto")
33
+
34
+ input_text = "Write me a poem about Machine Learning."
35
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
36
+
37
+ outputs = model.generate(**input_ids)
38
+ print(tokenizer.decode(outputs[0]))
39
+ ```
40
+
41
+ ## Evaluation Benchmark Results
42
+
43
+ Model evaluation metrics and results.
44
+
45
+ | Benchmark | Metric | Llama-2-7b | Llama-2-7b-pruned50-retrained |
46
+ |------------------------------------------------|---------------|-------------|-------------------------------|
47
+ | [MMLU](https://arxiv.org/abs/2009.03300) | 5-shot, top-1 | xxxx | xxxx |
48
+ | [HellaSwag](https://arxiv.org/abs/1905.07830) | 0-shot | xxxx | xxxx |
49
+ | [WinoGrande](https://arxiv.org/abs/1907.10641) | partial score | xxxx | xxxx |
50
+ | [ARC-c](https://arxiv.org/abs/1911.01547) | | xxxx | xxxx |
51
+ | [TruthfulQA](https://arxiv.org/abs/2109.07958) | 5-shot | xxxx | xxxx |
52
+ | [HumanEval](https://arxiv.org/abs/2107.03374) | pass@1 | xxxx | xxxx |
53
+ | [GSM8K](https://arxiv.org/abs/2110.14168) | maj@1 | xxxx | xxxx |
54
+ | ------------------------------ | ------------- | ----------- | --------- |
55
+ | **Average** | | xxxx | xxxx |
56
+
57
+ ## Model Training Data
58
+
59
+ Coming soon.
60
+
61
+ ## Sparsification
62
+
63
+ This model was pruned with [SparseGPT](https://arxiv.org/abs/2301.00774), using [SparseML](https://github.com/neuralmagic/sparseml).