Skip to content

Commit be6d7c0

Browse files
authored
examples : remove finetune and train-text-from-scratch (#8669)
* examples : remove finetune and train-text-from-scratch * fix build * update help message * fix small typo for export-lora
1 parent 4b0eff3 commit be6d7c0

15 files changed

+14
-4299
lines changed

.devops/nix/apps.nix

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"llama-embedding"
1111
"llama-server"
1212
"llama-quantize"
13-
"llama-train-text-from-scratch"
1413
];
1514
mkApp = name: {
1615
type = "app";

.devops/tools.sh

-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ elif [[ "$arg1" == '--quantize' || "$arg1" == '-q' ]]; then
1313
./llama-quantize "$@"
1414
elif [[ "$arg1" == '--run' || "$arg1" == '-r' ]]; then
1515
./llama-cli "$@"
16-
elif [[ "$arg1" == '--finetune' || "$arg1" == '-f' ]]; then
17-
./llama-finetune "$@"
1816
elif [[ "$arg1" == '--all-in-one' || "$arg1" == '-a' ]]; then
1917
echo "Converting PTH to GGML..."
2018
for i in `ls $1/$2/ggml-model-f16.bin*`; do
@@ -36,8 +34,6 @@ else
3634
echo " ex: --outtype f16 \"/models/7B/\" "
3735
echo " --quantize (-q): Optimize with quantization process ggml"
3836
echo " ex: \"/models/7B/ggml-model-f16.bin\" \"/models/7B/ggml-model-q4_0.bin\" 2"
39-
echo " --finetune (-f): Run finetune command to create a lora finetune of the model"
40-
echo " See documentation for finetune for command-line parameters"
4137
echo " --all-in-one (-a): Execute --convert & --quantize"
4238
echo " ex: \"/models/\" 7B"
4339
echo " --server (-s): Run a model on the server"

Makefile

+4-26
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ BUILD_TARGETS = \
1111
llama-embedding \
1212
llama-eval-callback \
1313
llama-export-lora \
14-
llama-finetune \
1514
llama-gbnf-validator \
1615
llama-gguf \
1716
llama-gguf-hash \
@@ -37,7 +36,6 @@ BUILD_TARGETS = \
3736
llama-simple \
3837
llama-speculative \
3938
llama-tokenize \
40-
llama-train-text-from-scratch \
4139
llama-vdot \
4240
llama-cvector-generator \
4341
tests/test-c.o
@@ -64,13 +62,13 @@ TEST_TARGETS = \
6462
tests/test-tokenizer-1-spm
6563

6664
# Legacy build targets that were renamed in #7809, but should still be removed when the project is cleaned
67-
LEGACY_TARGETS_CLEAN = main quantize quantize-stats perplexity imatrix embedding vdot q8dot train-text-from-scratch convert-llama2c-to-ggml \
65+
LEGACY_TARGETS_CLEAN = main quantize quantize-stats perplexity imatrix embedding vdot q8dot convert-llama2c-to-ggml \
6866
simple batched batched-bench save-load-state server gguf gguf-split eval-callback llama-bench libllava.a llava-cli baby-llama \
69-
retrieval speculative infill tokenize benchmark-matmult parallel finetune export-lora lookahead lookup passkey gritlm
67+
retrieval speculative infill tokenize benchmark-matmult parallel export-lora lookahead lookup passkey gritlm
7068

7169
# Legacy build targets that were renamed in #7809, but we want to build binaries that for them that output a deprecation warning if people try to use them.
7270
# We don't want to clutter things too much, so we only build replacements for the most commonly used binaries.
73-
LEGACY_TARGETS_BUILD = main quantize perplexity embedding server finetune
71+
LEGACY_TARGETS_BUILD = main quantize perplexity embedding server
7472

7573
# Deprecation aliases
7674
ifdef LLAMA_CUBLAS
@@ -1296,11 +1294,6 @@ llama-cvector-generator: examples/cvector-generator/cvector-generator.cpp \
12961294
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
12971295
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
12981296

1299-
llama-train-text-from-scratch: examples/train-text-from-scratch/train-text-from-scratch.cpp \
1300-
$(OBJ_ALL)
1301-
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
1302-
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
1303-
13041297
llama-convert-llama2c-to-ggml: examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp \
13051298
$(OBJ_GGML) $(OBJ_LLAMA)
13061299
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
@@ -1316,11 +1309,6 @@ llama-baby-llama: examples/baby-llama/baby-llama.cpp \
13161309
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
13171310
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
13181311

1319-
llama-finetune: examples/finetune/finetune.cpp \
1320-
$(OBJ_ALL)
1321-
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
1322-
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
1323-
13241312
llama-export-lora: examples/export-lora/export-lora.cpp \
13251313
$(OBJ_ALL)
13261314
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
@@ -1578,7 +1566,7 @@ llama-q8dot: pocs/vdot/q8dot.cpp ggml/src/ggml.o \
15781566
# Deprecated binaries that we want to keep around long enough for people to migrate to the new filenames, then these can be removed.
15791567
#
15801568
# Mark legacy binary targets as .PHONY so that they are always checked.
1581-
.PHONY: main quantize perplexity embedding server finetune
1569+
.PHONY: main quantize perplexity embedding server
15821570

15831571
# NOTE: We currently will always build the deprecation-warning `main` and `server` binaries to help users migrate.
15841572
# Eventually we will want to remove these target from building all the time.
@@ -1621,13 +1609,3 @@ ifneq (,$(wildcard embedding))
16211609
@echo " Remove the 'embedding' binary to remove this warning."
16221610
@echo "#########"
16231611
endif
1624-
1625-
finetune: examples/deprecation-warning/deprecation-warning.cpp
1626-
ifneq (,$(wildcard finetune))
1627-
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
1628-
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
1629-
@echo "#########"
1630-
@echo "WARNING: The 'finetune' binary is deprecated. Please use 'llama-finetune' instead."
1631-
@echo " Remove the 'finetune' binary to remove this warning."
1632-
@echo "#########"
1633-
endif

examples/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ else()
2121
add_subdirectory(embedding)
2222
add_subdirectory(eval-callback)
2323
add_subdirectory(export-lora)
24-
add_subdirectory(finetune)
2524
add_subdirectory(gbnf-validator)
2625
add_subdirectory(gguf-hash)
2726
add_subdirectory(gguf-split)
@@ -53,5 +52,4 @@ else()
5352
add_subdirectory(simple)
5453
add_subdirectory(speculative)
5554
add_subdirectory(tokenize)
56-
add_subdirectory(train-text-from-scratch)
5755
endif()

examples/deprecation-warning/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Please update all scripts and workflows to use the new binary names.
1313
| server | llama-server |
1414
| llama-bench | llama-bench |
1515
| embedding | llama-embedding |
16-
| finetune | llama-finetune |
1716
| quantize | llama-quantize |
1817
| tokenize | llama-tokenize |
1918
| export-lora | llama-export-lora |
@@ -45,7 +44,6 @@ Please update all scripts and workflows to use the new binary names.
4544
| save-load-state | llama-save-load-state |
4645
| simple | llama-simple |
4746
| speculative | llama-speculative |
48-
| train-text-from-scratch | llama-train-text-from-scratch |
4947
| vdot | llama-vdot |
5048
| tests/test-c.o | tests/test-c.o |
5149

examples/export-lora/README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ For example:
1919
./bin/llama-export-lora \
2020
-m open-llama-3b-v2-q8_0.gguf \
2121
-o open-llama-3b-v2-q8_0-english2tokipona-chat.gguf \
22-
--lora lora-open-llama-3b-v2-q8_0-english2tokipona-chat-LATEST.bin
22+
--lora lora-open-llama-3b-v2-q8_0-english2tokipona-chat-LATEST.gguf
2323
```
2424

25-
Multiple LORA adapters can be applied by passing multiple `--lora FNAME` or `--lora-scaled FNAME S` command line parameters.
25+
Multiple LORA adapters can be applied by passing multiple `--lora FNAME` or `--lora-scaled FNAME S` command line parameters:
26+
27+
```bash
28+
./bin/llama-export-lora \
29+
-m your_base_model.gguf \
30+
-o your_merged_model.gguf \
31+
--lora-scaled lora_task_A.gguf 0.5 \
32+
--lora-scaled lora_task_B.gguf 0.5
33+
```

examples/finetune/CMakeLists.txt

-5
This file was deleted.

examples/finetune/README.md

-90
This file was deleted.

0 commit comments

Comments
 (0)