Zack Saadioui
8/27/2024
1
2
bash
docker pull tensorflow/serving
1
2
bash
docker images
1
2
3
bash
curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama
chmod +x /usr/bin/ollama
1
2
bash
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
1
/usr/lib/systemd/system/ollama.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
bash
sudo tee /usr/lib/systemd/system/ollama.service > /dev/null <<EOF
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="OLLAMA_HOST=0.0.0.0"
Environment="OLLAMA_ORIGINS=*"
[Install]
WantedBy=default.target
EOF
1
2
3
4
bash
sudo systemctl daemon-reload
sudo systemctl enable ollama
sudo systemctl start ollama
1
http://127.0.0.1:11434
1
SavedModel
1
2
3
4
5
bash
docker run -t --rm -p 8501:8501 \
-v "$TESTDATA/saved_model_half_plus_two_cpu:/models/half_plus_two" \
-e MODEL_NAME=half_plus_two \
tensorflow/serving &
1
2
3
4
bash
curl -d '{"instances": [1.0, 2.0, 5.0]}' \
-H 'Content-Type: application/json' \
-X POST http://localhost:8501/v1/models/half_plus_two:predict
1 2 3 4 5 6
import requests url = 'http://127.0.0.1:11434/predict' input_data = {'input': 'My Question Here'} response = requests.post(url, json=input_data) print(response.json())
1
could not select device driver
Copyright © Arsturn 2024