File size: 2,190 Bytes
0bc87af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
license: other
license_name: tongyi-qianwen
license_link: >-
  https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat/blob/main/LICENSE
language:
- en
pipeline_tag: text-generation
base_model: Qwen/CodeQwen1.5-7B-Chat
tags:
- exl2
- chat
---

# CodeQwen1.5-7B-Chat - EXL2 3.0bpw

This is a 3.0bpw EXL2 quant of [Qwen/CodeQwen1.5-7B-Chat](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat)

Details about the model can be found at the above model page.

## EXL2 Version

These quants were made with exllamav2 version 0.0.18. Quants made on this version of EXL2 may not work on older versions of the exllamav2 library.

If you have problems loading these models, please update Text Generation WebUI to the latest version.



## Quant Details

This is the script used for quantization.

```bash
#!/bin/bash

# Activate the conda environment
source ~/miniconda3/etc/profile.d/conda.sh
conda activate exllamav2

# Set the model name and bit size
MODEL_NAME="CodeQwen1.5-7B-Chat"

# Define variables
MODEL_DIR="models/$MODEL_NAME"
OUTPUT_DIR="exl2_$MODEL_NAME"
MEASUREMENT_FILE="measurements/$MODEL_NAME.json"

# Create the measurement file if needed
if [ ! -f "$MEASUREMENT_FILE" ]; then
    echo "Creating $MEASUREMENT_FILE"
    # Create directories
    if [ -d "$OUTPUT_DIR" ]; then
        rm -r "$OUTPUT_DIR"
    fi
    mkdir "$OUTPUT_DIR"

    python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -om $MEASUREMENT_FILE
fi

# Choose one of the below. Either create a single quant for testing or a batch of them.
# BIT_PRECISIONS=(2.25)
BIT_PRECISIONS=(8.0 7.0 6.0 5.0 4.0 3.5 3.0 2.75 2.5)

for BIT_PRECISION in "${BIT_PRECISIONS[@]}"
do
    CONVERTED_FOLDER="models/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw"

    # If it doesn't already exist, make the quant
    if [ ! -d "$CONVERTED_FOLDER" ]; then

        echo "Creating $CONVERTED_FOLDER"

        # Create directories
        if [ -d "$OUTPUT_DIR" ]; then
            rm -r "$OUTPUT_DIR"
        fi
        mkdir "$OUTPUT_DIR"
        mkdir "$CONVERTED_FOLDER"
        
        # Run conversion commands  
        python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -m $MEASUREMENT_FILE -b $BIT_PRECISION -cf $CONVERTED_FOLDER

    fi
done
```