Team Ai
Apppublic

shell2k/test1

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
start.sh37 linesDownload Raw Back to root
1#!/bin/bash2 3# Set environment variables for optimization4export OMP_NUM_THREADS=45export MKL_NUM_THREADS=46export CUDA_VISIBLE_DEVICES=07 8# Start Ollama in the background9ollama serve &10 11# Pull the model if not already present12if ! ollama list | grep -q "tinyllama"; then13    ollama pull tinyllama14fi15# if ! ollama list | grep -q "MobileLLM-R1-950M-base"; then16#     ollama pull MobileLLM-R1-950M-base17# fi18# Wait for Ollama to start up19max_attempts=3020attempt=021while ! curl -s http://localhost:11434/api/tags >/dev/null; do22    sleep 123    attempt=$((attempt + 1))24    if [ $attempt -eq $max_attempts ]; then25        echo "Ollama failed to start within 30 seconds. Exiting."26        exit 127    fi28done29 30echo "Ollama is ready."31 32# Print the API URL33echo "API is running on: http://0.0.0.0:7860"34 35# Start the FastAPI server36uvicorn app:app --host 0.0.0.0 --port 7860 --workers 4 --limit-concurrency 2037