Skip to content

Commit f249ca4

Browse files
author
Lorenzo Toniazzi
committed
E2E with gemma-2 (still issues with lora)
1 parent d5fc30b commit f249ca4

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

tests/test_lora_conversion_and_inference.sh

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,28 @@ else
1010
fi
1111

1212

13-
run_llama_cli() {
13+
run_conversion_and_inference_lora() {
1414
local model_name=$1
15-
local size=$2
16-
local model_size=$3
15+
local size_matrix=$2
16+
local model_size_mb=$3
1717

18-
echo "Running convert_hf_to_gguf.py for $model_name with size $size..."
19-
python convert_hf_to_gguf.py reduce-llms-for-testing/$model_name/size=$size/base --outtype f32
18+
echo "Running convert_hf_to_gguf.py for $model_name with size $size_matrix..."
19+
python convert_hf_to_gguf.py reduce-llms-for-testing/$model_name/size=$size_matrix/base --outtype f32
2020

21-
echo "Running convert_lora_to_gguf.py for $model_name with size $size..."
22-
python3 convert_lora_to_gguf.py reduce-llms-for-testing/$model_name/size=$size/lora --base reduce-llms-for-testing/$model_name/size=$size/base --outtype f32
21+
echo "Running convert_lora_to_gguf.py for $model_name with size $size_matrix..."
22+
python3 convert_lora_to_gguf.py reduce-llms-for-testing/$model_name/size=$size_matrix/lora --base reduce-llms-for-testing/$model_name/size=$size_matrix/base --outtype f32
2323

24-
echo "Running llama-cli without lora for $model_name with size $size and model size $model_size..."
25-
llama-cli -m reduce-llms-for-testing/$model_name/size=$size/base/Base-$model_size-F32.gguf -p "<bos>When forty winters shall besiege" -n 50
24+
echo "Running llama-cli without lora for $model_name with size $size_matrix and model size $model_size_mb..."
25+
llama-cli -m reduce-llms-for-testing/$model_name/size=$size_matrix/base/Base-$model_size_mb-F32.gguf -p "<bos>When forty winters shall besiege" -n 50
2626

27-
echo "Running llama-cli with lora for $model_name with size $size and model size $model_size..."
28-
llama-cli -m reduce-llms-for-testing/$model_name/size=$size/base/Base-$model_size-F32.gguf --lora reduce-llms-for-testing/$model_name/size=$size/lora/Lora-F32-LoRA.gguf -p "<bos>I see a " -n 50
27+
echo "Running llama-cli with lora for $model_name with size $size_matrix and model size $model_size_mb..."
28+
llama-cli -m reduce-llms-for-testing/$model_name/size=$size_matrix/base/Base-$model_size_mb-F32.gguf --lora reduce-llms-for-testing/$model_name/size=$size_matrix/lora/Lora-F32-LoRA.gguf -p "<bos>I see a " -n 50
2929

30-
echo "All steps completed for $model_name with size $size and model size $model_size!"
30+
# TODO add merge lora with lora-export and check
31+
32+
echo "All steps completed for $model_name with size $size_matrix and model size $model_size_mb!"
3133
}
3234

3335
# Example usage:
34-
run_llama_cli "Gemma2ForCausalLM" "64" "19M"
36+
run_conversion_and_inference_lora "Gemma2ForCausalLM" "64" "19M"
3537

0 commit comments

Comments
 (0)