Views
No views yet

1#!/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="Llama-3-Lumimaid-70B-v0.1"
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.
28BIT_PRECISIONS=(8.0 7.0 6.0 5.5 5.0 4.5 4.0 3.5 3.25 3.0 2.75 2.5 2.25)
29
30for BIT_PRECISION in "${BIT_PRECISIONS[@]}"
31do
32 CONVERTED_FOLDER="models/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw"
33
34 # If it doesn't already exist, make the quant
35 if [ ! -d "$CONVERTED_FOLDER" ]; then
36
37 echo "Creating $CONVERTED_FOLDER"
38
39 # Create directories
40 if [ -d "$OUTPUT_DIR" ]; then
41 rm -r "$OUTPUT_DIR"
42 fi
43 mkdir "$OUTPUT_DIR"
44 mkdir "$CONVERTED_FOLDER"
45
46 # Run conversion commands
47 python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -m $MEASUREMENT_FILE -b $BIT_PRECISION -cf $CONVERTED_FOLDER
48
49 fi
50done