Skip to content

Commit

Permalink
Merge branch 'main' into base-image
Browse files Browse the repository at this point in the history
  • Loading branch information
xiguiw authored Jan 13, 2025
2 parents c106cbf + ea72c94 commit 15bac5c
Show file tree
Hide file tree
Showing 112 changed files with 1,085 additions and 671 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

* [email protected] [email protected] [email protected]
/.github/ [email protected] [email protected]
/comps/3rd_parties/ [email protected] [email protected] [email protected]
/comps/third_parties/ [email protected] [email protected] [email protected]
/comps/agent/ [email protected] [email protected]
/comps/animation/ [email protected] [email protected]
/comps/asr/ [email protected] [email protected]
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/docker/compose/3rd_parties-compose.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/docker/compose/animation-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ services:
image: ${REGISTRY:-opea}/animation:${TAG:-latest}
wav2lip:
build:
dockerfile: comps/animation/src/integration/dependency/Dockerfile
dockerfile: comps/third_parties/wav2lip/src/Dockerfile
image: ${REGISTRY:-opea}/wav2lip:${TAG:-latest}
wav2lip-gaudi:
build:
dockerfile: comps/animation/src/integration/dependency/Dockerfile.intel_hpu
dockerfile: comps/third_parties/wav2lip/src/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/wav2lip-gaudi:${TAG:-latest}
12 changes: 0 additions & 12 deletions .github/workflows/docker/compose/embeddings-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,3 @@ services:
build:
dockerfile: comps/embeddings/src/Dockerfile
image: ${REGISTRY:-opea}/embedding:${TAG:-latest}
embedding-multimodal-clip:
build:
dockerfile: comps/embeddings/src/integrations/dependency/clip/Dockerfile
image: ${REGISTRY:-opea}/embedding-multimodal-clip:${TAG:-latest}
embedding-multimodal-bridgetower:
build:
dockerfile: comps/embeddings/src/integrations/dependency/bridgetower/Dockerfile
image: ${REGISTRY:-opea}/embedding-multimodal-bridgetower:${TAG:-latest}
embedding-multimodal-bridgetower-gaudi:
build:
dockerfile: comps/embeddings/src/integrations/dependency/bridgetower/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/embedding-multimodal-bridgetower-gaudi:${TAG:-latest}
10 changes: 3 additions & 7 deletions .github/workflows/docker/compose/llms-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ services:
build:
dockerfile: comps/llms/summarization/tgi/langchain/Dockerfile
image: ${REGISTRY:-opea}/llm-docsum-tgi:${TAG:-latest}
llm-faqgen-tgi:
llm-faqgen:
build:
dockerfile: comps/llms/faq-generation/tgi/langchain/Dockerfile
image: ${REGISTRY:-opea}/llm-faqgen-tgi:${TAG:-latest}
dockerfile: comps/llms/src/faq-generation/Dockerfile
image: ${REGISTRY:-opea}/llm-faqgen:${TAG:-latest}
llm-native:
build:
dockerfile: comps/llms/text-generation/native/langchain/Dockerfile
Expand Down Expand Up @@ -54,7 +54,3 @@ services:
build:
dockerfile: comps/llms/summarization/vllm/langchain/Dockerfile
image: ${REGISTRY:-opea}/llm-docsum-vllm:${TAG:-latest}
llm-faqgen-vllm:
build:
dockerfile: comps/llms/faq-generation/vllm/langchain/Dockerfile
image: ${REGISTRY:-opea}/llm-faqgen-vllm:${TAG:-latest}
28 changes: 28 additions & 0 deletions .github/workflows/docker/compose/third_parties-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

services:
nginx:
build:
dockerfile: comps/third_parties/nginx/src/Dockerfile
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
embedding-multimodal-clip:
build:
dockerfile: comps/third_parties/clip/src/Dockerfile
image: ${REGISTRY:-opea}/embedding-multimodal-clip:${TAG:-latest}
embedding-multimodal-bridgetower:
build:
dockerfile: comps/third_parties/bridgetower/src/Dockerfile
image: ${REGISTRY:-opea}/embedding-multimodal-bridgetower:${TAG:-latest}
embedding-multimodal-bridgetower-gaudi:
build:
dockerfile: comps/third_parties/bridgetower/src/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/embedding-multimodal-bridgetower-gaudi:${TAG:-latest}
wav2lip:
build:
dockerfile: comps/third_parties/wav2lip/src/Dockerfile
image: ${REGISTRY:-opea}/wav2lip:${TAG:-latest}
wav2lip-gaudi:
build:
dockerfile: comps/third_parties/wav2lip/src/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/wav2lip-gaudi:${TAG:-latest}
4 changes: 2 additions & 2 deletions .github/workflows/scripts/get_test_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function find_test_1() {
changed_integrations=$(printf '%s\n' "${changed_files[@]}"| grep ${service_path} | grep -E 'integrations' | cut -d'/' -f$((n+2)) | cut -d'.' -f1 | sort -u) || true
for integration in ${changed_integrations}; do
# Accurate matching test scripts
# find_test=$(find ./tests -type f \( -name test_${service_name}_${integration}.sh -o -name test_${service_name}_${integration}_on_*.sh \)) || true
# find_test=$(find ./tests -type f \( -name test_${service_name}_${integrations}.sh -o -name test_${service_name}_${integrations}_on_*.sh \)) || true
# Fuzzy matching test scripts, for example, llms/src/text-generation/integrations/opea.py match several tests.
find_test=$(find ./tests -type f -name test_${service_name}_${integration}*.sh) || true
if [ "$find_test" ]; then
Expand Down Expand Up @@ -110,7 +110,7 @@ function find_test_2() {

function main() {

changed_files=$(printf '%s\n' "${changed_files_full[@]}" | grep 'comps/' | grep -vE '\.md|comps/cores|comps/3rd_parties|deployment|\.yaml') || true
changed_files=$(printf '%s\n' "${changed_files_full[@]}" | grep 'comps/' | grep -vE '\.md|comps/cores|comps/third_parties|deployment|\.yaml') || true
echo "===========start find_test_1============"
echo "changed_files=${changed_files}"
find_test_1 "comps" 2 false
Expand Down
8 changes: 4 additions & 4 deletions comps/animation/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ cd GenAIComps
- Xeon CPU

```bash
docker build -t opea/wav2lip:latest -f comps/animation/src/integration/dependency/Dockerfile .
docker build -t opea/wav2lip:latest -f comps/third_parties/wav2lip/src/Dockerfile .
```

- Gaudi2 HPU

```bash
docker build -t opea/wav2lip-gaudi:latest -f comps/animation/src/integration/dependency/Dockerfile.intel_hpu .
docker build -t opea/wav2lip-gaudi:latest -f comps/third_parties/wav2lip/src/Dockerfile.intel_hpu .
```

### 1.1.2 Animation server image
Expand Down Expand Up @@ -101,7 +101,7 @@ Once microservice starts, user can use below script to validate the running micr

```bash
cd GenAIComps
python3 comps/animation/src/integration/dependency/check_wav2lip_server.py
python3 comps/third_parties/wav2lip/src/check_wav2lip_server.py
```

## 3.2 Validate Animation service
Expand All @@ -116,7 +116,7 @@ or

```bash
cd GenAIComps
python3 comps/animation/src/integration/dependency/check_animation_server.py
python3 comps/third_parties/wav2lip/src/check_animation_server.py
```

The expected output will be a message similar to the following:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, name: str, description: str, config: dict = None):
if not health_status:
logger.error("OpeaAnimation health check failed.")

def invoke(self, input: str):
async def invoke(self, input: str):
"""Invokes the animation service to generate embeddings for the animation input.
Args:
Expand Down
6 changes: 3 additions & 3 deletions comps/animation/src/opea_animation_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# GenAIComps
from comps import CustomLogger, OpeaComponentLoader
from comps.animation.src.integration.opea import OpeaAnimation
from comps.animation.src.integrations.wav2lip import OpeaAnimation

logger = CustomLogger("opea_animation")
logflag = os.getenv("LOGFLAG", False)
Expand Down Expand Up @@ -43,10 +43,10 @@
output_datatype=VideoPath,
)
@register_statistics(names=["opea_service@animation"])
def animate(audio: Base64ByteStrDoc):
async def animate(audio: Base64ByteStrDoc):
start = time.time()

outfile = loader.invoke(audio.byte_str)
outfile = await loader.invoke(audio.byte_str)
if logflag:
logger.info(f"Video generated successfully, check {outfile} for the result.")

Expand Down
56 changes: 28 additions & 28 deletions comps/animation/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
aiohttp==3.10.11
basicsr==1.4.2
aiohttp
basicsr
docarray[full]
facexlib==0.3.0
fastapi==0.115.2
ffmpeg-python==0.2.0
gradio==4.38.1
gradio_client==1.1.0
grpcio==1.64.1
huggingface-hub==0.24.0
librosa==0.10.2
lmdb==1.5.1
numba==0.60.0
numpy==1.23.5
opencv-python==4.10.0.84
opentelemetry-api==1.27.0
opentelemetry-exporter-otlp==1.27.0
opentelemetry-sdk==1.27.0
pandas==2.2.3
prometheus-fastapi-instrumentator==7.0.0
pyarrow==17.0.0
pydantic==2.9.2
pyyaml==6.0
scipy==1.14.0
shortuuid==1.0.13
tavily-python==0.5.0
tb-nightly==2.18.0a20240721
tqdm==4.66.4
yapf==0.40.2
facexlib
fastapi
ffmpeg-python
gradio
gradio_client
grpcio
huggingface-hub
librosa
lmdb
numba
numpy
opencv-python
opentelemetry-api
opentelemetry-exporter-otlp
opentelemetry-sdk
pandas
prometheus-fastapi-instrumentator
pyarrow
pydantic
pyyaml
scipy
shortuuid
tavily-python
tb-nightly
tqdm
yapf
4 changes: 2 additions & 2 deletions comps/cores/proto/api_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,10 @@ class FineTuningJobWandbIntegration(BaseModel):

class FineTuningJobWandbIntegrationObject(BaseModel):
type: Literal["wandb"]
"""The type of the integration being enabled for the fine-tuning job."""
"""The type of the integrations being enabled for the fine-tuning job."""

wandb: FineTuningJobWandbIntegration
"""The settings for your integration with Weights and Biases.
"""The settings for your integrations with Weights and Biases.
This payload specifies the project that metrics will be sent to. Optionally, you
can set an explicit display name for your run, add tags to your run, and set a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from PIL import Image

from comps import opea_microservices, register_microservice
from comps.embeddings.src.integrations.dependency.bridgetower.bridgetower_embedding import BridgeTowerEmbedding
from comps.third_parties.bridgetower.src.bridgetower_embedding import BridgeTowerEmbedding

device = "cpu"
upload_folder = "./uploaded_files/"
Expand Down

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions comps/embeddings/src/opea_embedding_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
import time

from integrations.opea_tei_embedding import OpeaTEIEmbedding
from integrations.predictionguard_embedding import PredictionguardEmbedding
from integrations.predictionguard import PredictionguardEmbedding
from integrations.tei import OpeaTEIEmbedding

from comps import (
CustomLogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import time

from integrations.opea_multimodal_embedding_bridgetower import OpeaMultimodalEmbeddingBrigeTower
from integrations.multimodal_bridgetower import OpeaMultimodalEmbeddingBrigeTower

from comps import (
CustomLogger,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion comps/finetuning/src/opea_finetuning_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from comps import CustomLogger, opea_microservices, register_microservice
from comps.cores.proto.api_protocol import FineTuningJobIDRequest, UploadFileRequest
from comps.finetuning.src.integrations.finetune_config import FineTuningParams
from comps.finetuning.src.integrations.opea import OpeaFinetuning, upload_file
from comps.finetuning.src.integrations.native import OpeaFinetuning, upload_file
from comps.finetuning.src.opea_finetuning_loader import OpeaFinetuningLoader

logger = CustomLogger("opea_finetuning_microservice")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
import base64
import os
import tempfile
import threading

from comps import CustomLogger, OpeaComponent, OpeaComponentRegistry, SDImg2ImgInputs, ServiceType
Expand Down Expand Up @@ -99,7 +100,7 @@ def __init__(
if not health_status:
logger.error("OpeaImageToImage health check failed.")

def invoke(self, input: SDImg2ImgInputs):
async def invoke(self, input: SDImg2ImgInputs):
"""Invokes the ImageToImage service to generate Images for the provided input.
Args:
Expand All @@ -113,16 +114,15 @@ def invoke(self, input: SDImg2ImgInputs):
images = pipe(
image=image, prompt=prompt, generator=generator, num_images_per_prompt=num_images_per_prompt
).images
image_path = os.path.join(os.getcwd(), prompt.strip().replace(" ", "_").replace("/", ""))
os.makedirs(image_path, exist_ok=True)
results = []
for i, image in enumerate(images):
save_path = os.path.join(image_path, f"image_{i + 1}.png")
image.save(save_path)
with open(save_path, "rb") as f:
bytes = f.read()
b64_str = base64.b64encode(bytes).decode()
results.append(b64_str)
with tempfile.TemporaryDirectory() as image_path:
for i, image in enumerate(images):
save_path = os.path.join(image_path, f"image_{i + 1}.png")
image.save(save_path)
with open(save_path, "rb") as f:
bytes = f.read()
b64_str = base64.b64encode(bytes).decode()
results.append(b64_str)

return results

Expand Down
6 changes: 3 additions & 3 deletions comps/image2image/src/opea_image2image_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
register_statistics,
statistics_dict,
)
from comps.image2image.src.integration.opea_image2image_native import OpeaImageToImage
from comps.image2image.src.integrations.native import OpeaImageToImage

args = None

Expand All @@ -36,9 +36,9 @@
output_datatype=SDOutputs,
)
@register_statistics(names=["opea_service@image2image"])
def image2image(input: SDImg2ImgInputs):
async def image2image(input: SDImg2ImgInputs):
start = time.time()
results = component_loader.invoke(input)
results = await component_loader.invoke(input)
statistics_dict["opea_service@image2image"].append_latency(time.time() - start, None)
return SDOutputs(images=results)

Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions comps/image2video/src/opea_image2video_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import os
import time

from integrations.opea import OpeaImage2video

from comps import (
CustomLogger,
ImagesPath,
Expand All @@ -18,6 +16,7 @@
register_statistics,
statistics_dict,
)
from comps.image2video.src.integrations.native import OpeaImage2video

logger = CustomLogger("opea_image2video_microservice")

Expand Down
Loading

0 comments on commit 15bac5c

Please sign in to comment.