Skip to content

Commit d64247c

Browse files
committed
Bindings: Format and update scripts
Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
1 parent 686bb85 commit d64247c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bindings/binding.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ std::optional<std::string> TokenToPiece(const llama_model* llamaModel, const lla
586586
n_chars = llama_token_to_piece(&llamaModel->vocab, id, piece.data(), piece.size(), 0, decodeSpecial);
587587
if (n_chars < 0) {
588588
// This should never happen if we sized correctly
589-
std::cerr << "error: failed to convert token to piece in TokenToPiece()" << std::endl;
589+
std::cerr << "error: failed to convert token " << id << " to piece in TokenToPiece()" << std::endl;
590590
return std::nullopt;
591591
}
592592
}

bindings/bindings.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/bash
22

3+
OS=$(uname -s)
4+
35
# Set number of jobs for parallel build
46
if [ -n "$MAX_JOBS" ]; then
57
JOBS=$MAX_JOBS
8+
elif [ "$OS" = "Darwin" ]; then
9+
JOBS=$(sysctl -n hw.physicalcpu)
610
else
711
JOBS=$(nproc --all)
812
fi
@@ -27,8 +31,6 @@ CMAKE_ARGS="${EXTRA_CMAKE_ARGS[*]}"
2731
cmake . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
2832
cmake --build build --config Release --target deno_cpp_binding -j ${JOBS}
2933

30-
OS=$(uname -s)
31-
3234
if [ "$OS" = "Darwin" ]; then
3335
echo "Copying .dylib files"
3436
cp build/bin/*.dylib ../lib

0 commit comments

Comments
 (0)