forked from ggerganov/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a simple program to provide a deprecation warning that can exi…
…st to help people notice the binary name change from ggerganov#7809 and migrate to the new filenames.
- Loading branch information
Showing
3 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Migration notice for binary filenames | ||
|
||
> [!IMPORTANT] | ||
[2024 Jun 12] Binaries have been renamed w/ a `llama-` prefix. `main` is now `llama-cli`, `server` is `llama-server`, etc (https://github.com/ggerganov/llama.cpp/pull/7809) | ||
|
||
This migration is long-overdue, but it is a breaking change that may not always be immediately obvious. | ||
|
||
Please update all scripts and workflows to use the new binary names. | ||
|
||
| Old Filename | New Filename | | ||
| ---- | ---- | | ||
| main | llama-cli | | ||
| server | llama-server | | ||
| llama-bench | llama-bench | | ||
| embedding | llama-embedding | | ||
| finetune | llama-finetune | | ||
| quantize | llama-quantize | | ||
| tokenize | llama-tokenize | | ||
| export-lora | llama-export-lora | | ||
| libllava.a | libllava.a | | ||
| baby-llama | llama-baby-llama | | ||
| batched | llama-batched | | ||
| batched-bench | llama-batched-bench | | ||
| benchmark-matmult | llama-benchmark-matmult | | ||
| convert-llama2c-to-ggml | llama-convert-llama2c-to-ggml | | ||
| eval-callback | llama-eval-callback | | ||
| gbnf-validator | llama-gbnf-validator | | ||
| gguf | llama-gguf | | ||
| gguf-split | llama-gguf-split | | ||
| gritlm | llama-gritlm | | ||
| imatrix | llama-imatrix | | ||
| infill | llama-infill | | ||
| llava-cli | llama-llava-cli | | ||
| lookahead | llama-lookahead | | ||
| lookup | llama-lookup | | ||
| lookup-create | llama-lookup-create | | ||
| lookup-merge | llama-lookup-merge | | ||
| lookup-stats | llama-lookup-stats | | ||
| parallel | llama-parallel | | ||
| passkey | llama-passkey | | ||
| perplexity | llama-perplexity | | ||
| q8dot | llama-q8dot | | ||
| quantize-stats | llama-quantize-stats | | ||
| retrieval | llama-retrieval | | ||
| save-load-state | llama-save-load-state | | ||
| simple | llama-simple | | ||
| speculative | llama-speculative | | ||
| train-text-from-scratch | llama-train-text-from-scratch | | ||
| vdot | llama-vdot | | ||
| tests/test-c.o | tests/test-c.o | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Warns users that this filename was deprecated, and provides a link for more information. | ||
// If the name of the file matches a name in a lookup table, then provide the replacement name as well. | ||
|
||
#include <cstdio> | ||
#include <string> | ||
#include <unordered_map> | ||
|
||
// Main | ||
int main(int argc, char** argv) { | ||
std::string filename = "main"; | ||
if (argc >= 1) { | ||
filename = argv[0]; | ||
} | ||
|
||
// Get only the program name from the full path | ||
auto pos = filename.find_last_of('/'); | ||
if (pos != std::string::npos) { | ||
filename = filename.substr(pos+1); | ||
} | ||
|
||
// Append "llama-" to the beginning of filename to get the replacemnt filename | ||
auto replacement_filename = "llama-" + filename; | ||
|
||
// If filename is "main", then our replacement filename is llama-cli | ||
if (filename == "main") { | ||
replacement_filename = "llama-cli"; | ||
} | ||
|
||
fprintf(stdout, "\n"); | ||
fprintf(stdout, "WARNING: The binary '%s' is deprecated.\n", filename.c_str()); | ||
fprintf(stdout, " Please use '%s' instead.\n", replacement_filename.c_str()); | ||
fprintf(stdout, " See https://github.com/ggerganov/llama.cpp/tree/master/examples/deprecation-warning for more information.\n"); | ||
fprintf(stdout, "\n"); | ||
|
||
return EXIT_FAILURE; | ||
} |