Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/prompted robot #550

Merged
merged 22 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions assistant_dists/dream_robot_prompted/cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.7'
services:
combined-classification:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
sentence-ranker:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
6 changes: 6 additions & 0 deletions assistant_dists/dream_robot_prompted/db_conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"host": "DB_HOST",
"port": "DB_PORT",
"name": "DB_NAME",
"env": true
}
50 changes: 50 additions & 0 deletions assistant_dists/dream_robot_prompted/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# С такими volumes удобно дебажить, не нужно пересобирать контейнер каждый раз при изменении кода
services:
agent:
volumes:
- ".:/dp-agent"
ports:
- 4242:4242
sentseg:
volumes:
- "./annotators/SentSeg:/src"
ports:
- 8011:8011
ranking-based-response-selector:
volumes:
- "./response_selectors/ranking_based_response_selector:/src"
- "./common:/src/common"
ports:
- 8002:8002
combined-classification:
volumes:
- "./common:/src/common"
- "./annotators/combined_classification:/src"
ports:
- 8087:8087
sentence-ranker:
volumes:
- "./services/sentence_ranker:/src"
- "~/.deeppavlov/cache:/root/.cache"
ports:
- 8128:8128
prompt-selector:
volumes:
- "./annotators/prompt_selector:/src"
- "./common:/src/common"
ports:
- 8135:8135
openai-api-chatgpt:
volumes:
- "./services/openai_api_lm:/src"
- "./common:/src/common"
ports:
- 8145:8145
dff-robot-prompted-skill:
volumes:
- "./skills/dff_template_prompted_skill:/src"
- "./common:/src/common"
ports:
- 8179:8179

version: "3.7"
151 changes: 151 additions & 0 deletions assistant_dists/dream_robot_prompted/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
services:
agent:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/dream_robot_prompted/pipeline_conf.json'
environment:
WAIT_HOSTS: "sentseg:8011, ranking-based-response-selector:8002, combined-classification:8087,
sentence-ranker:8128, prompt-selector:8135, openai-api-chatgpt:8145,
dff-robot-prompted-skill:8179"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000}
HIGH_PRIORITY_INTENTS: 1
RESTRICTION_FOR_SENSITIVE_CASE: 1
ALWAYS_TURN_ON_ALL_SKILLS: 0
LANGUAGE: EN
FALLBACK_FILE: fallbacks_dream_en.json

sentseg:
env_file: [ .env ]
build:
context: ./annotators/SentSeg/
command: flask run -h 0.0.0.0 -p 8011
environment:
- FLASK_APP=server
deploy:
resources:
limits:
memory: 1.5G
reservations:
memory: 1.5G

combined-classification:
env_file: [ .env ]
build:
args:
CONFIG: combined_classifier.json
SERVICE_PORT: 8087
context: .
dockerfile: ./annotators/combined_classification/Dockerfile
command: gunicorn --workers=1 server:app -b 0.0.0.0:8087 --timeout 600
environment:
- CUDA_VISIBLE_DEVICES=0
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 2G

ranking-based-response-selector:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8002
SERVICE_NAME: response_selector
LANGUAGE: EN
SENTENCE_RANKER_ANNOTATION_NAME: sentence_ranker
SENTENCE_RANKER_SERVICE_URL: http://sentence-ranker:8128/respond
SENTENCE_RANKER_TIMEOUT: 3
N_UTTERANCES_CONTEXT: 5
FILTER_TOXIC_OR_BADLISTED: 1
context: .
dockerfile: ./response_selectors/ranking_based_response_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8002
environment:
- FLASK_APP=server
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M

prompt-selector:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8135
SERVICE_NAME: prompt_selector
N_SENTENCES_TO_RETURN: 3
PROMPTS_TO_CONSIDER: robot
context: .
dockerfile: ./annotators/prompt_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8135
environment:
- FLASK_APP=server
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M

sentence-ranker:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8128
SERVICE_NAME: sentence_ranker
PRETRAINED_MODEL_NAME_OR_PATH: sentence-transformers/all-MiniLM-L6-v2
context: ./services/sentence_ranker/
command: flask run -h 0.0.0.0 -p 8128
environment:
- CUDA_VISIBLE_DEVICES=0
- FLASK_APP=server
deploy:
resources:
limits:
memory: 3G
reservations:
memory: 3G

openai-api-chatgpt:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8145
SERVICE_NAME: openai_api_chatgpt
PRETRAINED_MODEL_NAME_OR_PATH: gpt-3.5-turbo
context: .
dockerfile: ./services/openai_api_lm/Dockerfile
command: flask run -h 0.0.0.0 -p 8145
environment:
- CUDA_VISIBLE_DEVICES=0
- FLASK_APP=server
deploy:
resources:
limits:
memory: 500M
reservations:
memory: 100M

dff-robot-prompted-skill:
env_file: [ .env,.env_secret ]
build:
args:
SERVICE_PORT: 8179
SERVICE_NAME: dff_robot_prompted_skill
PROMPT_FILE: common/prompts/robot.json
GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond
GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json
GENERATIVE_TIMEOUT: 120
N_UTTERANCES_CONTEXT: 7
ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION
context: .
dockerfile: ./skills/dff_template_prompted_skill/Dockerfile
deploy:
resources:
limits:
memory: 128M
reservations:
memory: 128M

version: '3.7'
Loading
Loading