84 lines
1.9 KiB
Bash
84 lines
1.9 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
BUILD_DIR="$(pwd)/qwentts-src"
|
|
BIN_DIR="$(pwd)/bin-vulkan"
|
|
|
|
echo "=== Qwentts.cpp Build Script for Vulkan ==="
|
|
echo ""
|
|
|
|
# Step 1: Install dependencies
|
|
echo "[1/5] Installing build dependencies..."
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
cmake \
|
|
git \
|
|
libvulkan-dev \
|
|
vulkan-tools \
|
|
glslc \
|
|
spirv-tools \
|
|
pkg-config
|
|
|
|
# Step 2: Clone qwentts.cpp with submodules
|
|
echo ""
|
|
echo "[2/5] Cloning qwentts.cpp repository with submodules..."
|
|
if [ -d "$BUILD_DIR" ]; then
|
|
rm -rf "$BUILD_DIR"
|
|
fi
|
|
git clone --recurse-submodules https://github.com/ServeurpersoCom/qwentts.cpp "$BUILD_DIR"
|
|
cd "$BUILD_DIR"
|
|
|
|
# Step 3: Build with Vulkan backend
|
|
echo ""
|
|
echo "[3/5] Building qwentts with Vulkan support..."
|
|
./buildvulkan.sh
|
|
|
|
# Step 4: Copy binaries to bin-vulkan/
|
|
echo ""
|
|
echo "[4/5] Copying binaries to bin-vulkan/..."
|
|
if [ -d "$BIN_DIR" ]; then
|
|
rm -rf "$BIN_DIR"
|
|
fi
|
|
mkdir -p "$BIN_DIR"
|
|
|
|
# Copy executables
|
|
cp build/qwen-tts "$BIN_DIR/"
|
|
cp build/qwen-codec "$BIN_DIR/"
|
|
|
|
# Copy any shared libraries if they exist
|
|
if [ -d "build/lib" ]; then
|
|
cp -r build/lib "$BIN_DIR/"
|
|
fi
|
|
|
|
# Step 5: Create entrypoint script
|
|
echo ""
|
|
echo "[5/5] Creating entrypoint script..."
|
|
cat > "$(pwd)/../entrypoint.sh" <<'ENTRYPOINT_EOF'
|
|
#!/bin/bash
|
|
set -e
|
|
|
|
# Export Vulkan driver path
|
|
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json
|
|
export LD_LIBRARY_PATH=/app/lib:$LD_LIBRARY_PATH
|
|
|
|
# Default to help if no arguments
|
|
if [ $# -eq 0 ]; then
|
|
/app/bin/qwen-tts --help
|
|
else
|
|
exec "$@"
|
|
fi
|
|
ENTRYPOINT_EOF
|
|
|
|
chmod +x "$(pwd)/../entrypoint.sh"
|
|
|
|
echo ""
|
|
echo "=== Build Complete ==="
|
|
echo "Binaries are in: $BIN_DIR"
|
|
echo "Models should be placed in: $(pwd)/../models/"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Download models: https://huggingface.co/Serveurperso/Qwen3-TTS-GGUF"
|
|
echo "2. Build Podman image: podman build -t qwentts:vulkan-amd64 -f qwentts-vulkan.Containerfile ."
|
|
echo "3. Test: podman run --rm qwentts:vulkan-amd64"
|