|
10 | 10 | fi |
11 | 11 |
|
12 | 12 |
|
13 | | -run_llama_cli() { |
| 13 | +run_conversion_and_inference_lora() { |
14 | 14 | local model_name=$1 |
15 | | - local size=$2 |
16 | | - local model_size=$3 |
| 15 | + local size_matrix=$2 |
| 16 | + local model_size_mb=$3 |
17 | 17 |
|
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 |
20 | 20 |
|
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 |
23 | 23 |
|
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 |
26 | 26 |
|
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 |
29 | 29 |
|
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!" |
31 | 33 | } |
32 | 34 |
|
33 | 35 | # Example usage: |
34 | | -run_llama_cli "Gemma2ForCausalLM" "64" "19M" |
| 36 | +run_conversion_and_inference_lora "Gemma2ForCausalLM" "64" "19M" |
35 | 37 |
|
0 commit comments