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/llm-based and ranking-based dm #405

Merged
merged 36 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
33f1e1e
feat: create files for llm based response selection
dilyararimovna Apr 21, 2023
93006d9
feat: tests
dilyararimovna Apr 21, 2023
da416c7
feat: algorithm
dilyararimovna Apr 21, 2023
3035f08
fix: filter bad or toxic uttrs
dilyararimovna Apr 23, 2023
062d187
feat: ranking based response selector
dilyararimovna Apr 23, 2023
b4df900
feat: model cards
dilyararimovna Apr 24, 2023
a845b9b
feat: ranking and refactoring
dilyararimovna Apr 24, 2023
0e77064
feat: component files
dilyararimovna Apr 24, 2023
5cd64f7
feat: component description
dilyararimovna Apr 24, 2023
6fd0fde
feat: component description
dilyararimovna Apr 24, 2023
f2fdec5
feat: use gpt-j resp selector
dilyararimovna Apr 24, 2023
a18cee9
feat: context
dilyararimovna Apr 24, 2023
6e283b8
feat: utilize hypotheses correctly
dilyararimovna Apr 24, 2023
9433c24
fix: configs
dilyararimovna Apr 24, 2023
a115036
fix: configs
dilyararimovna Apr 24, 2023
b3cbc1b
fix: mapping
dilyararimovna Apr 24, 2023
3c244c3
fix: utilize ranker based selector
dilyararimovna Apr 24, 2023
115e83a
fix: decay dummy
dilyararimovna Apr 24, 2023
effe87e
fix: decay dummy
dilyararimovna Apr 24, 2023
0ad3e75
fix: response
dilyararimovna Apr 24, 2023
072e4a8
fix: remove old selector
dilyararimovna Apr 24, 2023
9081409
fix: logs
dilyararimovna Apr 24, 2023
5b2f3b4
fix: getting annotations
dilyararimovna Apr 24, 2023
9914ac0
fix: code style
dilyararimovna Apr 24, 2023
4f1823e
fix: deepy uses resp selector
dilyararimovna Apr 24, 2023
7d5a4b7
fix: no language
dilyararimovna Apr 24, 2023
db2eba3
fix: ru usage
dilyararimovna Apr 24, 2023
7dd32df
fix: usage of formatter
dilyararimovna Apr 24, 2023
de17307
Merge branch 'dev' into feat/llms_dm
dilyararimovna Apr 25, 2023
f1a48d0
Merge branch 'dev' into feat/llms_dm
dilyararimovna Apr 25, 2023
be13640
fix: codestyle
dilyararimovna Apr 25, 2023
89cb92b
fix: logs
dilyararimovna Apr 25, 2023
6e2c97c
Merge branch 'dev' of https://github.com/deeppavlov/dream into feat/l…
dilyararimovna Apr 25, 2023
e82020f
fix: after review
dilyararimovna Apr 25, 2023
06da7c3
fix: sync
dilyararimovna Apr 25, 2023
db5e821
Merge branch 'dev' into feat/llms_dm
dilyararimovna Apr 25, 2023
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
6 changes: 3 additions & 3 deletions assistant_dists/ai_faq_assistant/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ services:
- "./annotators/SentSeg:/src"
ports:
- 8011:8011
no-restrictions-selector:
ranking-based-response-selector:
volumes:
- "./response_selectors/convers_evaluation_based_selector:/src"
- "./response_selectors/ranking_based_response_selector:/src"
- "./common:/src/common"
ports:
- 8009:8009
- 8002:8002
badlisted-words:
volumes:
- "./annotators/BadlistedWordsDetector:/src"
Expand Down
33 changes: 11 additions & 22 deletions assistant_dists/ai_faq_assistant/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
agent:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/ai_faq_assistant/pipeline_conf.json'
environment:
WAIT_HOSTS: "sentseg:8011, no-restrictions-selector:8009, badlisted-words:8018, combined-classification:8087,
WAIT_HOSTS: "sentseg:8011, ranking-based-response-selector:8002, badlisted-words:8018, combined-classification:8087,
sentence-ranker:8128, prompt-selector:8135, transformers-lm-oasst12b:8158,
dff-ai-faq-prompted-skill:8143"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000}
Expand Down Expand Up @@ -38,32 +38,21 @@ services:
reservations:
memory: 2G

no-restrictions-selector:
ranking-based-response-selector:
env_file: [ .env ]
build:
args:
TAG_BASED_SELECTION: 1
CALL_BY_NAME_PROBABILITY: 0.5
PROMPT_PROBA: 0
ACKNOWLEDGEMENT_PROBA: 0.3
PRIORITIZE_WITH_REQUIRED_ACT: 0
PRIORITIZE_NO_DIALOG_BREAKDOWN: 0
PRIORITIZE_WITH_SAME_TOPIC_ENTITY: 0
IGNORE_DISLIKED_SKILLS: 0
GREETING_FIRST: 0
RESTRICTION_FOR_SENSITIVE_CASE: 0
PRIORITIZE_PROMTS_WHEN_NO_SCRIPTS: 0
MAX_TURNS_WITHOUT_SCRIPTS: 100
ADD_ACKNOWLEDGMENTS_IF_POSSIBLE: 0
PRIORITIZE_SCRIPTED_SKILLS: 0
CONFIDENCE_STRENGTH: 0.8
CONV_EVAL_STRENGTH: 0.4
PRIORITIZE_HUMAN_INITIATIVE: 1
QUESTION_TO_QUESTION_DOWNSCORE_COEF: 0.8
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/convers_evaluation_based_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8009
dockerfile: ./response_selectors/ranking_based_response_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8002
environment:
- FLASK_APP=server
deploy:
Expand Down
8 changes: 4 additions & 4 deletions assistant_dists/ai_faq_assistant/pipeline_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@
"connector": {
"protocol": "http",
"timeout": 1.0,
"url": "http://no-restrictions-selector:8009/respond"
"url": "http://ranking-based-response-selector:8002/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:full_history_dialog",
"dialog_formatter": "state_formatters.dp_formatters:cropped_dialog",
"response_formatter": "state_formatters.dp_formatters:base_response_selector_formatter_service",
"previous_services": [
"candidate_annotators"
],
"state_manager_method": "add_bot_utterance",
"is_enabled": true,
"source": {
"directory": "response_selectors/convers_evaluation_based_selector",
"container": "no-restrictions-selector",
"directory": "response_selectors/ranking_based_response_selector",
"container": "ranking-based-response-selector",
"endpoint": "respond"
}
}
Expand Down
6 changes: 3 additions & 3 deletions assistant_dists/deeppavlov_assistant/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ services:
- ".:/dp-agent"
ports:
- 4242:4242
no-restrictions-selector:
ranking-based-response-selector:
volumes:
- "./response_selectors/convers_evaluation_based_selector:/src"
- "./response_selectors/ranking_based_response_selector:/src"
- "./common:/src/common"
ports:
- 8009:8009
- 8002:8002
sentence-ranker:
volumes:
- "./services/sentence_ranker:/src"
Expand Down
33 changes: 11 additions & 22 deletions assistant_dists/deeppavlov_assistant/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,29 @@ services:
agent:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/deeppavlov_assistant/pipeline_conf.json'
environment:
WAIT_HOSTS: "no-restrictions-selector:8009, sentence-ranker:8128, prompt-selector:8135, openai-api-chatgpt:8145,
WAIT_HOSTS: "ranking-based-response-selector:8002, sentence-ranker:8128, prompt-selector:8135, openai-api-chatgpt:8145,
dff-deeppavlov-prompted-skill:8146"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000}
HIGH_PRIORITY_INTENTS: 1
RESTRICTION_FOR_SENSITIVE_CASE: 1
ALWAYS_TURN_ON_ALL_SKILLS: 0
LANGUAGE: EN

no-restrictions-selector:
ranking-based-response-selector:
env_file: [ .env ]
build:
args:
TAG_BASED_SELECTION: 1
CALL_BY_NAME_PROBABILITY: 0.5
PROMPT_PROBA: 0
ACKNOWLEDGEMENT_PROBA: 0.3
PRIORITIZE_WITH_REQUIRED_ACT: 0
PRIORITIZE_NO_DIALOG_BREAKDOWN: 0
PRIORITIZE_WITH_SAME_TOPIC_ENTITY: 0
IGNORE_DISLIKED_SKILLS: 0
GREETING_FIRST: 0
RESTRICTION_FOR_SENSITIVE_CASE: 0
PRIORITIZE_PROMTS_WHEN_NO_SCRIPTS: 0
MAX_TURNS_WITHOUT_SCRIPTS: 100
ADD_ACKNOWLEDGMENTS_IF_POSSIBLE: 0
PRIORITIZE_SCRIPTED_SKILLS: 0
CONFIDENCE_STRENGTH: 0.8
CONV_EVAL_STRENGTH: 0.4
PRIORITIZE_HUMAN_INITIATIVE: 1
QUESTION_TO_QUESTION_DOWNSCORE_COEF: 0.8
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/convers_evaluation_based_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8009
dockerfile: ./response_selectors/ranking_based_response_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8002
environment:
- FLASK_APP=server
deploy:
Expand Down
8 changes: 4 additions & 4 deletions assistant_dists/deeppavlov_assistant/pipeline_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@
"connector": {
"protocol": "http",
"timeout": 1.0,
"url": "http://no-restrictions-selector:8009/respond"
"url": "http://ranking-based-response-selector:8002/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:full_history_dialog",
"dialog_formatter": "state_formatters.dp_formatters:cropped_dialog",
"response_formatter": "state_formatters.dp_formatters:base_response_selector_formatter_service",
"previous_services": [
"candidate_annotators"
],
"state_manager_method": "add_bot_utterance",
"is_enabled": true,
"source": {
"directory": "response_selectors/convers_evaluation_based_selector",
"container": "no-restrictions-selector",
"directory": "response_selectors/ranking_based_response_selector",
"container": "ranking-based-response-selector",
"endpoint": "respond"
}
}
Expand Down
4 changes: 0 additions & 4 deletions assistant_dists/deepy_assistant/cpu.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
version: '3.7'
services:
combined-classification:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
sentence-ranker:
environment:
DEVICE: cpu
Expand Down
23 changes: 3 additions & 20 deletions assistant_dists/deepy_assistant/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,12 @@ services:
- ".:/dp-agent"
ports:
- 4242:4242
sentseg:
dilyararimovna marked this conversation as resolved.
Show resolved Hide resolved
volumes:
- "./annotators/SentSeg:/src"
ports:
- 8011:8011
no-restrictions-selector:
volumes:
- "./response_selectors/convers_evaluation_based_selector:/src"
- "./common:/src/common"
ports:
- 8009:8009
badlisted-words:
volumes:
- "./annotators/BadlistedWordsDetector:/src"
- "./common:/src/common"
ports:
- 8018:8018
combined-classification:
ranking-based-response-selector:
volumes:
- "./response_selectors/ranking_based_response_selector:/src"
- "./common:/src/common"
- "./annotators/combined_classification:/src"
ports:
- 8087:8087
- 8002:8002
sentence-ranker:
volumes:
- "./services/sentence_ranker:/src"
Expand Down
88 changes: 16 additions & 72 deletions assistant_dists/deepy_assistant/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,29 @@ services:
agent:
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,
sentence-ranker:8128, prompt-selector:8135, openai-api-davinci3:8131,
dff-deepy-prompted-skill:8148"
WAIT_HOSTS: "ranking-based-response-selector:8002, sentence-ranker:8128, prompt-selector:8135, openai-api-davinci3:8131,
dff-deepy-prompted-skill:8148"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000}
HIGH_PRIORITY_INTENTS: 1
RESTRICTION_FOR_SENSITIVE_CASE: 1
ALWAYS_TURN_ON_ALL_SKILLS: 0
LANGUAGE: EN

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
environment:
- CUDA_VISIBLE_DEVICES=0
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 2G

no-restrictions-selector:
ranking-based-response-selector:
env_file: [ .env ]
build:
args:
TAG_BASED_SELECTION: 1
CALL_BY_NAME_PROBABILITY: 0.5
PROMPT_PROBA: 0
ACKNOWLEDGEMENT_PROBA: 0.3
PRIORITIZE_WITH_REQUIRED_ACT: 0
PRIORITIZE_NO_DIALOG_BREAKDOWN: 0
PRIORITIZE_WITH_SAME_TOPIC_ENTITY: 0
IGNORE_DISLIKED_SKILLS: 0
GREETING_FIRST: 0
RESTRICTION_FOR_SENSITIVE_CASE: 0
PRIORITIZE_PROMTS_WHEN_NO_SCRIPTS: 0
MAX_TURNS_WITHOUT_SCRIPTS: 100
ADD_ACKNOWLEDGMENTS_IF_POSSIBLE: 0
PRIORITIZE_SCRIPTED_SKILLS: 0
CONFIDENCE_STRENGTH: 0.8
CONV_EVAL_STRENGTH: 0.4
PRIORITIZE_HUMAN_INITIATIVE: 1
QUESTION_TO_QUESTION_DOWNSCORE_COEF: 0.8
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/convers_evaluation_based_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8009
dockerfile: ./response_selectors/ranking_based_response_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8002
environment:
- FLASK_APP=server
deploy:
Expand All @@ -73,23 +34,6 @@ services:
reservations:
memory: 100M

badlisted-words:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8018
SERVICE_NAME: badlisted_words
context: annotators/BadlistedWordsDetector/
command: flask run -h 0.0.0.0 -p 8018
environment:
- FLASK_APP=server
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 256M

prompt-selector:
env_file: [ .env ]
build:
Expand Down
Loading