SkyNetWalker commited on
Commit
36269ba
·
verified ·
1 Parent(s): 5506c9f

Update run.sh

Browse files
Files changed (1) hide show
  1. run.sh +10 -19
run.sh CHANGED
@@ -1,25 +1,16 @@
1
  #!/bin/bash
2
 
3
- # Exit immediately if a command exits with a non-zero status.
4
- set -e
5
-
6
- # Start the Ollama server in the background.
7
- # The OLLAMA_HOST environment variable is already set in the Dockerfile, so it will listen on all interfaces.
8
  ollama serve &
9
 
10
- # Wait for the Ollama server to become available.
11
- echo "Waiting for Ollama to start..."
12
- while ! curl -s http://localhost:11434 > /dev/null; do
13
- sleep 1
14
- done
15
- echo "Ollama started."
16
 
17
- # Create the model from the Modelfile. This registers the downloaded GGUF file with Ollama.
18
- # 'gemma-unsloth' is the name we will use to refer to this model in our application.
19
- echo "Creating model 'create gemma3_4b_it_qat'..."
20
- ollama create gemma3_4b_it_qat -f Modelfile
21
- echo "Model created."
22
 
23
- # Run the Gradio application.
24
- # It will connect to the Ollama server running on localhost.
25
- python app.py
 
1
  #!/bin/bash
2
 
3
+ # Start the Ollama server in the background
 
 
 
 
4
  ollama serve &
5
 
6
+ # Wait a few seconds for the server to be fully operational
7
+ sleep 5
 
 
 
 
8
 
9
+ # Pull the model from Hugging Face.
10
+ # This command downloads the model and makes it available to the API.
11
+ # It's the non-interactive version of "ollama run".
12
+ ollama pull hf.co/unsloth/gemma-3-4b-it-qat-GGUF:Q4_K_M
 
13
 
14
+ # Start the Gradio web application
15
+ # This will connect to the Ollama server which is already running.
16
+ python3 app.py