Views
No views yet
| Quant Level | Perplexity Score | Repo |
|---|---|---|
| 6.0 | 4.7068 | turboderp |
| 5.5 | 4.7136 | Dracones |
| 5.0 | 4.7309 | turboderp |
| 4.5 | 4.8111 | turboderp |
| 4.25 | 4.8292 | turboderp |
| 4.0 | 4.8603 | turboderp |
| 3.75 | 4.9112 | turboderp |
| 3.5 | 4.9592 | turboderp |
| 3.25 | 5.0631 | turboderp |
| 3.0 | 5.2050 | turboderp |
| 2.75 | 5.3820 | Dracones |
| 2.5 | 5.6681 | turboderp |
| 2.25 | 5.9769 | Dracones |
| Quant Size | Alpaca | ChatML | Command-R | Command-R-Plus |
|---|---|---|---|---|
| 6.0 | 70.77 | 62.58 | 75.81 | 74.95 |
| 5.5 | 71.93 | 67.7 | 74.9 | 75.48 |
| 5.0 | 69.51 | 63.94 | 74.92 | 75.28 |
1instruction_template: |-
2 {%- if messages[0]['role'] == 'system' -%}
3 {%- set loop_messages = messages[1:] -%}
4 {%- set system_message = messages[0]['content'] -%}
5 {%- elif false == true -%}
6 {%- set loop_messages = messages -%}
7 {%- set system_message = 'You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users by providing thorough responses. You are trained by Cohere.' -%}
8 {%- else -%}
9 {%- set loop_messages = messages -%}
10 {%- set system_message = false -%}
11 {%- endif -%}
12 {%- if system_message != false -%}
13 {{ '<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}
14 {%- endif -%}
15 {%- for message in loop_messages -%}
16 {%- set content = message['content'] -%}
17 {%- if message['role'] == 'user' -%}
18 {{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}
19 {%- elif message['role'] == 'assistant' -%}
20 {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}
21 {%- endif -%}
22 {%- endfor -%}
23 {%- if add_generation_prompt -%}
24 {{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' }}
25 {%- endif -%}
261#!/bin/bash
2
3# Activate the conda environment
4source ~/miniconda3/etc/profile.d/conda.sh
5conda activate exllamav2
6
7# Set the model name and bit size
8MODEL_NAME="c4ai-command-r-plus"
9BIT_PRECISIONS=(8.0 7.5 7.0 6.5 5.5 2.75 2.25)
10
11# MODEL_NAME="turboderp_command-r-plus-103B"
12# BIT_PRECISIONS=(6.0 5.0 4.5 4.25 4.0 3.75 3.5 3.25 3.0 2.5)
13
14# Print the markdown table header
15echo "| Quant Level | Perplexity Score |"
16echo "|-------------|------------------|"
17
18for BIT_PRECISION in "${BIT_PRECISIONS[@]}"
19do
20 MODEL_DIR="models/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw"
21# MODEL_DIR="models/${MODEL_NAME}-exl2_${BIT_PRECISION}bpw"
22 if [ -d "$MODEL_DIR" ]; then
23 output=$(python test_inference.py -m "$MODEL_DIR" -gs 22,24 -ed data/wikitext/wikitext-2-v1.parquet)
24 score=$(echo "$output" | grep -oP 'Evaluation perplexity: \K[\d.]+')
25 echo "| $BIT_PRECISION | $score |"
26 fi
27done1#!/bin/bash
2
3# Activate the conda environment
4source ~/miniconda3/etc/profile.d/conda.sh
5conda activate exllamav2
6
7# Set the model name and bit size
8MODEL_NAME="c4ai-command-r-plus"
9
10# Define variables
11MODEL_DIR="models/$MODEL_NAME"
12OUTPUT_DIR="exl2_$MODEL_NAME"
13MEASUREMENT_FILE="measurements/$MODEL_NAME.json"
14
15# Create the measurement file if needed
16if [ ! -f "$MEASUREMENT_FILE" ]; then
17 echo "Creating $MEASUREMENT_FILE"
18 # Create directories
19 if [ -d "$OUTPUT_DIR" ]; then
20 rm -r "$OUTPUT_DIR"
21 fi
22 mkdir "$OUTPUT_DIR"
23
24 python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -om $MEASUREMENT_FILE
25fi
26
27# Choose one of the below. Either create a single quant for testing or a batch of them.
28# BIT_PRECISIONS=(5.0)
29BIT_PRECISIONS=(8.0 7.5 6.5 5.5 2.75 2.25)
30
31for BIT_PRECISION in "${BIT_PRECISIONS[@]}"
32do
33 CONVERTED_FOLDER="models/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw"
34
35 # If it doesn't already exist, make the quant
36 if [ ! -d "$CONVERTED_FOLDER" ]; then
37
38 echo "Creating $CONVERTED_FOLDER"
39
40 # Create directories
41 if [ -d "$OUTPUT_DIR" ]; then
42 rm -r "$OUTPUT_DIR"
43 fi
44 mkdir "$OUTPUT_DIR"
45 mkdir "$CONVERTED_FOLDER"
46
47 # Run conversion commands
48 python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -m $MEASUREMENT_FILE -b $BIT_PRECISION -cf $CONVERTED_FOLDER
49
50 fi
51done