bmah-dmx commited on
Commit
5670be8
1 Parent(s): 8d9b7e0

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +56 -0
README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ model-index:
3
+ - name: CodeLlama-7b
4
+ results:
5
+ - task:
6
+ type: code-generation
7
+ dataset:
8
+ name: Humaneval
9
+ type: humaneval
10
+ metrics:
11
+ - type: pass@1 (BASELINE)
12
+ value: 0.3048780487804878
13
+ - type: pass@1 (BASIC)
14
+ value: 0.3170731707317073
15
+ ---
16
+ This is a d-Matrix functional reference of the CODELLAMA-7B model.
17
+ The reference provides the following functional *configurations*:
18
+ Configuration | Explanation
19
+ :-- | :--
20
+ **`BASELINE`** | a reference functionally equivalent to the original model
21
+ **`BASIC`** | all linear algebraic operands quantized to `BFP16-64`, and all other operations transformed to approximated kernel simulations
22
+
23
+
24
+ ### Usage
25
+
26
+ Install d-Matrix [Dmx_Compressor](https://github.com/d-matrix-ai/dmx-compressor) first.
27
+ ```sh
28
+ pip install dmx_compressor
29
+ ```
30
+
31
+ The following is an example model and its evaluation.
32
+
33
+ ```sh
34
+ git clone https://github.com/bigcode-project/bigcode-evaluation-harness.git
35
+ cd bigcode-evaluation-harness
36
+ pip install .
37
+ ```
38
+
39
+ ```python
40
+ from dmx.compressor.modeling import DmxModel
41
+ from bigcode_eval.evaluator import Evaluator
42
+
43
+ pipe = pipeline(
44
+ task="text-generation",
45
+ model="d-matrix/CodeLlama-7b",
46
+ trust_remote_code=True,
47
+ )
48
+
49
+ # Transform the model with DMX
50
+ model = DmxModel.from_torch(pipe.model).to_basic_model() # Using BASIC configuration
51
+ model(torch.randint(1, 100, (1, max_length))) # Assign desired max length of generation
52
+
53
+ evaluator = Evaluator(accelerator, model, tokenizer, eval_args)
54
+
55
+ eval_results = evaluator.evaluate(task) # Assign desired task, i.e. "humaneval"
56
+ ```