From a1d12add28e03bde466acfe365b898ac57447ada Mon Sep 17 00:00:00 2001 From: zhihang Date: Mon, 26 May 2025 03:44:19 +0000 Subject: [PATCH] add AudioQnA v1.2 --- AI/image-list.yml | 1 + AI/opea/audioqna-ui/1.0/24.03-lts/Dockerfile | 32 ++++++ AI/opea/audioqna-ui/1.2/24.03-lts/Dockerfile | 32 ++++++ AI/opea/audioqna-ui/meta.yml | 7 ++ AI/opea/audioqna/.meta.yml.swp | Bin 0 -> 12288 bytes .../1.0/{24.03-LTS => 24.03-lts}/Dockerfile | 0 AI/opea/audioqna/1.2/24.03-lts/Dockerfile | 33 ++++++ AI/opea/audioqna/README.md | 105 ++++++++++++++++++ AI/opea/audioqna/doc/compose.yml | 80 +++++++++++++ AI/opea/audioqna/doc/set_env.sh | 13 +++ AI/opea/audioqna/meta.yml | 6 +- AI/opea/speecht5/1.2/24.03-lts/Dockerfile | 42 +++++++ AI/opea/speecht5/meta.yml | 6 +- AI/opea/whisper/1.2/24.03-lts/Dockerfile | 43 +++++++ AI/opea/whisper/meta.yml | 6 +- 15 files changed, 403 insertions(+), 3 deletions(-) create mode 100644 AI/opea/audioqna-ui/1.0/24.03-lts/Dockerfile create mode 100644 AI/opea/audioqna-ui/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/audioqna-ui/meta.yml create mode 100644 AI/opea/audioqna/.meta.yml.swp rename AI/opea/audioqna/1.0/{24.03-LTS => 24.03-lts}/Dockerfile (100%) create mode 100644 AI/opea/audioqna/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/audioqna/README.md create mode 100644 AI/opea/audioqna/doc/compose.yml create mode 100644 AI/opea/audioqna/doc/set_env.sh create mode 100644 AI/opea/speecht5/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/whisper/1.2/24.03-lts/Dockerfile diff --git a/AI/image-list.yml b/AI/image-list.yml index 561eabcb..48621b20 100644 --- a/AI/image-list.yml +++ b/AI/image-list.yml @@ -11,6 +11,7 @@ images: oneapi-runtime: oneapi-runtime asr: opea/asr audioqna: opea/audioqna + audioqna-ui: opea/audioqna-ui chatqna-conversation-ui: opea/chatqna-conversation-ui chatqna-ui: opea/chatqna-ui chatqna: opea/chatqna diff --git a/AI/opea/audioqna-ui/1.0/24.03-lts/Dockerfile b/AI/opea/audioqna-ui/1.0/24.03-lts/Dockerfile new file mode 100644 index 00000000..585d4052 --- /dev/null +++ b/AI/opea/audioqna-ui/1.0/24.03-lts/Dockerfile @@ -0,0 +1,32 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Use node 20.11.1 as the base image +FROM openeuler/openeuler:24.03-lts + +# Update package manager and install Git +RUN yum update -y && \ + yum install -y \ + python python-pip \ + npm \ + git + +WORKDIR /home/user + +# Copy the front-end code repository +RUN git clone -b v1.0 https://github.com/opea-project/GenAIExamples.git + +# Set the working directory +WORKDIR /home/user/GenAIExamples/AudioQnA/ui/svelte + +# Install front-end dependencies +RUN npm install + +# Build the front-end application +RUN npm run build + +# Expose the port of the front-end application +EXPOSE 5173 + +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/AI/opea/audioqna-ui/1.2/24.03-lts/Dockerfile b/AI/opea/audioqna-ui/1.2/24.03-lts/Dockerfile new file mode 100644 index 00000000..8879265e --- /dev/null +++ b/AI/opea/audioqna-ui/1.2/24.03-lts/Dockerfile @@ -0,0 +1,32 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Use node 20.11.1 as the base image +FROM openeuler/openeuler:24.03-lts + +# Update package manager and install Git +RUN yum update -y && \ + yum install -y \ + python python-pip \ + npm \ + git + +WORKDIR /home/user + +# Copy the front-end code repository +RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git + +# Set the working directory +WORKDIR /home/user/GenAIExamples/AudioQnA/ui/svelte + +# Install front-end dependencies +RUN npm install + +# Build the front-end application +RUN npm run build + +# Expose the port of the front-end application +EXPOSE 5173 + +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] diff --git a/AI/opea/audioqna-ui/meta.yml b/AI/opea/audioqna-ui/meta.yml new file mode 100644 index 00000000..0343efe1 --- /dev/null +++ b/AI/opea/audioqna-ui/meta.yml @@ -0,0 +1,7 @@ +1.0-oe2403lts: + path: 1.0/24.03-lts/Dockerfile + arch: x86_64 + +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 diff --git a/AI/opea/audioqna/.meta.yml.swp b/AI/opea/audioqna/.meta.yml.swp new file mode 100644 index 0000000000000000000000000000000000000000..7553cc035926d1e51d2dd43947eda2d100648e44 GIT binary patch literal 12288 zcmeI&%}T>S5C`z77rlt0M=z_Mlihr@*4_j`dgxKFvT4^Qm@m^5)Po;y;4}CJzJZ>- z_$c}YPD%t3+Tc<7FAT%(>@4gLatKMFPWl6}Z!6-lP87U);p5Q?1@Bu_WLa4)H;uM$ zIqj~sS0#7B=9}t3c^yWfPRBCKO=_mGDXdX8Jm(Z8dTb{0pkI}=)YDOvU8GtjrquRT z5-&IzB?v&ESzwhs*O@))yF1%rbK|(V1v?-B0SG_<0uX=z1Rwx`eJgb@yzkW z@xW2-yW_xs00bZa0SG_<0uX=z1Rwwb2teQ$0z&9w81}?vw{zO@Nr+sRJaueWy1uPE iD=sJUaQ27%Sri-Mf|VK9R~{F7#0_)$)x3W7z5f$OKTxj# literal 0 HcmV?d00001 diff --git a/AI/opea/audioqna/1.0/24.03-LTS/Dockerfile b/AI/opea/audioqna/1.0/24.03-lts/Dockerfile similarity index 100% rename from AI/opea/audioqna/1.0/24.03-LTS/Dockerfile rename to AI/opea/audioqna/1.0/24.03-lts/Dockerfile diff --git a/AI/opea/audioqna/1.2/24.03-lts/Dockerfile b/AI/opea/audioqna/1.2/24.03-lts/Dockerfile new file mode 100644 index 00000000..5bcfe2e5 --- /dev/null +++ b/AI/opea/audioqna/1.2/24.03-lts/Dockerfile @@ -0,0 +1,33 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Stage 1: base setup used by other stages +FROM openeuler/openeuler:24.03-lts + +# get security updates +RUN yum update -y && \ + yum install -y \ + python python-pip \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user + +USER user + +WORKDIR /home/user + +RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt + +ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps + +RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git + +RUN cp -r GenAIExamples/AudioQnA/audioqna.py . && \ + rm -rf GenAIExamples + +ENTRYPOINT ["python", "audioqna.py"] \ No newline at end of file diff --git a/AI/opea/audioqna/README.md b/AI/opea/audioqna/README.md new file mode 100644 index 00000000..e514a44c --- /dev/null +++ b/AI/opea/audioqna/README.md @@ -0,0 +1,105 @@ +# Quick reference + +- The offical OPEA docker images + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative) + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community) + +# OPEA | openEuler + +Current OPEA docker images are built on the [openEuler](https://repo.openeuler.org/)⁠. This repository is free to use and exempted from per-user rate limits. + +OPEA is an open platform project that lets you create open, multi-provider, robust, and composable GenAI solutions that harness the best innovation across the ecosystem. + +The OPEA platform includes: + +- Detailed framework of composable building blocks for state-of-the-art generative AI systems including LLMs, data stores, and prompt engines + +- Architectural blueprints of retrieval-augmented generative AI component stack structure and end-to-end workflows + +- A four-step assessment for grading generative AI systems around performance, features, trustworthiness, and enterprise-grade readiness + +Read more about OPEA at [opea.dev](https://opea.dev/) and explore the OPEA technical documentation at [opea-project.github.io](https://opea-project.github.io/) + +# Supported tags and respective Dockerfile links + +The tag of each AudioQnA docker image is consist of the version of AudioQnA and the version of basic image. The details are as follows + +| Tags | Currently | Architectures| +|--|--|--| +|[1.0-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/opea/audioqna/1.0/24.03-lts/Dockerfile)| AudioQnA 1.0 on openEuler 24.03-LTS | amd64 | +|[1.2-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/opea/audioqna/1.2/24.03-lts/Dockerfile)| AudioQnA 1.2 on openEuler 24.03-LTS | amd64 | + +# Usage + +The AudioQnA service can be effortlessly deployed on Intel Gaudi2, Intel Xeon Scalable Processors and Nvidia GPU. + +Two types of AudioQnA pipeline are supported now: `AudioQnA with/without Rerank`. And the `AudioQnA without Rerank` pipeline (including Embedding, Retrieval, and LLM) is offered for Xeon customers who can not run rerank service on HPU yet require high performance and accuracy. + +Quick Start Deployment Steps: + +1. Set up the environment variables. +2. Run Docker Compose. +3. Consume the AudioQnA Service. + +### Quick Start: 1.Setup Environment Variable + +To set up environment variables for deploying AudioQnA services, follow these steps: + +1. Set the required environment variables: + + ```bash + # Example: host_ip="192.168.1.1" + export host_ip="External_Public_IP" + # Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1" + export no_proxy="Your_No_Proxy" + export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token" + ``` + +2. If you are in a proxy environment, also set the proxy-related environment variables: + + ```bash + export http_proxy="Your_HTTP_Proxy" + export https_proxy="Your_HTTPs_Proxy" + ``` + +3. Set up other environment variables: + + > Get `set_env.sh` here: [set_env.sh](https://gitee.com/openeuler/openeuler-docker-images/tree/master/AI/opea/audioqna/doc/set_env.sh) + + ```bash + # on Xeon + source set_env.sh + ``` + +### Quick Start: 2.Run Docker Compose + +Select the compose.yaml file that matches your hardware. + +CPU example: + +> Get `compose.yml` here: [compose.yml](https://gitee.com/openeuler/openeuler-docker-images/tree/master/AI/opea/audioqna/doc/compose.yml) + +```bash +docker compose -f compose.yml up -d +``` + +It will automatically download the docker image on `docker hub`: + +```bash +docker pull openeuler/audioqna:latest +docker pull openeuler/audioqna-ui:latest +``` + +### QuickStart: 3.Consume the AudioQnA Service + +Test the AudioQnA megaservice by recording a .wav file, encoding the file into the base64 format, and then sending the base64 string to the megaservice endpoint. The megaservice will return a spoken response as a base64 string. To listen to the response, decode the base64 string and save it as a .wav file. + +```bash +# voice can be "default" or "male" +curl http://${host_ip}:3008/v1/audioqna \ + -X POST \ + -d '{"audio": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA", "max_tokens":64, "voice":"default"}' \ + -H 'Content-Type: application/json' | sed 's/^"//;s/"$//' | base64 -d > output.wav +``` \ No newline at end of file diff --git a/AI/opea/audioqna/doc/compose.yml b/AI/opea/audioqna/doc/compose.yml new file mode 100644 index 00000000..ad6750a6 --- /dev/null +++ b/AI/opea/audioqna/doc/compose.yml @@ -0,0 +1,80 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +services: + whisper-service: + image: openeuler/whisper:1.2-oe2403lts + container_name: whisper-service + ports: + - "7066:7066" + ipc: host + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + restart: unless-stopped + speecht5-service: + image: openeuler/speecht5:1.2-oe2403lts + container_name: speecht5-service + ports: + - "7055:7055" + ipc: host + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + restart: unless-stopped + tgi-service: + image: openeuler/text-generation-inference-cpu:2.4.0-oe2403lts + container_name: tgi-service + ports: + - "3006:80" + volumes: + - "./data:/data" + shm_size: 1g + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + HF_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + command: --model-id ${LLM_MODEL_ID} --cuda-graphs 0 + audioqna-xeon-backend-server: + image: openeuler/audioqna:1.2-oe2403lts + container_name: audioqna-xeon-backend-server + depends_on: + - whisper-service + - tgi-service + - speecht5-service + ports: + - "3008:8888" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP} + - WHISPER_SERVER_HOST_IP=${WHISPER_SERVER_HOST_IP} + - WHISPER_SERVER_PORT=${WHISPER_SERVER_PORT} + - LLM_SERVER_HOST_IP=${LLM_SERVER_HOST_IP} + - LLM_SERVER_PORT=${LLM_SERVER_PORT} + - SPEECHT5_SERVER_HOST_IP=${SPEECHT5_SERVER_HOST_IP} + - SPEECHT5_SERVER_PORT=${SPEECHT5_SERVER_PORT} + ipc: host + restart: always + audioqna-xeon-ui-server: + image: openeuler/audioqna-ui:1.2-oe2403lts + container_name: audioqna-xeon-ui-server + depends_on: + - audioqna-xeon-backend-server + ports: + - "5173:5173" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - CHAT_URL=${BACKEND_SERVICE_ENDPOINT} + ipc: host + restart: always + +networks: + default: + driver: bridge \ No newline at end of file diff --git a/AI/opea/audioqna/doc/set_env.sh b/AI/opea/audioqna/doc/set_env.sh new file mode 100644 index 00000000..972e9fe8 --- /dev/null +++ b/AI/opea/audioqna/doc/set_env.sh @@ -0,0 +1,13 @@ + +export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3 + +export MEGA_SERVICE_HOST_IP=${host_ip} +export WHISPER_SERVER_HOST_IP=${host_ip} +export SPEECHT5_SERVER_HOST_IP=${host_ip} +export LLM_SERVER_HOST_IP=${host_ip} + +export WHISPER_SERVER_PORT=7066 +export SPEECHT5_SERVER_PORT=7055 +export LLM_SERVER_PORT=3006 + +export BACKEND_SERVICE_ENDPOINT=http://${host_ip}:3008/v1/audioqna \ No newline at end of file diff --git a/AI/opea/audioqna/meta.yml b/AI/opea/audioqna/meta.yml index 4cae4dd4..0343efe1 100644 --- a/AI/opea/audioqna/meta.yml +++ b/AI/opea/audioqna/meta.yml @@ -1,3 +1,7 @@ 1.0-oe2403lts: path: 1.0/24.03-lts/Dockerfile - arch: x86_64 \ No newline at end of file + arch: x86_64 + +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 diff --git a/AI/opea/speecht5/1.2/24.03-lts/Dockerfile b/AI/opea/speecht5/1.2/24.03-lts/Dockerfile new file mode 100644 index 00000000..b57ac995 --- /dev/null +++ b/AI/opea/speecht5/1.2/24.03-lts/Dockerfile @@ -0,0 +1,42 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +RUN yum update -y && \ + yum install -y \ + python python-pip \ + ffmpeg \ + curl \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user/ + +# Set environment variables +ENV LANG=en_US.UTF-8 +ARG ARCH=cpu + +USER user +WORKDIR /home/user + +RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git + +RUN cp -r GenAIComps/comps . && \ + rm -rf GenAIComps + + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + if [ "${ARCH}" = "cpu" ]; then \ + pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu ; \ + pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/tts/src/integrations/dependency/speecht5/requirements.txt ; \ + else \ + pip install --no-cache-dir -r /home/user/comps/tts/src/integrations/dependency/speecht5/requirements.txt ; \ + fi + +ENV PYTHONPATH=$PYTHONPATH:/home/user + +WORKDIR /home/user/comps/tts/src/integrations/dependency/speecht5 + +ENTRYPOINT ["python", "speecht5_server.py", "--device", "cpu"] \ No newline at end of file diff --git a/AI/opea/speecht5/meta.yml b/AI/opea/speecht5/meta.yml index 4cae4dd4..0343efe1 100644 --- a/AI/opea/speecht5/meta.yml +++ b/AI/opea/speecht5/meta.yml @@ -1,3 +1,7 @@ 1.0-oe2403lts: path: 1.0/24.03-lts/Dockerfile - arch: x86_64 \ No newline at end of file + arch: x86_64 + +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 diff --git a/AI/opea/whisper/1.2/24.03-lts/Dockerfile b/AI/opea/whisper/1.2/24.03-lts/Dockerfile new file mode 100644 index 00000000..44921547 --- /dev/null +++ b/AI/opea/whisper/1.2/24.03-lts/Dockerfile @@ -0,0 +1,43 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +RUN yum update -y && \ + yum install -y \ + curl \ + python python-pip \ + ffmpeg \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user/ + +# Set environment variables +ENV LANG=en_US.UTF-8 +ARG ARCH=cpu + +USER user +WORKDIR /home/user + +RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git + +RUN cp -r GenAIComps/comps . && \ + rm -rf GenAIComps + + +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r /home/user/comps/asr/src/requirements.txt && \ + if [ "${ARCH}" = "cpu" ]; then \ + pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu ; \ + pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/asr/src/requirements.txt ; \ + else \ + pip install --no-cache-dir -r /home/user/comps/asr/src/requirements.txt ; \ + fi + +ENV PYTHONPATH=$PYTHONPATH:/home/user + +WORKDIR /home/user/comps/asr/src/integrations/dependency/whisper + +ENTRYPOINT ["python", "whisper_server.py", "--device", "cpu"] diff --git a/AI/opea/whisper/meta.yml b/AI/opea/whisper/meta.yml index 4cae4dd4..0343efe1 100644 --- a/AI/opea/whisper/meta.yml +++ b/AI/opea/whisper/meta.yml @@ -1,3 +1,7 @@ 1.0-oe2403lts: path: 1.0/24.03-lts/Dockerfile - arch: x86_64 \ No newline at end of file + arch: x86_64 + +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 -- Gitee