From 4f3be23efaa3718c68f80392d1907940d5f1c1b0 Mon Sep 17 00:00:00 2001 From: "chen, suyue" Date: Thu, 22 Aug 2024 20:00:05 +0800 Subject: [PATCH] fix translation gaudi env (#653) Signed-off-by: chensuyue --- DocSum/docker/Dockerfile | 5 +++-- FaqGen/docker/Dockerfile | 5 +++-- Translation/docker/Dockerfile | 2 +- Translation/docker/gaudi/compose.yaml | 10 +++++++++- Translation/tests/test_translation_on_gaudi.sh | 5 ++--- Translation/tests/test_translation_on_xeon.sh | 5 ++--- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/DocSum/docker/Dockerfile b/DocSum/docker/Dockerfile index f14aa6b8f..0128d1ff3 100644 --- a/DocSum/docker/Dockerfile +++ b/DocSum/docker/Dockerfile @@ -3,12 +3,13 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM langchain/langchain:latest +FROM python:3.11-slim RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ libjemalloc-dev \ - vim + vim \ + git RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/FaqGen/docker/Dockerfile b/FaqGen/docker/Dockerfile index bb4d6f7ce..f6faa1484 100644 --- a/FaqGen/docker/Dockerfile +++ b/FaqGen/docker/Dockerfile @@ -3,13 +3,14 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM langchain/langchain:latest +FROM python:3.11-slim RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ libjemalloc-dev \ - vim + vim \ + git RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/Translation/docker/Dockerfile b/Translation/docker/Dockerfile index cd659be89..ce151bc6c 100644 --- a/Translation/docker/Dockerfile +++ b/Translation/docker/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. -FROM langchain/langchain:latest +FROM python:3.11-slim RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ diff --git a/Translation/docker/gaudi/compose.yaml b/Translation/docker/gaudi/compose.yaml index 2388f8521..32dbfdc3e 100644 --- a/Translation/docker/gaudi/compose.yaml +++ b/Translation/docker/gaudi/compose.yaml @@ -11,7 +11,15 @@ services: http_proxy: ${http_proxy} https_proxy: ${https_proxy} TGI_LLM_ENDPOINT: ${TGI_LLM_ENDPOINT} - HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + HF_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + HF_HUB_DISABLE_PROGRESS_BARS: 1 + HF_HUB_ENABLE_HF_TRANSFER: 0 + HABANA_VISIBLE_DEVICES: all + OMPI_MCA_btl_vader_single_copy_mechanism: none + runtime: habana + cap_add: + - SYS_NICE + ipc: host volumes: - "./data:/data" command: --model-id ${LLM_MODEL_ID} --max-input-length 1024 --max-total-tokens 2048 diff --git a/Translation/tests/test_translation_on_gaudi.sh b/Translation/tests/test_translation_on_gaudi.sh index 255da8562..facc0e020 100644 --- a/Translation/tests/test_translation_on_gaudi.sh +++ b/Translation/tests/test_translation_on_gaudi.sh @@ -47,7 +47,7 @@ function start_services() { if grep -q Connected ${LOG_PATH}/tgi_service_start.log; then break fi - sleep 5s + sleep 10s n=$((n+1)) done } @@ -84,8 +84,7 @@ function validate_services() { function validate_microservices() { # Check if the microservices are running correctly. - # TODO: Any results check required?? - sleep 3m + # tgi gaudi service validate_services \ "${ip_address}:8008/generate" \ diff --git a/Translation/tests/test_translation_on_xeon.sh b/Translation/tests/test_translation_on_xeon.sh index f915b9dfa..a061e8543 100644 --- a/Translation/tests/test_translation_on_xeon.sh +++ b/Translation/tests/test_translation_on_xeon.sh @@ -47,7 +47,7 @@ function start_services() { if grep -q Connected ${LOG_PATH}/tgi_service_start.log; then break fi - sleep 5s + sleep 10s n=$((n+1)) done } @@ -82,8 +82,7 @@ function validate_services() { function validate_microservices() { # Check if the microservices are running correctly. - # TODO: Any results check required?? - sleep 3m + # tgi for llm service validate_services \ "${ip_address}:8008/generate" \