From cb4b6679f839e48033143261d2337ef19b5825b4 Mon Sep 17 00:00:00 2001 From: zhihang Date: Mon, 19 May 2025 09:41:48 +0000 Subject: [PATCH 1/4] add docsum and codetrans --- AI/image-list.yml | 3 +- AI/opea/codegen/README.md | 4 +- AI/opea/codetrans-ui/1.2/24.03-lts/Dockerfile | 31 ++++ AI/opea/codetrans/1.2/24.03-lts/Dockerfile | 36 ++++ AI/opea/codetrans/README.md | 115 ++++++++++++ AI/opea/codetrans/doc/compose.yml | 88 +++++++++ AI/opea/codetrans/doc/set_env.sh | 15 ++ AI/opea/codetrans/meta.yml | 7 +- .../docsum-gradio-ui/1.2/24.03-lts/Dockerfile | 39 ++++ AI/opea/docsum-ui/1.2/24.03-lts/Dockerfile | 31 ++++ AI/opea/docsum-ui/meta.yml | 4 + AI/opea/docsum/1.2/24.03-lts/Dockerfile | 34 ++++ AI/opea/docsum/README.md | 173 ++++++++++++++++++ AI/opea/docsum/doc/compose.yml | 92 ++++++++++ AI/opea/docsum/doc/set_env.sh | 21 +++ AI/opea/docsum/meta.yml | 6 +- AI/opea/llm-docsum/1.2/24.03-lts/Dockerfile | 36 ++++ AI/vllm-ascend/README.md | 2 + 18 files changed, 733 insertions(+), 4 deletions(-) create mode 100644 AI/opea/codetrans-ui/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/codetrans/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/codetrans/README.md create mode 100644 AI/opea/codetrans/doc/compose.yml create mode 100644 AI/opea/codetrans/doc/set_env.sh create mode 100644 AI/opea/docsum-gradio-ui/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/docsum-ui/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/docsum/1.2/24.03-lts/Dockerfile create mode 100644 AI/opea/docsum/README.md create mode 100644 AI/opea/docsum/doc/compose.yml create mode 100644 AI/opea/docsum/doc/set_env.sh create mode 100644 AI/opea/llm-docsum/1.2/24.03-lts/Dockerfile diff --git a/AI/image-list.yml b/AI/image-list.yml index ba5e7e6..68d02d0 100644 --- a/AI/image-list.yml +++ b/AI/image-list.yml @@ -30,6 +30,7 @@ images: llm-tgi: opea/llm-tgi llm-vllm: opea/llm-vllm llm-textgen: opea/llm-textgen + llm-docsum: opea/llm-docsum reranking-tei: opea/reranking-tei retriever-redis: opea/retriever-redis searchqna: opea/searchqna @@ -56,4 +57,4 @@ images: videoqna-ui: opea/videoqna-ui embedding-multimodal-clip: opea/embedding-multimodal-clip reranking-videoqna: opea/reranking-videoqna - retriever-vdms: opea/retriever-vdms \ No newline at end of file + retriever-vdms: opea/retriever-vdms diff --git a/AI/opea/codegen/README.md b/AI/opea/codegen/README.md index aaec253..f197dd5 100644 --- a/AI/opea/codegen/README.md +++ b/AI/opea/codegen/README.md @@ -8,7 +8,7 @@ # OPEA | openEuler -Current Redis docker images are built on the [openEuler](https://repo.openeuler.org/)⁠. This repository is free to use and exempted from per-user rate limits. +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. @@ -30,6 +30,8 @@ The tag of each CodeGen docker image is consist of the version of CodeGen and th |--|--|--| |[1.0-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/opea/codegen/1.0/24.03-lts/Dockerfile)| CodeGen 1.0 on openEuler 24.03-LTS | amd64 | +|[1.2-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/opea/codegen/1.2/24.03-lts/Dockerfile)| CodeGen 1.2 on openEuler 24.03-LTS | amd64 | + # Usage The CodeGen service can be effortlessly deployed on either Intel Gaudi2 or Intel Xeon Scalable Processor. diff --git a/AI/opea/codetrans-ui/1.2/24.03-lts/Dockerfile b/AI/opea/codetrans-ui/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000..5e36d9f --- /dev/null +++ b/AI/opea/codetrans-ui/1.2/24.03-lts/Dockerfile @@ -0,0 +1,31 @@ +# 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 \ + 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/CodeTrans/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/codetrans/1.2/24.03-lts/Dockerfile b/AI/opea/codetrans/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000..48d960e --- /dev/null +++ b/AI/opea/codetrans/1.2/24.03-lts/Dockerfile @@ -0,0 +1,36 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +# get security updates +RUN yum update -y && \ + yum install -y \ + python-pip python \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user + +WORKDIR /home/user + +RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git + + +WORKDIR /home/user/GenAIComps +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt + +WORKDIR /home/user +RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git +RUN cp GenAIExamples/CodeTrans/code_translation.py . +RUN rm -rf GenAIExamples + +ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps + +USER user + +WORKDIR /home/user + +ENTRYPOINT ["python", "code_translation.py"] diff --git a/AI/opea/codetrans/README.md b/AI/opea/codetrans/README.md new file mode 100644 index 0000000..83d7561 --- /dev/null +++ b/AI/opea/codetrans/README.md @@ -0,0 +1,115 @@ +# 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 CodeTrans docker image is consist of the version of CodeTrans 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/codetrans/1.0/24.03-lts/Dockerfile)| CodeTrans 1.0 on openEuler 24.03-LTS | amd64 | + +|[1.2-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/opea/codetrans/1.2/24.03-lts/Dockerfile)| CodeTrans 1.2 on openEuler 24.03-LTS | amd64 | + +# Usage + +The CodeTrans service can be effortlessly deployed on either Intel Gaudi2 or Intel Xeon Scalable Processor. + +Currently we support two ways of deploying CodeTrans services with docker compose: + +1. Start services using the docker image on `docker hub`: + + ```bash + docker pull openeuler/codetrans:latest + ``` + +2. Start services using the docker images built from source. + +### Required Models + +By default, the LLM model is set to a default value as listed below: + +| Service | Model | +| ------- | ---------------------------------- | +| LLM | mistralai/Mistral-7B-Instruct-v0.3 | + +### Quick Start: 1.Setup Environment Variable + +To set up environment variables for deploying CodeTrans 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/codetrans/doc/set_env.sh) + + ```bash + source set_env.sh + ``` + +### Quick Start: 2.Run Docker Compose + +> Get `compose.yml` here: [compose.yml](https://gitee.com/openeuler/openeuler-docker-images/tree/master/AI/opea/codetrans/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/codetrans:latest +docker pull openeuler/codetrans-ui:latest +``` + +### QuickStart: 3.Consume the CodeGen Service + +1. Use cURL command on terminal + + ```bash + curl http://${host_ip}:7777/v1/codetrans \ + -H "Content-Type: application/json" \ + -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' + ``` + +2. Access via frontend + + To access the frontend, open the following URL in your browser: http://{host_ip}:5173. + + By default, the UI runs on port 5173 internally. diff --git a/AI/opea/codetrans/doc/compose.yml b/AI/opea/codetrans/doc/compose.yml new file mode 100644 index 0000000..e033d0b --- /dev/null +++ b/AI/opea/codetrans/doc/compose.yml @@ -0,0 +1,88 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +services: + tgi-service: + image: openeuler/text-generation-inference-cpu:2.4.0-oe2403lts + container_name: codetrans-tgi-service + ports: + - "8008: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} + host_ip: ${host_ip} + command: --model-id ${LLM_MODEL_ID} --cuda-graphs 0 + llm: + image: openeuler/llm-textgen:latest + container_name: llm-textgen-server + depends_on: + - tgi-service + ports: + - "9000:9000" + ipc: host + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + LLM_ENDPOINT: ${TGI_LLM_ENDPOINT} + LLM_MODEL_ID: ${LLM_MODEL_ID} + HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + restart: unless-stopped + codetrans-xeon-backend-server: + image: openeuler/codetrans:latest + container_name: codetrans-xeon-backend-server + depends_on: + - tgi-service + - llm + ports: + - "7777:7777" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP} + - LLM_SERVICE_HOST_IP=${LLM_SERVICE_HOST_IP} + ipc: host + restart: always + codetrans-xeon-ui-server: + image: openeuler/codetrans-ui:latest + container_name: codetrans-xeon-ui-server + depends_on: + - codetrans-xeon-backend-server + ports: + - "5173:5173" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - BASE_URL=${BACKEND_SERVICE_ENDPOINT} + ipc: host + restart: always + codetrans-xeon-nginx-server: + image: openeuler/nginx:latest + container_name: codetrans-xeon-nginx-server + depends_on: + - codetrans-xeon-backend-server + - codetrans-xeon-ui-server + ports: + - "${NGINX_PORT:-80}:80" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - FRONTEND_SERVICE_IP=${FRONTEND_SERVICE_IP} + - FRONTEND_SERVICE_PORT=${FRONTEND_SERVICE_PORT} + - BACKEND_SERVICE_NAME=${BACKEND_SERVICE_NAME} + - BACKEND_SERVICE_IP=${BACKEND_SERVICE_IP} + - BACKEND_SERVICE_PORT=${BACKEND_SERVICE_PORT} + ipc: host + restart: always + +networks: + default: + driver: bridge \ No newline at end of file diff --git a/AI/opea/codetrans/doc/set_env.sh b/AI/opea/codetrans/doc/set_env.sh new file mode 100644 index 0000000..130edb4 --- /dev/null +++ b/AI/opea/codetrans/doc/set_env.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +export LLM_MODEL_ID="mistralai/Mistral-7B-Instruct-v0.3" +export TGI_LLM_ENDPOINT="http://${host_ip}:8008" +export MEGA_SERVICE_HOST_IP=${host_ip} +export LLM_SERVICE_HOST_IP=${host_ip} +export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:7777/v1/codetrans" +export FRONTEND_SERVICE_IP=${host_ip} +export FRONTEND_SERVICE_PORT=5173 +export BACKEND_SERVICE_NAME=codetrans +export BACKEND_SERVICE_IP=${host_ip} +export BACKEND_SERVICE_PORT=7777 \ No newline at end of file diff --git a/AI/opea/codetrans/meta.yml b/AI/opea/codetrans/meta.yml index 4cae4dd..0b3cee6 100644 --- a/AI/opea/codetrans/meta.yml +++ b/AI/opea/codetrans/meta.yml @@ -1,3 +1,8 @@ 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/docsum-gradio-ui/1.2/24.03-lts/Dockerfile b/AI/opea/docsum-gradio-ui/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000..5a46605 --- /dev/null +++ b/AI/opea/docsum-gradio-ui/1.2/24.03-lts/Dockerfile @@ -0,0 +1,39 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Use the official Python 3.11 slim image as the base image +FROM openeuler/openeuler:24.03-lts + +# Set the default language environment variable +ENV LANG=C.UTF-8 + +# Define a build argument for architecture (default is "cpu") +ARG ARCH="cpu" + +# Update the package list and install necessary packages +RUN yum update -y && \ + yum install -y \ + python python-pip \ + gcc gcc-c++ make cmake \ + git + +# Create a directory for the application +RUN mkdir -p /home/user + +# Copy the application code and requirements file to the container +RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git + +RUN cp -r GenAIExamples/DocSum/ui/gradio/* /home/user/ + +# Install Python dependencies +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r /home/user/requirements.txt + +# Set the working directory +WORKDIR /home/user/ + +# Expose the port that the application will run on +EXPOSE 5173 + +# Define the command to run the application +CMD ["python", "docsum_ui_gradio.py"] \ No newline at end of file diff --git a/AI/opea/docsum-ui/1.2/24.03-lts/Dockerfile b/AI/opea/docsum-ui/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000..bb62c7d --- /dev/null +++ b/AI/opea/docsum-ui/1.2/24.03-lts/Dockerfile @@ -0,0 +1,31 @@ +# 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 \ + 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/DocSum/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/docsum-ui/meta.yml b/AI/opea/docsum-ui/meta.yml index 55f9e33..0343efe 100644 --- a/AI/opea/docsum-ui/meta.yml +++ b/AI/opea/docsum-ui/meta.yml @@ -1,3 +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/docsum/1.2/24.03-lts/Dockerfile b/AI/opea/docsum/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000..cbb654a --- /dev/null +++ b/AI/opea/docsum/1.2/24.03-lts/Dockerfile @@ -0,0 +1,34 @@ +# 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-pip python \ + git + +RUN useradd -m -s /bin/bash user && \ + mkdir -p /home/user && \ + chown -R user /home/user + +WORKDIR /home/user + +RUN git clone -b v1.2 https://github.com/opea-project/GenAIComps.git + +WORKDIR /home/user/GenAIComps +RUN pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt + +WORKDIR /home/user +RUN git clone -b v1.2 https://github.com/opea-project/GenAIExamples.git && cd GenAIExamples +RUN cp GenAIExamples/DocSum/docsum.py . +RUN rm -rf GenAIExamples + +ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps + +USER user + +ENTRYPOINT ["python", "docsum.py"] \ No newline at end of file diff --git a/AI/opea/docsum/README.md b/AI/opea/docsum/README.md new file mode 100644 index 0000000..2678f06 --- /dev/null +++ b/AI/opea/docsum/README.md @@ -0,0 +1,173 @@ +# 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 DocSum docker image is consist of the version of DocSum 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/docsum/1.0/24.03-lts/Dockerfile)| DocSum 1.0 on openEuler 24.03-LTS | amd64 | + +|[1.2-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/opea/docsum/1.2/24.03-lts/Dockerfile)| DocSum 1.2 on openEuler 24.03-LTS | amd64 | + +# Usage + +The DocSum service can be effortlessly deployed on either Intel Gaudi2 or Intel Xeon Scalable Processor. + +Currently we support two ways of deploying DocSum services with docker compose: + +1. Start services using the docker image on `docker hub`: + + ```bash + docker pull openeuler/docsum:latest + ``` + +2. Start services using the docker images built from source. + +### Required Models + +Default model is "Intel/neural-chat-7b-v3-3". Change "LLM_MODEL_ID" environment variable in commands below if you want to use another model. + +### Quick Start: 1.Setup Environment Variable + +To set up environment variables for deploying DocSum 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/docsum/doc/set_env.sh) + + ```bash + source set_env.sh + ``` + +### Quick Start: 2.Run Docker Compose + +> Get `compose.yml` here: [compose.yml](https://gitee.com/openeuler/openeuler-docker-images/tree/master/AI/opea/docsum/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/docsum:latest +docker pull openeuler/docsum-ui:latest +``` + +### QuickStart: 3.Consume the DocSum Service + +1. Use cURL command on terminal + + ```bash + curl -X POST http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: application/json" \ + -d '{"type": "text", "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."}' + + # Use English mode (default). + curl http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: multipart/form-data" \ + -F "type=text" \ + -F "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." \ + -F "max_tokens=32" \ + -F "language=en" \ + -F "stream=true" + + # Use Chinese mode. + curl http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: multipart/form-data" \ + -F "type=text" \ + -F "messages=2024年9月26日,北京——今日,英特尔正式发布英特尔® 至强® 6性能核处理器(代号Granite Rapids),为AI、数据分析、科学计算等计算密集型业务提供卓越性能。" \ + -F "max_tokens=32" \ + -F "language=zh" \ + -F "stream=true" + + # Upload file + curl http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: multipart/form-data" \ + -F "type=text" \ + -F "messages=" \ + -F "files=@/path to your file (.txt, .docx, .pdf)" \ + -F "max_tokens=32" \ + -F "language=en" \ + -F "stream=true" + ``` + + > Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI. + + Audio: + + ```bash + curl -X POST http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: application/json" \ + -d '{"type": "audio", "messages": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' + + curl http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: multipart/form-data" \ + -F "type=audio" \ + -F "messages=UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" \ + -F "max_tokens=32" \ + -F "language=en" \ + -F "stream=true" + ``` + + Video: + + ```bash + curl -X POST http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: application/json" \ + -d '{"type": "video", "messages": "convert your video to base64 data type"}' + + curl http://${host_ip}:8888/v1/docsum \ + -H "Content-Type: multipart/form-data" \ + -F "type=video" \ + -F "messages=convert your video to base64 data type" \ + -F "max_tokens=32" \ + -F "language=en" \ + -F "stream=true" + ``` + +2. Access via frontend + + To access the frontend, open the following URL in your browser: http://{host_ip}:5173. + + By default, the UI runs on port 5173 internally. diff --git a/AI/opea/docsum/doc/compose.yml b/AI/opea/docsum/doc/compose.yml new file mode 100644 index 0000000..528b163 --- /dev/null +++ b/AI/opea/docsum/doc/compose.yml @@ -0,0 +1,92 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +services: + tgi-server: + image: openeuler/text-generation-inference-cpu:2.4.0-oe2403lts + container_name: tgi-server + ports: + - ${LLM_ENDPOINT_PORT:-8008}:80 + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + TGI_LLM_ENDPOINT: ${TGI_LLM_ENDPOINT} + HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + host_ip: ${host_ip} + LLM_ENDPOINT_PORT: ${LLM_ENDPOINT_PORT} + volumes: + - "./data:/data" + shm_size: 1g + command: --model-id ${LLM_MODEL_ID} --cuda-graphs 0 --max-input-length ${MAX_INPUT_TOKENS} --max-total-tokens ${MAX_TOTAL_TOKENS} + + llm-docsum-tgi: + image: openeuler/llm-docsum:latest + container_name: llm-docsum-server + depends_on: + - tgi-server + ports: + - ${DOCSUM_PORT:-9000}:9000 + ipc: host + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + LLM_ENDPOINT: ${LLM_ENDPOINT} + HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + MAX_INPUT_TOKENS: ${MAX_INPUT_TOKENS} + MAX_TOTAL_TOKENS: ${MAX_TOTAL_TOKENS} + LLM_MODEL_ID: ${LLM_MODEL_ID} + DocSum_COMPONENT_NAME: ${DocSum_COMPONENT_NAME} + LOGFLAG: ${LOGFLAG:-False} + restart: unless-stopped + + whisper: + image: openeuler/whisper:latest + container_name: whisper-server + ports: + - "7066:7066" + ipc: host + environment: + no_proxy: ${no_proxy} + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + restart: unless-stopped + + docsum-xeon-backend-server: + image: openeuler/docsum:latest + container_name: docsum-xeon-backend-server + depends_on: + - tgi-server + - llm-docsum-tgi + ports: + - "8888:8888" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP} + - LLM_SERVICE_HOST_IP=${LLM_SERVICE_HOST_IP} + - ASR_SERVICE_HOST_IP=${ASR_SERVICE_HOST_IP} + ipc: host + restart: always + + docsum-gradio-ui: + image: openeuler/docsum-gradio-ui:latest + container_name: docsum-xeon-ui-server + depends_on: + - docsum-xeon-backend-server + ports: + - "5173:5173" + environment: + - no_proxy=${no_proxy} + - https_proxy=${https_proxy} + - http_proxy=${http_proxy} + - BACKEND_SERVICE_ENDPOINT=${BACKEND_SERVICE_ENDPOINT} + - DOC_BASE_URL=${BACKEND_SERVICE_ENDPOINT} + ipc: host + restart: always + +networks: + default: + driver: bridge \ No newline at end of file diff --git a/AI/opea/docsum/doc/set_env.sh b/AI/opea/docsum/doc/set_env.sh new file mode 100644 index 0000000..df65801 --- /dev/null +++ b/AI/opea/docsum/doc/set_env.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +export MAX_INPUT_TOKENS=1024 +export MAX_TOTAL_TOKENS=2048 + +export no_proxy="${no_proxy},${host_ip}" +export MEGA_SERVICE_HOST_IP=${host_ip} +export TGI_LLM_ENDPOINT="http://${host_ip}:8008" +export LLM_SERVICE_HOST_IP=${host_ip} +export ASR_SERVICE_HOST_IP=${host_ip} +export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3" + +export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/docsum" + +export LLM_ENDPOINT_PORT=8008 +export DOCSUM_PORT=9000 +export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}" +export DocSum_COMPONENT_NAME="OpeaDocSumTgi" \ No newline at end of file diff --git a/AI/opea/docsum/meta.yml b/AI/opea/docsum/meta.yml index 4cae4dd..0343efe 100644 --- a/AI/opea/docsum/meta.yml +++ b/AI/opea/docsum/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/llm-docsum/1.2/24.03-lts/Dockerfile b/AI/opea/llm-docsum/1.2/24.03-lts/Dockerfile new file mode 100644 index 0000000..70443b1 --- /dev/null +++ b/AI/opea/llm-docsum/1.2/24.03-lts/Dockerfile @@ -0,0 +1,36 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +FROM openeuler/openeuler:24.03-lts + +ARG ARCH="cpu" + +RUN yum update -y && \ + yum install -y \ + python-pip python \ + mesa-libGL \ + jemalloc-devel \ + 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 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; fi && \ + pip install --no-cache-dir -r /home/user/comps/llms/src/doc-summarization/requirements.txt + +ENV PYTHONPATH=$PYTHONPATH:/home/user + +WORKDIR /home/user/comps/llms/src/doc-summarization + +ENTRYPOINT ["bash", "entrypoint.sh"] \ No newline at end of file diff --git a/AI/vllm-ascend/README.md b/AI/vllm-ascend/README.md index 99d1322..4c01231 100644 --- a/AI/vllm-ascend/README.md +++ b/AI/vllm-ascend/README.md @@ -28,6 +28,8 @@ The tag of each vLLM Ascend docker image is consist of the version of vLLM Ascen |[0.7.3-torch_npu2.5.1-cann8.1.rc1-python3.10-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/vllm-ascend/0.7.3-torch_npu2.5.1-cann8.1.rc1-python3.10/22.03-lts/Dockerfile)| vLLM Ascend 0.7.3 on openEuler 22.03-LTS | amd64, arm64 | +|[0.8.4rc1-torch_npu2.5.1-cann8.0.0-python3.10-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/vllm-ascend/0.8.4rc1-torch_npu2.5.1-cann8.0.0-python3.10/22.03-lts/Dockerfile)| vLLM Ascend 0.8.4rc1 on openEuler 22.03-LTS | amd64, arm64 | + |[0.8.5rc1-torch_npu2.5.1-cann8.1.rc1-python3.10-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/AI/vllm-ascend/0.8.5rc1-torch_npu2.5.1-cann8.1.rc1-python3.10/22.03-lts/Dockerfile)| vLLM Ascend 0.8.5rc1 on openEuler 22.03-LTS | amd64, arm64 | # Usage -- Gitee From fd742916f1f19ece2f08b1df04ef66fe8f4a5724 Mon Sep 17 00:00:00 2001 From: zhihang Date: Mon, 19 May 2025 09:53:08 +0000 Subject: [PATCH 2/4] update AI/opea/llm-docsum/meta.yml --- AI/opea/llm-docsum/meta.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 AI/opea/llm-docsum/meta.yml diff --git a/AI/opea/llm-docsum/meta.yml b/AI/opea/llm-docsum/meta.yml new file mode 100644 index 0000000..ee4b49e --- /dev/null +++ b/AI/opea/llm-docsum/meta.yml @@ -0,0 +1,3 @@ +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file -- Gitee From 3376e3780e1725e4e1ab04cb25146d4cbc5e0df3 Mon Sep 17 00:00:00 2001 From: zhihang Date: Mon, 19 May 2025 09:57:01 +0000 Subject: [PATCH 3/4] update AI/opea/codetrans-ui/meta.yml --- AI/opea/codetrans-ui/meta.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AI/opea/codetrans-ui/meta.yml b/AI/opea/codetrans-ui/meta.yml index 4cae4dd..0e6dfdc 100644 --- a/AI/opea/codetrans-ui/meta.yml +++ b/AI/opea/codetrans-ui/meta.yml @@ -1,3 +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 \ No newline at end of file -- Gitee From c79ba314c95c15b378f0ed8759911522675350c5 Mon Sep 17 00:00:00 2001 From: zhihang Date: Mon, 19 May 2025 09:58:50 +0000 Subject: [PATCH 4/4] update mage-list.yml --- AI/image-list.yml | 1 + AI/opea/docsum-gradio-ui/meta.yml | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 AI/opea/docsum-gradio-ui/meta.yml diff --git a/AI/image-list.yml b/AI/image-list.yml index 68d02d0..0d8411d 100644 --- a/AI/image-list.yml +++ b/AI/image-list.yml @@ -31,6 +31,7 @@ images: llm-vllm: opea/llm-vllm llm-textgen: opea/llm-textgen llm-docsum: opea/llm-docsum + docsum-gradio-ui: opea/docsum-gradio-ui reranking-tei: opea/reranking-tei retriever-redis: opea/retriever-redis searchqna: opea/searchqna diff --git a/AI/opea/docsum-gradio-ui/meta.yml b/AI/opea/docsum-gradio-ui/meta.yml new file mode 100644 index 0000000..ee4b49e --- /dev/null +++ b/AI/opea/docsum-gradio-ui/meta.yml @@ -0,0 +1,3 @@ +1.2-oe2403lts: + path: 1.2/24.03-lts/Dockerfile + arch: x86_64 \ No newline at end of file -- Gitee