Sadiksmart0 commited on
Commit
04fea66
·
verified ·
1 Parent(s): c69a228

Create start.sh

Browse files
Files changed (1) hide show
  1. start.sh +17 -0
start.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Start Ollama in the background
4
+ ollama serve &
5
+
6
+ # Wait for Ollama to be ready
7
+ until curl -s http://localhost:11434/api/tags >/dev/null; do
8
+ sleep 1
9
+ done
10
+
11
+ # Pull the model if not already present
12
+ if ! ollama list | grep -q "tinyllama"; then
13
+ ollama pull tinyllama
14
+ fi
15
+
16
+ # Start the FastAPI server
17
+ uvicorn app:app --host 0.0.0.0 --port 7860