Skip to content

Commit 3c4f491

Browse files
committed
Add Dockerfile for artificial general intelligence
1 parent 929b809 commit 3c4f491

File tree

7 files changed

+94
-0
lines changed

7 files changed

+94
-0
lines changed

agi/.devcontainer/compose.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
networks:
2+
agi:
3+
name: agi
4+
driver: bridge
5+
ipam:
6+
driver: default
7+
config:
8+
- subnet: "172.30.0.0/24"
9+
gateway: "172.30.0.1"
10+
11+
services:
12+
13+
torch:
14+
image: torch_ubuntu:latest
15+
hostname: torch
16+
environment:
17+
- OLLAMA_HOST=172.30.0.2
18+
- OLLAMA_MODELS=/opt
19+
- LANG=C.UTF-8
20+
- PYTHONPATH=/ve
21+
volumes:
22+
- ../:/agi
23+
ports:
24+
- 11434:11434
25+
command: ollama serve
26+
networks:
27+
- agi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "agi deepseek",
3+
"dockerComposeFile": "compose.yaml",
4+
"workspaceFolder": "/agi",
5+
"shutdownAction": "stopCompose",
6+
"service": "torch",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"charliermarsh.ruff",
11+
"esbenp.prettier-vscode"
12+
]
13+
}
14+
}
15+
}

agi/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ARG BUILD_FROM=ubuntu:24.04
2+
3+
FROM $BUILD_FROM
4+
5+
ARG \
6+
ENV_DIR=/ve
7+
8+
RUN set -eux;\
9+
apt-get update;\
10+
apt-get install -y --no-install-recommends tzdata curl iputils-ping net-tools;\
11+
apt-get install -y --no-install-recommends python3 python3-venv python3-pip;\
12+
python3 -m venv $ENV_DIR;\
13+
$ENV_DIR/bin/pip install --no-cache-dir torch datasets;\
14+
curl -fsSL https://ollama.com/install.sh | sh
15+
16+
ENV \
17+
PATH="${ENV_DIR}/bin:$PATH" \
18+
TZ="Europe/Paris"
19+
20+

agi/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build the image
2+
3+
```
4+
sudo docker build -t torch_ubuntu .
5+
```
6+
7+
then open the folder in vscode and rebuild in container with CTRL+SHIFT+P
8+
9+
select the appropriate interpreter again with CTRL+SHIFT+P and enter `interpreter` in the command palette, so that pylance can find Pyl all venv modules
10+
11+
[](images/select_interpreter.png)
12+
13+
# download the model
14+
15+
```
16+
ollama pull deepseek-r1:1.5b
17+
```
18+
19+
```
20+
ollama run deepseek-r1:1.5b "tu parles français ?"
21+
ollama run deepseek-r1:1.5b "factorise l'équation 3x^2 + 5x - 2"
22+
```
23+
24+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ https://medium.com/@suvarnaptaware/deepseek-step-by-step-guide-48c8fe3be7db
88

99
https://www.datacamp.com/blog/deepseek-r1
1010

11+
https://www.datacamp.com/tutorial/deepseek-r1-ollama
12+
1113
https://deepseekcoder.github.io/
1214

1315
https://github.com/deepseek-ai

agi/images/select_interpreter.png

25.1 KB
Loading

agi/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from datasets import load_dataset
2+
3+
dataset_name = "ruslanmv/ai-medical-chatbot"
4+
dataset = load_dataset(dataset_name, split="all")
5+
6+
print(dataset[0])

0 commit comments

Comments
 (0)