Download eval.sh from chen459664/quantization2: direct link, hf CLI and curl.
- Browser
- Download file 1.93 kB
-
https://huggingface.co/chen459664/quantization2/resolve/0dfd8d2a71a75ba1b625c8e2b4d43e6ad0e22dfd/eval.sh
- Command line
-
hf download hf://chen459664/quantization2@0dfd8d2a71a75ba1b625c8e2b4d43e6ad0e22dfd/eval.sh
-
curl -L -o eval.sh https://huggingface.co/chen459664/quantization2/resolve/0dfd8d2a71a75ba1b625c8e2b4d43e6ad0e22dfd/eval.sh
1.93 kB
| export HTTP_PROXY=http://sys-proxy-rd-relay.byted.org:8118 | |
| export http_proxy=http://sys-proxy-rd-relay.byted.org:8118 | |
| export https_proxy=http://sys-proxy-rd-relay.byted.org:8118 | |
| export no_proxy="$no_proxy,.byteintl.net" | |
| export HF_ENDPOINT=https://hf-mirror.com | |
| cd quantization_metric/ | |
| model_id=/mnt/bn/life-mllm/users/cxr/quantization/models/Qwen/Qwen2.5-14B | |
| model_name=$(basename "$model_id") | |
| cuda_id=4 | |
| model=/mnt/bn/life-mllm/users/cxr/quantization/models/${model_name}-quantization-layer-mlp | |
| # output_dir=Alpha_values_mlp | |
| # bit_layers_dir=/mnt/bn/life-mllm/users/cxr/quantization/quantization_metric/bit_layers | |
| # result_dir=/mnt/bn/life-mllm/users/cxr/quantization/lm-evaluation-harness/results | |
| start=$(date +%s.%N) | |
| # rm -rf $model | |
| modes=("mlp") | |
| for mode in ${modes[@]}; do | |
| for idx in {32..47}; do | |
| echo $mode $idx | |
| cd ../quantization_metric | |
| python -u main.py --bit_layer_idx $idx --save_dir ${model} --mode $mode --model_id $model_id --cuda_id $cuda_id | |
| cd ../lm-evaluation-harness | |
| bash run_scripts/eval_base_qwen2_5_14b.sh ${model} ${mode}_${idx} | |
| rm -rf ${model} | |
| end=$(date +%s.%N) | |
| runtime=$(awk "BEGIN {print $end - $start}") | |
| echo "Execution time: $runtime seconds" | |
| done | |
| done | |
| model=/mnt/bn/life-mllm/users/cxr/quantization/models/${model_name}-quantization-layer | |
| start=$(date +%s.%N) | |
| # rm -rf $model | |
| modes=("self_attn") | |
| for mode in ${modes[@]}; do | |
| for idx in {32..47}; do | |
| echo $mode $idx | |
| cd ../quantization_metric | |
| python -u main.py --bit_layer_idx $idx --save_dir ${model} --mode $mode --model_id $model_id --cuda_id $cuda_id | |
| cd ../lm-evaluation-harness | |
| bash run_scripts/eval_base_qwen2_5_14b.sh ${model} ${mode}_${idx} | |
| rm -rf ${model} | |
| end=$(date +%s.%N) | |
| runtime=$(awk "BEGIN {print $end - $start}") | |
| echo "Execution time: $runtime seconds" | |
| done | |
| done |