diff --git a/assistant_dists/deepy_assistant/cpu.yml b/assistant_dists/deepy_assistant/cpu.yml index 00a3f63ae7..3362e09ae0 100644 --- a/assistant_dists/deepy_assistant/cpu.yml +++ b/assistant_dists/deepy_assistant/cpu.yml @@ -8,7 +8,3 @@ services: environment: DEVICE: cpu CUDA_VISIBLE_DEVICES: "" - transformers-lm-bloomz7b: - environment: - DEVICE: cpu - CUDA_VISIBLE_DEVICES: "" diff --git a/assistant_dists/deepy_assistant/dev.yml b/assistant_dists/deepy_assistant/dev.yml index a80bc21f0d..43c42be2b9 100644 --- a/assistant_dists/deepy_assistant/dev.yml +++ b/assistant_dists/deepy_assistant/dev.yml @@ -45,13 +45,12 @@ services: - "./common:/src/common" ports: - 8135:8135 - transformers-lm-bloomz7b: + openai-api-davinci3: volumes: - - "./services/transformers_lm:/src" + - "./services/openai_api_lm:/src" - "./common:/src/common" - - "~/.deeppavlov/cache:/root/.cache" ports: - - 8146:8146 + - 8131:8131 dff-deepy-prompted-skill: volumes: - "./skills/dff_template_prompted_skill:/src" diff --git a/assistant_dists/deepy_assistant/docker-compose.override.yml b/assistant_dists/deepy_assistant/docker-compose.override.yml index 2e62790ae7..60882c6e24 100644 --- a/assistant_dists/deepy_assistant/docker-compose.override.yml +++ b/assistant_dists/deepy_assistant/docker-compose.override.yml @@ -3,8 +3,8 @@ services: command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/deepy_assistant/pipeline_conf.json' environment: WAIT_HOSTS: "sentseg:8011, no-restrictions-selector:8009, badlisted-words:8018, combined-classification:8087, - spelling-preprocessing:8074, sentence-ranker:8128, prompt-selector:8135, transformers-lm-bloomz7b:8146, - dff-deepy-prompted-skill:8148" + spelling-preprocessing:8074, sentence-ranker:8128, prompt-selector:8135, openai-api-davinci3:8131, + dff-deepy-prompted-skill:8148" WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000} sentseg: @@ -145,26 +145,25 @@ services: reservations: memory: 3G - transformers-lm-bloomz7b: + openai-api-davinci3: env_file: [ .env ] build: args: - SERVICE_PORT: 8146 - SERVICE_NAME: transformers_lm_bloomz7b - PRETRAINED_MODEL_NAME_OR_PATH: bigscience/bloomz-7b1 - HALF_PRECISION: 0 + SERVICE_PORT: 8131 + SERVICE_NAME: openai_api_davinci3 + PRETRAINED_MODEL_NAME_OR_PATH: text-davinci-003 context: . - dockerfile: ./services/transformers_lm/Dockerfile - command: flask run -h 0.0.0.0 -p 8146 + dockerfile: ./services/openai_api_lm/Dockerfile + command: flask run -h 0.0.0.0 -p 8131 environment: - CUDA_VISIBLE_DEVICES=0 - FLASK_APP=server deploy: resources: limits: - memory: 50G + memory: 100M reservations: - memory: 50G + memory: 100M dff-deepy-prompted-skill: env_file: [ .env ] @@ -173,10 +172,11 @@ services: SERVICE_PORT: 8148 SERVICE_NAME: dff_deepy_prompted_skill PROMPT_FILE: common/prompts/deepy.json - GENERATIVE_SERVICE_URL: http://transformers-lm-bloomz7b:8146/respond - GENERATIVE_SERVICE_CONFIG: default_generative_config.json + GENERATIVE_SERVICE_URL: http://openai-api-davinci3:8131/respond + GENERATIVE_SERVICE_CONFIG: openai-text-davinci-003.json GENERATIVE_TIMEOUT: 5 N_UTTERANCES_CONTEXT: 3 + ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION context: . dockerfile: ./skills/dff_template_prompted_skill/Dockerfile command: gunicorn --workers=1 server:app -b 0.0.0.0:8148 --reload diff --git a/assistant_dists/deepy_assistant/proxy.yml b/assistant_dists/deepy_assistant/proxy.yml index 9abd79035e..70915cacf2 100644 --- a/assistant_dists/deepy_assistant/proxy.yml +++ b/assistant_dists/deepy_assistant/proxy.yml @@ -45,13 +45,4 @@ services: - PROXY_PASS=dream.deeppavlov.ai:8128 - PORT=8128 - transformers-lm-bloomz7b: - command: [ "nginx", "-g", "daemon off;" ] - build: - context: dp/proxy/ - dockerfile: Dockerfile - environment: - - PROXY_PASS=dream.deeppavlov.ai:8146 - - PORT=8146 - version: '3.7' diff --git a/skills/dff_template_prompted_skill/component.yml b/skills/dff_template_prompted_skill/component.yml index 67c7348a78..7f0ba454b4 100644 --- a/skills/dff_template_prompted_skill/component.yml +++ b/skills/dff_template_prompted_skill/component.yml @@ -206,3 +206,28 @@ dff-rhodes-coaching-prompted-skill: GENERATIVE_TIMEOUT: 5 N_UTTERANCES_CONTEXT: 3 date_created: '2023-03-16T09:45:32' +dff-deepy-prompted-skill: + name: dff_deepy_prompted_skill + display_name: Deepy Assistant Skill + container_name: dff-deepy-prompted-skill + component_type: Script-based with NNs + model_type: NN-based + is_customizable: true + author: DeepPavlov + description: Deepy Assistant can help a user to create a customized dialogue system. + ram_usage: 150M + gpu_usage: null + port: 8148 + endpoints: + - group: skills + endpoint: respond + build_args: + SERVICE_PORT: 8148 + SERVICE_NAME: dff_deepy_prompted_skill + PROMPT_FILE: common/prompts/deepy.json + GENERATIVE_SERVICE_URL: http://openai-api-davinci3:8131/respond + GENERATIVE_SERVICE_CONFIG: openai-text-davinci-003.json + GENERATIVE_TIMEOUT: 5 + N_UTTERANCES_CONTEXT: 3 + ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION + date_created: '2023-03-16T09:45:32' \ No newline at end of file diff --git a/skills/dff_template_prompted_skill/pipeline.yml b/skills/dff_template_prompted_skill/pipeline.yml index 7771f9c979..6cdb0058a7 100644 --- a/skills/dff_template_prompted_skill/pipeline.yml +++ b/skills/dff_template_prompted_skill/pipeline.yml @@ -86,3 +86,14 @@ dff-dream-persona-davinci3-prompted-skill: previous_services: - skill_selectors state_manager_method: add_hypothesis +dff-deepy-prompted-skill: +- group: skills + connector: + protocol: http + timeout: 5.0 + url: http://dff-deepy-prompted-skill:8148/respond + dialog_formatter: state_formatters.dp_formatters:dff_deepy_prompted_skill_formatter + response_formatter: state_formatters.dp_formatters:skill_with_attributes_formatter_service + previous_services: + - skill_selectors + state_manager_method: add_hypothesis \ No newline at end of file