-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Noop pipeline for local testing (#276)
- Loading branch information
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from PIL import Image | ||
import logging | ||
|
||
from .interface import Pipeline | ||
|
||
class Noop(Pipeline): | ||
def __init__(self, **params): | ||
super().__init__(**params) | ||
|
||
def process_frame(self, image: Image.Image) -> Image.Image: | ||
return image.convert("RGB") | ||
|
||
def update_params(self, **params): | ||
logging.info(f"Updating params: {params}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ARG BASE_IMAGE=livepeer/ai-runner:live-base | ||
FROM ${BASE_IMAGE} | ||
|
||
# Install latest stable Go version and system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
libcairo2-dev \ | ||
libgirepository1.0-dev \ | ||
pkg-config \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
ARG PYTHON_VERSION=3.10 | ||
RUN pyenv install $PYTHON_VERSION && \ | ||
pyenv global $PYTHON_VERSION && \ | ||
pyenv rehash | ||
|
||
# Upgrade pip and install required packages | ||
ARG PIP_VERSION=23.3.2 | ||
|
||
# Install any additional Python packages | ||
RUN pip install uvicorn==0.30.0 fastapi==0.111.0 numpy==1.26.4 torch==2.5.1 diffusers==0.30.0 transformers==4.43.3 aiohttp==3.10.9 pyzmq==26.2.0 | ||
|
||
# Set environment variables | ||
ENV MAX_WORKERS=1 | ||
ENV HUGGINGFACE_HUB_CACHE=/models | ||
ENV DIFFUSERS_CACHE=/models | ||
ENV MODEL_DIR=/models | ||
|
||
# Copy application files | ||
COPY app/ /app/app | ||
COPY images/ /app/images | ||
COPY bench.py /app/bench.py | ||
|
||
WORKDIR /app | ||
|
||
CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters