Skip to content

Commit

Permalink
Adapt docker-compose-gpu.yml to use DPR by default (#1810)
Browse files Browse the repository at this point in the history
* Adapt docker-compose-gpu.yml to use DPR by default

* Update the comments

* Change the ES image

* Increase the context window and allow no-answers in the DPR pipeline too

* Re-enable file upload in GPU version

* Add env var without value and a commet to explain it
  • Loading branch information
ZanSara authored Nov 25, 2021
1 parent 9ee0ea0 commit 1a4ee21
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docker-compose-gpu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
version: "3"
services:

haystack-api:
build:
context: .
Expand All @@ -22,19 +23,23 @@ services:
environment:
# See rest_api/pipelines.yaml for configurations of Search & Indexing Pipeline.
- DOCUMENTSTORE_PARAMS_HOST=elasticsearch
- PIPELINE_YAML_PATH=/home/user/rest_api/pipeline/pipelines_dpr.yaml
depends_on:
- elasticsearch
command: "/bin/bash -c 'sleep 10 && gunicorn rest_api.application:app -b 0.0.0.0 -k uvicorn.workers.UvicornWorker --workers 1 --timeout 180'"

elasticsearch:
# This will start an empty elasticsearch instance (so you have to add your documents yourself)
#image: "elasticsearch:7.9.2"
# If you want a demo image instead that is "ready-to-query" with some indexed Game of Thrones articles:
image: "deepset/elasticsearch-game-of-thrones"
# If you want a demo image instead that is "ready-to-query" with some indexed articles
# about countries and capital cities from Wikipedia:
image: "deepset/elasticsearch-countries-and-capitals"
ports:
- 9200:9200
restart: on-failure
environment:
- discovery.type=single-node

ui:
build:
context: ui
Expand All @@ -46,4 +51,5 @@ services:
environment:
- API_ENDPOINT=https://haystack-api:8000
- EVAL_FILE=eval_labels_example.csv
- HAYSTACK_UI_DISABLE_FILE_UPLOAD # docker-compose run -e HAYSTACK_UI_DISABLE_FILE_UPLOAD=1 ...
command: "/bin/bash -c 'sleep 15 && streamlit run webapp.py'"
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ services:
elasticsearch:
# This will start an empty elasticsearch instance (so you have to add your documents yourself)
#image: "elasticsearch:7.9.2"
# If you want a demo image instead that is "ready-to-query" with some indexed Game of Thrones articles:
image: "deepset/elasticsearch-game-of-thrones"
# If you want a demo image instead that is "ready-to-query" with some indexed articles
# about countries and capital cities from Wikipedia:
image: "deepset/elasticsearch-countries-and-capitals"
ports:
- 9200:9200
restart: on-failure
Expand Down
2 changes: 2 additions & 0 deletions rest_api/pipeline/pipelines_dpr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ components: # define all the building-blocks for Pipeline
type: FARMReader # Haystack Class name for the component
params:
model_name_or_path: deepset/roberta-base-squad2
context_window_size: 1000
return_no_answer: true
- name: TextFileConverter
type: TextConverter
- name: PDFFileConverter
Expand Down

0 comments on commit 1a4ee21

Please sign in to comment.