Skip to content

Commit

Permalink
Feat/ruxglm prompted dist (#528)
Browse files Browse the repository at this point in the history
* feat: ignore env secret ru

* feat: add access token

* feat: distribution ruxglm

* fix: ruxglm cards

* fix: use use_auth_token

* fix: eos tokens type

* fix: stats cpu ram

* fix: skills cards

* fix: components cards

* fix: eos tokens

* fix: eos tokens

* fix: eos tokens

* fix: eos tokens

* fix: cards and table

* fix: ADDITIONAL_EOS_TOKENS

* fix: ADDITIONAL_EOS_TOKENS

* fix: codestyle

* fix: universal

* fix: dream persona ru skill name

* fix: prompt selector ru

* fix: replacement

* fix: prompt selecrto

* fix: use params

* fix: timeout and history

* fix: trye very short persona

* fix: increase timeout

* fix: sub replacement tokens correctly

* fix: sub replacement tokens correctly

* fix: use stopping criteria

* fix: typing

* fix: revert long persona

* fix: duplicate spaces

* fix: correct components for russian distribution

* fix: proxy for russian distribution

* feat: universal distr for ru

* feat: universal distr for ru

* fix: remove extra

* fix: working configs

* fix: configs

* feat: ruxglm prompted dists

* fix: component cards

* fix: container name

* fix: remove extra space after new line

* fix: remove extra space after new line

* feat: tests for dream ruxglm

* fix: proxy and ru lang

* fix: change port of universal ru

* fix: rights on file

* fix: tests skills

* fix: test for resp selector

* fix: tests for proxied components

* fix: remove do sample true

* fix: generative params

* feat: used sentence ranker url

* feat: utilized default llm
  • Loading branch information
dilyararimovna authored Jul 27, 2023
1 parent 906b361 commit 8b22a9f
Show file tree
Hide file tree
Showing 41 changed files with 1,599 additions and 26 deletions.
93 changes: 93 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,98 @@ pipeline {
}
}
}
// ------------------------------------------- Test prompted dists------------------------------------------------
stage('Build-DRUXGLM') {
steps {
script{
startTime = currentBuild.duration
Exception ex = null
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
try {
sh '''
cat /home/ignatov/secrets.txt >> .env_secret
tests/runtests_dream_ruxglm.sh MODE=build
'''
}
catch (Exception e) {
int duration = (currentBuild.duration - startTime) / 1000
throw e
}
}
}
}
post {
aborted {
script {
sh 'tests/runtests_dream_ruxglm.sh MODE=clean'
}
}
success {
script {
int duration = (currentBuild.duration - startTime) / 1000
}
}
}
}
stage('Start-DRUXGLM') {
steps {
script {
startTime = currentBuild.duration
Exception ex = null
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
try {
sh 'tests/runtests_dream_ruxglm.sh MODE=clean && tests/runtests_dream_ruxglm.sh MODE=start'
}
catch (Exception e) {
int duration = (currentBuild.duration - startTime) / 1000
throw e
}
}
}
}
post {
success {
script {
started = true
int duration = (currentBuild.duration - startTime) / 1000
}
}
aborted {
script {
sh 'tests/runtests_dream_ruxglm.sh MODE=clean'
}
}
}
}
stage('Test skills-DRUXGLM') {
steps {
script {
startTime = currentBuild.duration
Exception ex = null
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
try {
sh label: 'test skills', script: 'tests/runtests_dream_ruxglm.sh MODE=test_skills'
}
catch (Exception e) {
int duration = (currentBuild.duration - startTime) / 1000
throw e
}
}
}
}
post {
success {
script {
int duration = (currentBuild.duration - startTime) / 1000
}
}
aborted {
script {
sh 'tests/runtests_dream_ruxglm.sh MODE=clean'
}
}
}
}
// ------------------------------------------- Test prompted dists------------------------------------------------
stage('Build-Reason') {
steps {
Expand All @@ -43,6 +135,7 @@ pipeline {
try {
sh '''
cat /home/ignatov/secrets.txt >> .env_secret
tests/runtests_dream_ruxglm.sh MODE=clean
tests/runtests_reasoning.sh MODE=build
'''
}
Expand Down
29 changes: 15 additions & 14 deletions MODELS.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions assistant_dists/dream_persona_rullama_prompted/proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:

dialogrpt-ru:
command: [ "nginx", "-g", "daemon off;" ]
build:
context: dp/proxy/
dockerfile: Dockerfile
environment:
- PROXY_PASS=proxy.deeppavlov.ai:8122
- PORT=8122

version: "3.7"
9 changes: 9 additions & 0 deletions assistant_dists/dream_persona_ruxglm_prompted/cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.7'
services:
dialogrpt-ru:
environment:
CUDA_VISIBLE_DEVICES: ""
transformers-lm-ruxglm:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
6 changes: 6 additions & 0 deletions assistant_dists/dream_persona_ruxglm_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
}
40 changes: 40 additions & 0 deletions assistant_dists/dream_persona_ruxglm_prompted/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# С такими volumes удобно дебажить, не нужно пересобирать контейнер каждый раз при изменении кода
services:
agent:
volumes:
- ".:/dp-agent"
ports:
- 4242:4242
ranking-based-response-selector-ru:
volumes:
- "./response_selectors/ranking_based_response_selector:/src"
- "./common:/src/common"
ports:
- 8002:8002
dialogrpt-ru:
volumes:
- "./services/dialogrpt_ru:/src"
- "~/.deeppavlov/cache:/root/.cache"
ports:
- 8122:8122
prompt-selector-ru:
volumes:
- "./annotators/prompt_selector:/src"
- "./common:/src/common"
ports:
- 8135:8135
transformers-lm-ruxglm:
volumes:
- "./services/transformers_lm:/src"
- "./common:/src/common"
- "~/.deeppavlov/cache:/root/.cache"
ports:
- 8171:8171
dff-dream-persona-ruxglm-prompted-skill:
volumes:
- "./skills/dff_template_prompted_skill:/src"
- "./common:/src/common"
ports:
- 8172:8172

version: "3.7"
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
services:
agent:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/dream_persona_ruxglm_prompted/pipeline_conf.json'
environment:
WAIT_HOSTS: "ranking-based-response-selector-ru:8002,
dialogrpt-ru:8122, prompt-selector-ru:8135, transformers-lm-ruxglm:8171,
dff-dream-persona-ruxglm-prompted-skill:8172"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1800}
HIGH_PRIORITY_INTENTS: 0
RESTRICTION_FOR_SENSITIVE_CASE: 0
ALWAYS_TURN_ON_ALL_SKILLS: 0
LANGUAGE: RU
FALLBACK_FILE: fallbacks_dream_ru.json

ranking-based-response-selector-ru:
env_file: [ .env_ru ]
build:
args:
SERVICE_PORT: 8002
SERVICE_NAME: response_selector
SENTENCE_RANKER_ANNOTATION_NAME: dialogrpt
SENTENCE_RANKER_SERVICE_URL: http://dialogrpt-ru:8122/rank_sentences
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

dialogrpt-ru:
env_file: [ .env_ru ]
build:
context: ./services/dialogrpt_ru/
args:
SERVICE_PORT: 8122
PRETRAINED_MODEL_FNAME: dialogrpt_ru_ckpt_v0.pth
TOKENIZER_NAME_OR_PATH: DeepPavlov/rudialogpt3_medium_based_on_gpt2_v2
command: flask run -h 0.0.0.0 -p 8122
environment:
- CUDA_VISIBLE_DEVICES=0
- FLASK_APP=server
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 4G

prompt-selector-ru:
env_file: [ .env_ru ]
build:
args:
SERVICE_PORT: 8135
SERVICE_NAME: prompt_selector
SENTENCE_RANKER_SERVICE_URL: http://dialogrpt-ru:8122/rank_sentences
N_SENTENCES_TO_RETURN: 3
PROMPTS_TO_CONSIDER: dream_persona_ru
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

transformers-lm-ruxglm:
env_file: [ .env_ru,.env_secret ]
build:
args:
SERVICE_PORT: 8171
SERVICE_NAME: transformers_lm_ruxglm
PRETRAINED_MODEL_NAME_OR_PATH: dim/xglm-4.5B_ru_v10_epoch_6_step_41141
HALF_PRECISION: 1
ADDITIONAL_EOS_TOKENS: <|endoftext|>,Human
context: .
dockerfile: ./services/transformers_lm/Dockerfile
command: flask run -h 0.0.0.0 -p 8171
environment:
- CUDA_VISIBLE_DEVICES=0
- FLASK_APP=server
deploy:
resources:
limits:
memory: 60G
reservations:
memory: 60G

dff-dream-persona-ruxglm-prompted-skill:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8172
SERVICE_NAME: dff_dream_persona_ru_prompted_skill
PROMPT_FILE: common/prompts/dream_persona_ru.json
GENERATIVE_SERVICE_URL: http://transformers-lm-ruxglm:8171/respond
GENERATIVE_SERVICE_CONFIG: ruxglm_config.json
GENERATIVE_TIMEOUT: 20
N_UTTERANCES_CONTEXT: 3
context: .
dockerfile: ./skills/dff_template_prompted_skill/Dockerfile
deploy:
resources:
limits:
memory: 128M
reservations:
memory: 128M

version: '3.7'
Loading

0 comments on commit 8b22a9f

Please sign in to comment.