Team Ai
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 19d agoView on Hugging Face
0likes1.2kdownloads
dev.sh62 linesDownload Raw Back to scripts
1#!/bin/bash2 3# Development script for llama-ui4#5# This script starts the llama-ui development servers (Storybook and Vite).6# Note: You need to start llama-server separately.7#8# Usage:9#   bash scripts/dev.sh10#   npm run dev11 12cd ../../13 14# Ensure node_modules are installed15if [ ! -d "tools/ui/node_modules" ]; then16    echo "๐Ÿ“ฆ Installing npm dependencies..."17    cd tools/ui && npm ci && cd ../../18fi19 20# Check and install git hooks if missing21check_and_install_hooks() {22    local hooks_missing=false23 24    # Check for required hooks25    if [ ! -f ".git/hooks/pre-commit" ] || [ ! -f ".git/hooks/pre-push" ]; then26        hooks_missing=true27    fi28 29    if [ "$hooks_missing" = true ]; then30        echo "๐Ÿ”ง Git hooks missing, installing them..."31        if bash "$(dirname "$0")/git-hooks/install.sh"; then32            echo "โœ… Git hooks installed successfully"33        else34            echo "โš ๏ธ  Failed to install git hooks, continuing anyway..."35        fi36    else37        echo "โœ… Git hooks already installed"38    fi39}40 41# Install git hooks if needed42check_and_install_hooks43 44# Cleanup function45cleanup() {46    echo "๐Ÿงน Cleaning up..."47    exit48}49 50# Set up signal handlers51trap cleanup SIGINT SIGTERM52 53echo "๐Ÿš€ Starting development servers..."54echo "๐Ÿ“ Note: Make sure to start llama-server separately if needed"55cd tools/ui56# Use --insecure-http-parser to handle malformed HTTP responses from llama-server57# (some responses have both Content-Length and Transfer-Encoding headers)58storybook dev -p 6006 --ci & NODE_OPTIONS="--insecure-http-parser" vite dev --host 0.0.0.0 &59 60# Wait for all background processes61wait62