mirror of
https://github.com/mudler/LocalAI.git
synced 2026-06-14 11:49:33 -04:00
* feat(backend): add locate-anything-cpp backend (open-vocab detection via la_capi) A Go/purego backend wrapping locate-anything.cpp's la_capi C ABI, implementing the gRPC Detect RPC: image + open-vocabulary text prompt -> labeled boxes. Mirrors backend/go/rfdetr-cpp; static-links ggml into a per-CPU-variant .so. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * ci(backend): register locate-anything-cpp in build matrix Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * feat(gallery): locate-anything gallery entry + model importer Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * test(backend): locate-anything-cpp Load+Detect wire test Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * feat(gallery): add locate-anything-3b model to the gallery index Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * ci(backend): register locate-anything.cpp in bump_deps auto-bump Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: mudler <mudler@localai.io> * ci(test): e2e smoke for locate-anything-cpp in test-extra (loads the 3B + image, runs Detect) Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: mudler <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Signed-off-by: mudler <mudler@localai.io> Co-authored-by: mudler <mudler@localai.io>
53 lines
1.3 KiB
Bash
Executable File
53 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
|
|
# Get the absolute current dir where the script is located
|
|
CURDIR=$(dirname "$(realpath $0)")
|
|
|
|
cd /
|
|
|
|
echo "CPU info:"
|
|
if [ "$(uname)" != "Darwin" ]; then
|
|
grep -e "model\sname" /proc/cpuinfo | head -1
|
|
grep -e "flags" /proc/cpuinfo | head -1
|
|
fi
|
|
|
|
LIBRARY="$CURDIR/liblocateanythingcpp-fallback.so"
|
|
|
|
if [ "$(uname)" != "Darwin" ]; then
|
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
|
echo "CPU: AVX found OK"
|
|
if [ -e $CURDIR/liblocateanythingcpp-avx.so ]; then
|
|
LIBRARY="$CURDIR/liblocateanythingcpp-avx.so"
|
|
fi
|
|
fi
|
|
|
|
if grep -q -e "\savx2\s" /proc/cpuinfo ; then
|
|
echo "CPU: AVX2 found OK"
|
|
if [ -e $CURDIR/liblocateanythingcpp-avx2.so ]; then
|
|
LIBRARY="$CURDIR/liblocateanythingcpp-avx2.so"
|
|
fi
|
|
fi
|
|
|
|
# Check avx 512
|
|
if grep -q -e "\savx512f\s" /proc/cpuinfo ; then
|
|
echo "CPU: AVX512F found OK"
|
|
if [ -e $CURDIR/liblocateanythingcpp-avx512.so ]; then
|
|
LIBRARY="$CURDIR/liblocateanythingcpp-avx512.so"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
export LOCATEANYTHING_LIBRARY=$LIBRARY
|
|
|
|
# If there is a lib/ld.so, use it
|
|
if [ -f $CURDIR/lib/ld.so ]; then
|
|
echo "Using lib/ld.so"
|
|
echo "Using library: $LIBRARY"
|
|
exec $CURDIR/lib/ld.so $CURDIR/locate-anything-cpp "$@"
|
|
fi
|
|
|
|
echo "Using library: $LIBRARY"
|
|
exec $CURDIR/locate-anything-cpp "$@"
|