Integrate DocSum set_env to ut scripts. (#1860)
Integrate DocSum set_env to ut scripts. Add README.md for DocSum and InstructionTuning UT scripts. Signed-off-by: ZePan110 <ze.pan@intel.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
# Copyright (C) 2024 Advanced Micro Devices, Inc.
|
# Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
export HOST_IP=''
|
export HOST_IP=${ip_address}
|
||||||
export DOCSUM_MAX_INPUT_TOKENS="2048"
|
export DOCSUM_MAX_INPUT_TOKENS="2048"
|
||||||
export DOCSUM_MAX_TOTAL_TOKENS="4096"
|
export DOCSUM_MAX_TOTAL_TOKENS="4096"
|
||||||
export DOCSUM_LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
export DOCSUM_LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Copyright (C) 2024 Advanced Micro Devices, Inc.
|
# Copyright (C) 2024 Advanced Micro Devices, Inc.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
export HOST_IP=''
|
export HOST_IP=${ip_address}
|
||||||
export DOCSUM_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
export DOCSUM_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||||
export DOCSUM_MAX_INPUT_TOKENS=2048
|
export DOCSUM_MAX_INPUT_TOKENS=2048
|
||||||
export DOCSUM_MAX_TOTAL_TOKENS=4096
|
export DOCSUM_MAX_TOTAL_TOKENS=4096
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export no_proxy="${no_proxy},${host_ip}" # Example: no_proxy="localhost, 127.0.0
|
|||||||
export http_proxy=$http_proxy
|
export http_proxy=$http_proxy
|
||||||
export https_proxy=$https_proxy
|
export https_proxy=$https_proxy
|
||||||
export host_ip=$(hostname -I | awk '{print $1}') # Example: host_ip="192.168.1.1"
|
export host_ip=$(hostname -I | awk '{print $1}') # Example: host_ip="192.168.1.1"
|
||||||
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||||
|
|
||||||
export LLM_ENDPOINT_PORT=8008
|
export LLM_ENDPOINT_PORT=8008
|
||||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
||||||
@@ -20,10 +20,12 @@ export MAX_TOTAL_TOKENS=2048
|
|||||||
export LLM_PORT=9000
|
export LLM_PORT=9000
|
||||||
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
||||||
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM" # OpeaDocSumTgi
|
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM" # OpeaDocSumTgi
|
||||||
|
export FRONTEND_SERVICE_PORT=5173
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||||
export LLM_SERVICE_HOST_IP=${host_ip}
|
export LLM_SERVICE_HOST_IP=${host_ip}
|
||||||
export ASR_SERVICE_HOST_IP=${host_ip}
|
export ASR_SERVICE_HOST_IP=${host_ip}
|
||||||
|
|
||||||
export BACKEND_SERVICE_PORT=8888
|
export BACKEND_SERVICE_PORT=8888
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
||||||
|
|
||||||
|
export LOGFLAG=True
|
||||||
|
|||||||
45
DocSum/tests/README.md
Normal file
45
DocSum/tests/README.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# DocSum E2E test scripts
|
||||||
|
|
||||||
|
## Set the required environment variable
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run test
|
||||||
|
|
||||||
|
On Intel Xeon with vLLM:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_on_xeon.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
On Intel Xeon with TGI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_tgi_on_xeon.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
On Intel Gaudi with vLLM:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_on_gaudi.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
On Intel Gaudi with TGI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_tgi_on_gaudi.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
On AMD ROCm with TGI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_on_rocm.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
On AMD ROCm with vLLM:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_vllm_on_rocm.sh
|
||||||
|
```
|
||||||
@@ -10,35 +10,22 @@ export http_proxy=$http_proxy
|
|||||||
export https_proxy=$https_proxy
|
export https_proxy=$https_proxy
|
||||||
export host_ip=$(hostname -I | awk '{print $1}')
|
export host_ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
|
WORKPATH=$(dirname "$PWD")
|
||||||
|
LOG_PATH="$WORKPATH/tests"
|
||||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||||
export no_proxy="${no_proxy},${host_ip}"
|
|
||||||
export MODEL_CACHE=${model_cache:-"./data"}
|
|
||||||
export REGISTRY=${IMAGE_REPO}
|
export REGISTRY=${IMAGE_REPO}
|
||||||
export TAG=${IMAGE_TAG}
|
export TAG=${IMAGE_TAG}
|
||||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
source $WORKPATH/docker_compose/set_env.sh
|
||||||
export LLM_ENDPOINT_PORT=8008
|
|
||||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
export MODEL_CACHE=${model_cache:-"./data"}
|
||||||
|
|
||||||
export NUM_CARDS=1
|
export NUM_CARDS=1
|
||||||
export BLOCK_SIZE=128
|
export BLOCK_SIZE=128
|
||||||
export MAX_NUM_SEQS=256
|
export MAX_NUM_SEQS=256
|
||||||
export MAX_SEQ_LEN_TO_CAPTURE=2048
|
export MAX_SEQ_LEN_TO_CAPTURE=2048
|
||||||
export MAX_INPUT_TOKENS=2048
|
export MAX_INPUT_TOKENS=2048
|
||||||
export MAX_TOTAL_TOKENS=4096
|
export MAX_TOTAL_TOKENS=4096
|
||||||
export LLM_PORT=9000
|
|
||||||
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
|
||||||
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM"
|
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export LLM_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export ASR_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export FRONTEND_SERVICE_PORT=5173
|
|
||||||
export BACKEND_SERVICE_PORT=8888
|
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
|
||||||
export LOGFLAG=True
|
|
||||||
|
|
||||||
WORKPATH=$(dirname "$PWD")
|
|
||||||
LOG_PATH="$WORKPATH/tests"
|
|
||||||
|
|
||||||
|
|
||||||
# Get the root folder of the current script
|
# Get the root folder of the current script
|
||||||
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
||||||
|
|||||||
@@ -14,21 +14,8 @@ export MODEL_CACHE=${model_cache:-"./data"}
|
|||||||
WORKPATH=$(dirname "$PWD")
|
WORKPATH=$(dirname "$PWD")
|
||||||
LOG_PATH="$WORKPATH/tests"
|
LOG_PATH="$WORKPATH/tests"
|
||||||
ip_address=$(hostname -I | awk '{print $1}')
|
ip_address=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
export HOST_IP=${ip_address}
|
|
||||||
export host_ip=${ip_address}
|
export host_ip=${ip_address}
|
||||||
export DOCSUM_MAX_INPUT_TOKENS="2048"
|
source $WORKPATH/docker_compose/amd/gpu/rocm/set_env.sh
|
||||||
export DOCSUM_MAX_TOTAL_TOKENS="4096"
|
|
||||||
export DOCSUM_LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
|
||||||
export DOCSUM_TGI_SERVICE_PORT="8008"
|
|
||||||
export DOCSUM_TGI_LLM_ENDPOINT="http://${HOST_IP}:${DOCSUM_TGI_SERVICE_PORT}"
|
|
||||||
export DOCSUM_HUGGINGFACEHUB_API_TOKEN=''
|
|
||||||
export DOCSUM_WHISPER_PORT="7066"
|
|
||||||
export ASR_SERVICE_HOST_IP="${HOST_IP}"
|
|
||||||
export DOCSUM_LLM_SERVER_PORT="9000"
|
|
||||||
export DOCSUM_BACKEND_SERVER_PORT="18072"
|
|
||||||
export DOCSUM_FRONTEND_PORT="18073"
|
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
|
|
||||||
|
|
||||||
function build_docker_images() {
|
function build_docker_images() {
|
||||||
opea_branch=${opea_branch:-"main"}
|
opea_branch=${opea_branch:-"main"}
|
||||||
@@ -129,7 +116,7 @@ function validate_microservices() {
|
|||||||
# whisper microservice
|
# whisper microservice
|
||||||
ulimit -s 65536
|
ulimit -s 65536
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_WHISPER_PORT}/v1/asr" \
|
"${HOST_IP}:${DOCSUM_WHISPER_PORT}/v1/asr" \
|
||||||
'{"asr_result":"well"}' \
|
'{"asr_result":"well"}' \
|
||||||
"whisper-service" \
|
"whisper-service" \
|
||||||
"whisper-service" \
|
"whisper-service" \
|
||||||
@@ -137,7 +124,7 @@ function validate_microservices() {
|
|||||||
|
|
||||||
# tgi for llm service
|
# tgi for llm service
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_TGI_SERVICE_PORT}/generate" \
|
"${HOST_IP}:${DOCSUM_TGI_SERVICE_PORT}/generate" \
|
||||||
"generated_text" \
|
"generated_text" \
|
||||||
"docsum-tgi-service" \
|
"docsum-tgi-service" \
|
||||||
"docsum-tgi-service" \
|
"docsum-tgi-service" \
|
||||||
@@ -145,7 +132,7 @@ function validate_microservices() {
|
|||||||
|
|
||||||
# llm microservice
|
# llm microservice
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_LLM_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_LLM_SERVER_PORT}/v1/docsum" \
|
||||||
"text" \
|
"text" \
|
||||||
"docsum-llm-server" \
|
"docsum-llm-server" \
|
||||||
"docsum-llm-server" \
|
"docsum-llm-server" \
|
||||||
@@ -158,7 +145,7 @@ function validate_megaservice() {
|
|||||||
local DOCKER_NAME="docsum-backend-server"
|
local DOCKER_NAME="docsum-backend-server"
|
||||||
local EXPECTED_RESULT="[DONE]"
|
local EXPECTED_RESULT="[DONE]"
|
||||||
local INPUT_DATA="messages=Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."
|
local INPUT_DATA="messages=Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."
|
||||||
local URL="${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
|
local URL="${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
|
||||||
local DATA_TYPE="type=text"
|
local DATA_TYPE="type=text"
|
||||||
|
|
||||||
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F "$DATA_TYPE" -F "$INPUT_DATA" -H 'Content-Type: multipart/form-data' "$URL")
|
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F "$DATA_TYPE" -F "$INPUT_DATA" -H 'Content-Type: multipart/form-data' "$URL")
|
||||||
@@ -188,7 +175,7 @@ function validate_megaservice_json() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo ">>> Checking text data with Content-Type: application/json"
|
echo ">>> Checking text data with Content-Type: application/json"
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
||||||
"[DONE]" \
|
"[DONE]" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
@@ -196,7 +183,7 @@ function validate_megaservice_json() {
|
|||||||
|
|
||||||
echo ">>> Checking audio data"
|
echo ">>> Checking audio data"
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
||||||
"[DONE]" \
|
"[DONE]" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
@@ -204,7 +191,7 @@ function validate_megaservice_json() {
|
|||||||
|
|
||||||
echo ">>> Checking video data"
|
echo ">>> Checking video data"
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
||||||
"[DONE]" \
|
"[DONE]" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
|
|||||||
@@ -10,30 +10,18 @@ export http_proxy=$http_proxy
|
|||||||
export https_proxy=$https_proxy
|
export https_proxy=$https_proxy
|
||||||
export host_ip=$(hostname -I | awk '{print $1}')
|
export host_ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
|
||||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
|
||||||
export no_proxy="${no_proxy},${host_ip}"
|
|
||||||
export MODEL_CACHE=${model_cache:-"./data"}
|
|
||||||
export REGISTRY=${IMAGE_REPO}
|
|
||||||
export TAG=${IMAGE_TAG}
|
|
||||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
|
||||||
export LLM_ENDPOINT_PORT=8008
|
|
||||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
|
||||||
export MAX_INPUT_TOKENS=2048
|
|
||||||
export MAX_TOTAL_TOKENS=4096
|
|
||||||
export LLM_PORT=9000
|
|
||||||
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
|
||||||
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM"
|
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export LLM_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export ASR_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export FRONTEND_SERVICE_PORT=5173
|
|
||||||
export BACKEND_SERVICE_PORT=8888
|
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
|
||||||
export LOGFLAG=True
|
|
||||||
|
|
||||||
WORKPATH=$(dirname "$PWD")
|
WORKPATH=$(dirname "$PWD")
|
||||||
LOG_PATH="$WORKPATH/tests"
|
LOG_PATH="$WORKPATH/tests"
|
||||||
|
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||||
|
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||||
|
export REGISTRY=${IMAGE_REPO}
|
||||||
|
export TAG=${IMAGE_TAG}
|
||||||
|
|
||||||
|
source $WORKPATH/docker_compose/set_env.sh
|
||||||
|
export MODEL_CACHE=${model_cache:-"./data"}
|
||||||
|
|
||||||
|
export MAX_INPUT_TOKENS=2048
|
||||||
|
export MAX_TOTAL_TOKENS=4096
|
||||||
|
|
||||||
# Get the root folder of the current script
|
# Get the root folder of the current script
|
||||||
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
||||||
|
|||||||
@@ -9,32 +9,20 @@ IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
|||||||
export http_proxy=$http_proxy
|
export http_proxy=$http_proxy
|
||||||
export https_proxy=$https_proxy
|
export https_proxy=$https_proxy
|
||||||
export host_ip=$(hostname -I | awk '{print $1}')
|
export host_ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
|
||||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
|
||||||
export no_proxy="${no_proxy},${host_ip}"
|
|
||||||
export MODEL_CACHE=${model_cache:-"./data"}
|
|
||||||
export REGISTRY=${IMAGE_REPO}
|
|
||||||
export TAG=${IMAGE_TAG}
|
|
||||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
|
||||||
export LLM_ENDPOINT_PORT=8008
|
|
||||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
|
||||||
export MAX_INPUT_TOKENS=2048
|
|
||||||
export MAX_TOTAL_TOKENS=4096
|
|
||||||
export LLM_PORT=9000
|
|
||||||
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
|
||||||
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
|
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export LLM_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export ASR_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export FRONTEND_SERVICE_PORT=5173
|
|
||||||
export BACKEND_SERVICE_PORT=8888
|
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
|
||||||
export LOGFLAG=True
|
|
||||||
|
|
||||||
WORKPATH=$(dirname "$PWD")
|
WORKPATH=$(dirname "$PWD")
|
||||||
LOG_PATH="$WORKPATH/tests"
|
LOG_PATH="$WORKPATH/tests"
|
||||||
|
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||||
|
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||||
|
export REGISTRY=${IMAGE_REPO}
|
||||||
|
export TAG=${IMAGE_TAG}
|
||||||
|
|
||||||
|
source $WORKPATH/docker_compose/set_env.sh
|
||||||
|
export MODEL_CACHE=${model_cache:-"./data"}
|
||||||
|
|
||||||
|
export MAX_INPUT_TOKENS=2048
|
||||||
|
export MAX_TOTAL_TOKENS=4096
|
||||||
|
|
||||||
|
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
|
||||||
|
|
||||||
# Get the root folder of the current script
|
# Get the root folder of the current script
|
||||||
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
||||||
|
|||||||
@@ -9,31 +9,20 @@ IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
|||||||
export http_proxy=$http_proxy
|
export http_proxy=$http_proxy
|
||||||
export https_proxy=$https_proxy
|
export https_proxy=$https_proxy
|
||||||
export host_ip=$(hostname -I | awk '{print $1}')
|
export host_ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
|
||||||
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
|
||||||
export no_proxy="${no_proxy},${host_ip}"
|
|
||||||
export MODEL_CACHE=${model_cache:-"./data"}
|
|
||||||
export REGISTRY=${IMAGE_REPO}
|
|
||||||
export TAG=${IMAGE_TAG}
|
|
||||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
|
||||||
export LLM_ENDPOINT_PORT=8008
|
|
||||||
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
|
||||||
export MAX_INPUT_TOKENS=2048
|
|
||||||
export MAX_TOTAL_TOKENS=4096
|
|
||||||
export LLM_PORT=9000
|
|
||||||
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
|
|
||||||
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
|
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export LLM_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export ASR_SERVICE_HOST_IP=${host_ip}
|
|
||||||
export FRONTEND_SERVICE_PORT=5173
|
|
||||||
export BACKEND_SERVICE_PORT=8888
|
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
|
|
||||||
export LOGFLAG=True
|
|
||||||
|
|
||||||
WORKPATH=$(dirname "$PWD")
|
WORKPATH=$(dirname "$PWD")
|
||||||
LOG_PATH="$WORKPATH/tests"
|
LOG_PATH="$WORKPATH/tests"
|
||||||
|
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
|
||||||
|
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
|
||||||
|
export REGISTRY=${IMAGE_REPO}
|
||||||
|
export TAG=${IMAGE_TAG}
|
||||||
|
|
||||||
|
source $WORKPATH/docker_compose/set_env.sh
|
||||||
|
export MODEL_CACHE=${model_cache:-"./data"}
|
||||||
|
|
||||||
|
export MAX_INPUT_TOKENS=2048
|
||||||
|
export MAX_TOTAL_TOKENS=4096
|
||||||
|
|
||||||
|
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
|
||||||
|
|
||||||
# Get the root folder of the current script
|
# Get the root folder of the current script
|
||||||
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
|
||||||
|
|||||||
@@ -16,21 +16,7 @@ WORKPATH=$(dirname "$PWD")
|
|||||||
LOG_PATH="$WORKPATH/tests"
|
LOG_PATH="$WORKPATH/tests"
|
||||||
ip_address=$(hostname -I | awk '{print $1}')
|
ip_address=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
export host_ip=${ip_address}
|
source $WORKPATH/docker_compose/amd/gpu/rocm/set_env_vllm.sh
|
||||||
export HOST_IP=${ip_address}
|
|
||||||
export EXTERNAL_HOST_IP=${ip_address}
|
|
||||||
export DOCSUM_HUGGINGFACEHUB_API_TOKEN="${HUGGINGFACEHUB_API_TOKEN}"
|
|
||||||
export DOCSUM_MAX_INPUT_TOKENS=2048
|
|
||||||
export DOCSUM_MAX_TOTAL_TOKENS=4096
|
|
||||||
export DOCSUM_LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
|
|
||||||
export DOCSUM_VLLM_SERVICE_PORT="8008"
|
|
||||||
export DOCSUM_LLM_ENDPOINT="http://${HOST_IP}:${DOCSUM_VLLM_SERVICE_PORT}"
|
|
||||||
export DOCSUM_WHISPER_PORT="7066"
|
|
||||||
export ASR_SERVICE_HOST_IP="${HOST_IP}"
|
|
||||||
export DOCSUM_LLM_SERVER_PORT="9000"
|
|
||||||
export DOCSUM_BACKEND_SERVER_PORT="18072"
|
|
||||||
export DOCSUM_FRONTEND_PORT="18073"
|
|
||||||
export BACKEND_SERVICE_ENDPOINT="http://${EXTERNAL_HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
|
|
||||||
|
|
||||||
function build_docker_images() {
|
function build_docker_images() {
|
||||||
opea_branch=${opea_branch:-"main"}
|
opea_branch=${opea_branch:-"main"}
|
||||||
@@ -130,7 +116,7 @@ function validate_microservices() {
|
|||||||
# whisper microservice
|
# whisper microservice
|
||||||
ulimit -s 65536
|
ulimit -s 65536
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_WHISPER_PORT}/v1/asr" \
|
"${HOST_IP}:${DOCSUM_WHISPER_PORT}/v1/asr" \
|
||||||
'{"asr_result":"well"}' \
|
'{"asr_result":"well"}' \
|
||||||
"whisper-service" \
|
"whisper-service" \
|
||||||
"whisper-service" \
|
"whisper-service" \
|
||||||
@@ -138,7 +124,7 @@ function validate_microservices() {
|
|||||||
|
|
||||||
# vLLM service
|
# vLLM service
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_VLLM_SERVICE_PORT}/v1/chat/completions" \
|
"${HOST_IP}:${DOCSUM_VLLM_SERVICE_PORT}/v1/chat/completions" \
|
||||||
"content" \
|
"content" \
|
||||||
"docsum-vllm-service" \
|
"docsum-vllm-service" \
|
||||||
"docsum-vllm-service" \
|
"docsum-vllm-service" \
|
||||||
@@ -146,7 +132,7 @@ function validate_microservices() {
|
|||||||
|
|
||||||
# llm microservice
|
# llm microservice
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_LLM_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_LLM_SERVER_PORT}/v1/docsum" \
|
||||||
"text" \
|
"text" \
|
||||||
"docsum-llm-server" \
|
"docsum-llm-server" \
|
||||||
"docsum-llm-server" \
|
"docsum-llm-server" \
|
||||||
@@ -159,7 +145,7 @@ function validate_megaservice() {
|
|||||||
local DOCKER_NAME="docsum-backend-server"
|
local DOCKER_NAME="docsum-backend-server"
|
||||||
local EXPECTED_RESULT="[DONE]"
|
local EXPECTED_RESULT="[DONE]"
|
||||||
local INPUT_DATA="messages=Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."
|
local INPUT_DATA="messages=Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."
|
||||||
local URL="${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
|
local URL="${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
|
||||||
local DATA_TYPE="type=text"
|
local DATA_TYPE="type=text"
|
||||||
|
|
||||||
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F "$DATA_TYPE" -F "$INPUT_DATA" -H 'Content-Type: multipart/form-data' "$URL")
|
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F "$DATA_TYPE" -F "$INPUT_DATA" -H 'Content-Type: multipart/form-data' "$URL")
|
||||||
@@ -189,7 +175,7 @@ function validate_megaservice_json() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo ">>> Checking text data with Content-Type: application/json"
|
echo ">>> Checking text data with Content-Type: application/json"
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
||||||
"[DONE]" \
|
"[DONE]" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
@@ -197,7 +183,7 @@ function validate_megaservice_json() {
|
|||||||
|
|
||||||
echo ">>> Checking audio data"
|
echo ">>> Checking audio data"
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
||||||
"[DONE]" \
|
"[DONE]" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
@@ -205,7 +191,7 @@ function validate_megaservice_json() {
|
|||||||
|
|
||||||
echo ">>> Checking video data"
|
echo ">>> Checking video data"
|
||||||
validate_services \
|
validate_services \
|
||||||
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
|
||||||
"[DONE]" \
|
"[DONE]" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
"docsum-backend-server" \
|
"docsum-backend-server" \
|
||||||
|
|||||||
15
InstructionTuning/tests/README.md
Normal file
15
InstructionTuning/tests/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Translation E2E test scripts
|
||||||
|
|
||||||
|
## Set the required environment variable
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run test
|
||||||
|
|
||||||
|
On Intel Xeon:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash test_compose_on_xeon.sh
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user