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

Image captioning #4

Merged
merged 28 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
778eb1b
fix/slot extr conf (#156)
dmitrijeuseew May 12, 2022
04539d8
Fix/simplier skill selection (#159)
dilyararimovna May 19, 2022
833f01f
fixes (#160)
dmitrijeuseew May 23, 2022
2cad3e0
Feat/transformers intent catcher (#135)
dilyararimovna May 24, 2022
d028428
fix: proxy dialogpt (#164)
dilyararimovna May 25, 2022
787215d
Dream mini (#161)
dariamitciuk May 25, 2022
726d80c
Feat/infilling: not used yet (#163)
olkaso May 26, 2022
149be3b
Feat/update dialogpt (#170)
dilyararimovna Jun 16, 2022
b5dfa23
Feat/parametrize response selector (#169)
dilyararimovna Jun 17, 2022
e4e3bc0
feat: change params of dialogpt (#172)
dilyararimovna Jun 17, 2022
110c566
Fix/protobuf version (#173)
dilyararimovna Jun 23, 2022
26ff1aa
feat: first russian dream (#176)
dilyararimovna Jun 30, 2022
ad80652
fix: proxy usage command (#183)
dilyararimovna Jul 14, 2022
02408d6
Feat/multilingual ner (#186)
dilyararimovna Jul 26, 2022
72da84d
update fact-retrieval and text-qa (#168)
zucchini-nlp Jul 27, 2022
ec32679
feat: upd dp-ner with extended version (#189)
dilyararimovna Aug 11, 2022
fd9f40f
fix: upd dialogpt en params (#190)
dilyararimovna Aug 23, 2022
0304479
docker fixes for hydra configuration poc (#34)
mtalimanchuk Aug 24, 2022
a13ec56
fix: prompts from dummy skill (#193)
dilyararimovna Aug 26, 2022
4c011ae
Feat/sentence ranker as a service (#191)
dilyararimovna Aug 29, 2022
d2d29d6
fix: upd reqs for kg service (#195)
dilyararimovna Aug 31, 2022
58c91fc
image captioning
dariamitciuk Sep 4, 2022
61d0861
update image captioning server.py
dariamitciuk Sep 4, 2022
789e768
update image captioning server.py
dariamitciuk Sep 4, 2022
917ad8f
add dream_multimodal
dariamitciuk Sep 6, 2022
1c41edd
updates
dariamitciuk Sep 9, 2022
25ba131
updated pipeline
dariamitciuk Sep 12, 2022
ceaf83c
Merge branch 'image_captioning' into image-captioning
dariamitciuk Sep 16, 2022
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Dream Architecture is presented in the following image:
| Entity linking | 16 GiB RAM, 1.5 GiB GPU | finds Wikidata entity ids for the entities detected with Entity Detection |
| Entity Storer | 220 MiB RAM | a rule-based component, which stores entities from the user's and socialbot's utterances if opinion expression is detected with patterns or MIDAS Classifier and saves them along with the detected attitude to dialogue state |
| Fact random | 50 MiB RAM | returns random facts for the given entity (for entities from user utterance) |
| Fact retrieval | 400 MiB GPU | extracts facts from Wikipedia and wikiHow |
| Fact retrieval | 400 MiB GPU | extracts facts from Wikipedia and wikiHow | |
| Image captioning | 4 GiB RAM, 5.4 GiB GPU | creates text representation of a received image |
| Intent catcher | 2.7 GiB RAM | classifies user utterances into a number of predefined intents which are trained on a set of phrases and regexps |
| KBQA | 360 MiB GPU | answers user's factoid questions based on Wikidata KB |
Expand Down
20 changes: 1 addition & 19 deletions assistant_dists/dream/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
dff-funfact-skill:8104, dff-bot-persona-skill:8105, news-api-annotator:8112,
dff-gossip-skill:8109, dff-wiki-skill:8111, dff-gaming-skill:8115, topic-recommendation:8113,
user-persona-extractor:8114, wiki-facts:8116, dff-music-skill:8099, entity-detection:8103, dff-art-skill:8117,
midas-predictor:8121, dialogpt:8125, infilling:8122, dff-template-skill:8120, image-captioning:8123"
midas-predictor:8121, dialogpt:8125, infilling:8122, dff-template-skill:8120"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-480}
convers-evaluator-annotator:
env_file: [.env]
Expand Down Expand Up @@ -1223,22 +1223,4 @@ services:
reservations:
memory: 128M

image-captioning:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8123
SERVICE_NAME: image_captioning
context: ./services/image_captioning/
command: flask run -h 0.0.0.0 -p 8123
environment:
- CUDA_VISIBLE_DEVICES=0
- FLASK_APP=server
deploy:
resources:
limits:
memory: 5G
reservations:
memory: 5G

version: '3.7'
8 changes: 4 additions & 4 deletions assistant_dists/dream_mini/cpu.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
version: '3.7'
services:
convers-evaluator-annotator:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
dialogpt:
environment:
DEVICE: cpu
Expand All @@ -12,3 +8,7 @@ services:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
sentence-ranker:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
12 changes: 3 additions & 9 deletions assistant_dists/dream_mini/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ services:
- ".:/dp-agent"
ports:
- 4242:4242
convers-evaluator-annotator:
volumes:
- "./annotators/ConversationEvaluator:/src"
- "~/.deeppavlov:/root/.deeppavlov"
ports:
- 8004:8004
dff-program-y-skill:
volumes:
- "./skills/dff_program_y_skill:/src"
Expand Down Expand Up @@ -57,9 +51,9 @@ services:
- "./services/dialogpt:/src"
ports:
- 8125:8125
image-captioning:
sentence-ranker:
volumes:
- "./services/image_captioning:/src"
- "./services/sentence_ranker:/src"
ports:
- 8123:8123
- 8128:8128
version: "3.7"
37 changes: 9 additions & 28 deletions assistant_dists/dream_mini/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,10 @@ services:
agent:
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/dream_mini/pipeline_conf.json'
environment:
WAIT_HOSTS: "convers-evaluator-annotator:8004, dff-program-y-skill:8008, sentseg:8011, convers-evaluation-selector:8009,
WAIT_HOSTS: "dff-program-y-skill:8008, sentseg:8011, convers-evaluation-selector:8009,
dff-intent-responder-skill:8012, intent-catcher:8014, badlisted-words:8018,
spelling-preprocessing:8074, dialogpt:8125, image-captioning:8123"
spelling-preprocessing:8074, dialogpt:8125, sentence-ranker:8128"
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-480}
convers-evaluator-annotator:
env_file: [.env]
build:
args:
CONFIG: conveval.json
PORT: 8004
DATA_URL: https://files.deeppavlov.ai/alexaprize_data/cobot_conveval2.tar.gz
context: .
dockerfile: ./annotators/ConversationEvaluator/Dockerfile
environment:
- CUDA_VISIBLE_DEVICES=0
deploy:
mode: replicated
replicas: 1
resources:
limits:
memory: 2G
reservations:
memory: 2G

dff-program-y-skill:
env_file: [.env]
Expand Down Expand Up @@ -173,22 +154,22 @@ services:
reservations:
memory: 2G

image-captioning:
sentence-ranker:
env_file: [ .env ]
build:
args:
SERVICE_PORT: 8123
SERVICE_NAME: image_captioning
context: ./services/image_captioning/
command: flask run -h 0.0.0.0 -p 8123
SERVICE_PORT: 8128
PRETRAINED_MODEL_NAME_OR_PATH: sentence-transformers/bert-base-nli-mean-tokens
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: 5G
memory: 3G
reservations:
memory: 5G
memory: 3G

version: '3.7'
19 changes: 3 additions & 16 deletions assistant_dists/dream_mini/pipeline_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,6 @@
"annotators.spelling_preprocessing",
"annotators.sentseg"
]
},
"image_captioning": {
"connector": {
"protocol": "http",
"timeout": 5,
"url": "http://image_captioning:8123/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:cobot_classifiers_formatter_service",
"response_formatter": "state_formatters.dp_formatters:skill_with_attributes_formatter_service",
"previous_services": [
"skill_selectors"
],
"state_manager_method": "add_hypothesis"
}
},
"skill_selectors": {
Expand Down Expand Up @@ -215,13 +202,13 @@
],
"state_manager_method": "add_hypothesis_annotation_batch"
},
"convers_evaluator_annotator": {
"sentence_ranker": {
"connector": {
"protocol": "http",
"timeout": 1,
"url": "http://convers-evaluator-annotator:8004/batch_model"
"url": "http://sentence-ranker:8128/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:convers_evaluator_annotator_formatter",
"dialog_formatter": "state_formatters.dp_formatters:sentence_ranker_formatter",
"response_formatter": "state_formatters.dp_formatters:simple_formatter_service",
"previous_services": ["skills"],
"state_manager_method": "add_hypothesis_annotation_batch"
Expand Down
16 changes: 8 additions & 8 deletions assistant_dists/dream_mini/proxy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
services:
convers-evaluator-annotator:
command: ["nginx", "-g", "daemon off;"]
build:
context: dp/proxy/
dockerfile: Dockerfile
environment:
- PROXY_PASS=dream.deeppavlov.ai:8004
- PORT=8004

dff-program-y-skill:
command: ["nginx", "-g", "daemon off;"]
Expand Down Expand Up @@ -80,4 +72,12 @@ services:
- PROXY_PASS=dream.deeppavlov.ai:8125
- PORT=8125

sentence-ranker:
command: [ "nginx", "-g", "daemon off;" ]
build:
context: dp/proxy/
dockerfile: Dockerfile
environment:
- PROXY_PASS=dream.deeppavlov.ai:8128
- PORT=8128
version: '3.7'
14 changes: 14 additions & 0 deletions assistant_dists/dream_multimodal/cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.7'
services:
dialogpt:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
intent-catcher:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
sentence-ranker:
environment:
DEVICE: cpu
CUDA_VISIBLE_DEVICES: ""
6 changes: 6 additions & 0 deletions assistant_dists/dream_multimodal/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
}
64 changes: 64 additions & 0 deletions assistant_dists/dream_multimodal/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# С такими volumes удобно дебажить, не нужно пересобирать контейнер каждый раз при изменении кода
services:
agent:
volumes:
- ".:/dp-agent"
ports:
- 4242:4242
dff-program-y-skill:
volumes:
- "./skills/dff_program_y_skill:/src"
- "./common:/src/common"
ports:
- 8008:8008
sentseg:
volumes:
- "./annotators/SentSeg:/src"
ports:
- 8011:8011
convers-evaluation-selector:
volumes:
- "./response_selectors/convers_evaluation_based_selector:/src"
- "./common:/src/common"
ports:
- 8009:8009
dff-intent-responder-skill:
volumes:
- "./skills/dff_intent_responder_skill:/src"
- "./common:/src/common"
ports:
- 8012:8012
intent-catcher:
volumes:
- "./annotators/IntentCatcherTransformers:/src"
- "./common:/src/common"
- "~/.deeppavlov:/root/.deeppavlov"
ports:
- 8014:8014
badlisted-words:
volumes:
- "./annotators/BadlistedWordsDetector:/src"
- "./common:/src/common"
ports:
- 8018:8018
spelling-preprocessing:
volumes:
- "./annotators/spelling_preprocessing:/src"
ports:
- 8074:8074
dialogpt:
volumes:
- "./services/dialogpt:/src"
ports:
- 8125:8125
sentence-ranker:
volumes:
- "./services/sentence_ranker:/src"
ports:
- 8128:8128
image-captioning:
volumes:
- "./services/image_captioning:/src"
ports:
- 8123:8123
version: "3.7"
Loading