Skip to content

Commit 75b3330

Browse files
authored
Merge pull request #1 from paolorechia/andromeda
Andromeda
2 parents a0ab1f9 + cb04dbb commit 75b3330

File tree

21 files changed

+236
-153
lines changed

21 files changed

+236
-153
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
models

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
models
12
**/node_modules/**
23

34
# Byte-compiled / optimized / DLL files

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,50 @@ NOTE: main is currently unstable, developing the use of guidance prompts (see gu
66

77
**WARNING**: Only add docstring to functions command is somewhat stable at the moment.
88

9+
## v0.2.0
10+
**Update: 03.06.2023**
11+
The guidance server code has been moved to a separate repository: https://github.com/ChuloAI/andromeda-chain
12+
13+
If you're looking for the code version from Medium Article, try checking out v0.1.3 (more in next section).
14+
15+
Starting this service now happens through Docker, and should be a lot easier.
16+
17+
18+
### Setup
19+
20+
21+
Requirements:
22+
23+
- docker-engine
24+
- docker-compose v2
25+
26+
If using GPU also:
27+
28+
- nvidia-docker: https://github.com/NVIDIA/nvidia-docker
29+
30+
31+
#### Clone this repo and download your desired model:
32+
```bash
33+
git clone https://github.com/paolorechia/oasis
34+
cd oasis
35+
mkdir models
36+
cd models
37+
git clone https://huggingface.co/Salesforce/codegen-350M-mono
38+
cd ..
39+
docker-compose -f docker-compose.cpu.yaml up
40+
```
41+
42+
##### Running on GPU
43+
44+
Change the command to use the other docker-compose file:
45+
46+
```
47+
docker-compose -f docker-compose.cpu.yaml up
48+
```
49+
50+
51+
52+
953
## If using v0.1.3
1054
If you want to use text-generation-webui with simpler prompts, use v0.1.3. This is a deprecated feature, newer versions will no longer support `text-generation-webui`, at least for the time being.
1155

docker-compose.cpu.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: '3'
2+
services:
3+
prompt-server:
4+
build:
5+
context: prompt_server/
6+
dockerfile: Dockerfile
7+
ports:
8+
- "9000:9000"
9+
volumes:
10+
- ./models:/models
11+
- ./prompt_server:/code
12+
# Add the "labels" section to set the container to remove itself on shutdown
13+
labels:
14+
- "com.docker.compose.container-name=guidance-server"
15+
- "com.docker.compose.service=guidance-server"
16+
- "com.docker.compose.oneoff=False"
17+
- "com.docker.compose.project=guidance-server"
18+
# Add the "stop_signal: SIGINT" option to use SIGINT signal for stopping the container gracefully
19+
stop_signal: SIGINT
20+
environment:
21+
MODEL_PATH: /models/codegen-350M-mono
22+
GUIDANCE_URL: http://guidance:9000
23+
restart: unless-stopped
24+
networks:
25+
- oasis
26+
27+
guidance:
28+
image: paolorechia/guidance_server:cpu-0.1
29+
ports:
30+
- "9090:9000"
31+
volumes:
32+
- ./models:/models
33+
# Add the "labels" section to set the container to remove itself on shutdown
34+
labels:
35+
- "com.docker.compose.container-name=guidance-server"
36+
- "com.docker.compose.service=guidance-server"
37+
- "com.docker.compose.oneoff=False"
38+
- "com.docker.compose.project=guidance-server"
39+
# Add the "stop_signal: SIGINT" option to use SIGINT signal for stopping the container gracefully
40+
stop_signal: SIGINT
41+
environment:
42+
MODEL_PATH: /models/codegen-350M-mono
43+
restart: unless-stopped
44+
networks:
45+
- oasis
46+
47+
networks:
48+
oasis:
49+
name: oasis-network

docker-compose.gpu.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
version: '3'
2+
services:
3+
prompt-server:
4+
build:
5+
context: prompt_server/
6+
dockerfile: Dockerfile
7+
ports:
8+
- "9000:9000"
9+
volumes:
10+
- ./models:/models
11+
- ./prompt_server:/code
12+
# Add the "labels" section to set the container to remove itself on shutdown
13+
labels:
14+
- "com.docker.compose.container-name=guidance-server"
15+
- "com.docker.compose.service=guidance-server"
16+
- "com.docker.compose.oneoff=False"
17+
- "com.docker.compose.project=guidance-server"
18+
# Add the "stop_signal: SIGINT" option to use SIGINT signal for stopping the container gracefully
19+
stop_signal: SIGINT
20+
environment:
21+
MODEL_PATH: /models/codegen-350M-mono
22+
GUIDANCE_URL: http://guidance:9000
23+
restart: unless-stopped
24+
networks:
25+
- oasis
26+
27+
guidance:
28+
image: paolorechia/guidance_server:gpu-0.1
29+
ports:
30+
- "9090:9000"
31+
volumes:
32+
- ./models:/models
33+
# Add the "labels" section to set the container to remove itself on shutdown
34+
labels:
35+
- "com.docker.compose.container-name=guidance-server"
36+
- "com.docker.compose.service=guidance-server"
37+
- "com.docker.compose.oneoff=False"
38+
- "com.docker.compose.project=guidance-server"
39+
# Add the "stop_signal: SIGINT" option to use SIGINT signal for stopping the container gracefully
40+
stop_signal: SIGINT
41+
environment:
42+
MODEL_PATH: /models/codegen-350M-mono
43+
deploy:
44+
resources:
45+
limits:
46+
memory: 28000M
47+
reservations:
48+
devices:
49+
- driver: nvidia
50+
count: all
51+
capabilities: [gpu]
52+
restart_policy:
53+
condition: on-failure
54+
delay: 5s
55+
max_attempts: 3
56+
window: 120s
57+
networks:
58+
- oasis
59+
60+
networks:
61+
oasis:
62+
name: oasis-network

guidance_server/log.txt

Whitespace-only changes.

guidance_server/main.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

guidance_server/requirements.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

guidance_server/start_uvicorn.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

playground.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
3+
def sum(a, b):
4+
return a + b
5+
6+
7+
if __name__ == "__main__":
8+
def multiply(a, b):
9+
return a * b

0 commit comments

Comments
 (0)