mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
* examples : add model conversion tool/example This commit adds an "example/tool" that is intended to help in the process of converting models to GGUF. Currently it supports normal causal models and embedding models. The readme contains instructions and command to guide through the process. The motivation for this to have a structured and repeatable process for model conversions and hopefully with time improve upon it to make the process easier and more reliable. We have started to use this for new model conversions internally and will continue doing so and improve it as we go along. Perhaps with time this should be placed in a different directory than the examples directory, but for now it seems like a good place to keep it while we are still developing it. * squash! examples : add model conversion tool/example Remove dependency on scikit-learn in model conversion example. * squash! examples : add model conversion tool/example Update transformer dep to use non-dev version. And also import `AutoModelForCausalLM` instead of `AutoModel` to ensure compatibility with the latest version. * squash! examples : add model conversion tool/example Remove the logits requirements file from the all requirements file.
20 lines
563 B
Bash
Executable file
20 lines
563 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# First try command line argument, then environment variable, then file
|
|
CONVERTED_MODEL="${1:-"$CONVERTED_EMBEDDING_MODEL"}"
|
|
|
|
# Final check if we have a model path
|
|
if [ -z "$CONVERTED_MODEL" ]; then
|
|
echo "Error: Model path must be provided either as:" >&2
|
|
echo " 1. Command line argument" >&2
|
|
echo " 2. CONVERTED_EMBEDDING_MODEL environment variable" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo $CONVERTED_MODEL
|
|
|
|
cmake --build ../../build --target llama-logits -j8
|
|
|
|
../../build/bin/llama-logits -m "$CONVERTED_MODEL" -embd-mode "Hello world today"
|