Skip to content

Commit

Permalink
0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matatonic committed Apr 11, 2024
1 parent 1ed8c9c commit c65f54c
Show file tree
Hide file tree
Showing 43 changed files with 709 additions and 555 deletions.
69 changes: 8 additions & 61 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
labels: version=${{ github.run_id }}

build-and-push-cogvlm-image:
build-and-push-alt-image:
runs-on: ubuntu-latest

permissions:
Expand All @@ -77,7 +77,7 @@ jobs:
env:
# Set up environment variables for the job
DOCKER_REGISTRY: ghcr.io
IMAGE_NAME: matatonic/cogvlm
IMAGE_NAME: matatonic/openedai-vision-alt
TAG: ${{ github.sha }}

steps:
Expand Down Expand Up @@ -109,7 +109,9 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.cogvlm
build-args: |
VERSION =alt
file: Dockerfile
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: version=${{ github.run_id }}
Expand All @@ -120,65 +122,10 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.cogvlm
build-args: |
VERSION =alt
file: Dockerfile
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
labels: version=${{ github.run_id }}

build-and-push-yi-vl-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

env:
# Set up environment variables for the job
DOCKER_REGISTRY: ghcr.io
IMAGE_NAME: matatonic/yi-vl
TAG: ${{ github.sha }}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

# Log in to the GitHub Container Registry only when not running on a pull request event
- name: Login to Docker Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push the Docker image to GHCR for the main branch or specific tags
- name: Build and Push Docker Image
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.yi-vl
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: version=${{ github.run_id }}

# For tagged releases, build and push the Docker image with the corresponding tag
- name: Build and Push Docker Image (Tagged)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.yi-vl
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
labels: version=${{ github.run_id }}
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@ RUN apt-get update && apt-get install -y git
RUN pip install --no-cache-dir --upgrade pip

RUN mkdir -p /app
RUN git clone https://github.com/01-ai/Yi --single-branch /app/Yi
RUN git clone https://github.com/dvlab-research/MiniGemini.git --single-branch /app/MiniGemini

WORKDIR /app
RUN pip install --no-cache-dir -U https://github.com/Dao-AILab/flash-attention/releases/download/v2.5.7/flash_attn-2.5.7+cu122torch2.2cxx11abiFALSE-cp311-cp311-linux_x86_64.whl
COPY requirements.txt .
RUN pip install --no-cache-dir -U -r requirements.txt

RUN git clone https://github.com/dvlab-research/MiniGemini.git --single-branch /app/MiniGemini
ARG VERSION=latest
# transformers==4.36.2 supports most models except Mini-Gemini-2B, llava-1.6, nanollava
RUN if [ "$VERSION" = "alt" ]; then echo "transformers==4.36.2" >> requirements.txt; else echo "transformers>=4.39.0" >> requirements.txt ; fi
# TODO: nvidia apex wheel
RUN pip install --no-cache-dir -U -r requirements.txt \
https://github.com/Dao-AILab/flash-attention/releases/download/v2.5.7/flash_attn-2.5.7+cu122torch2.2cxx11abiFALSE-cp311-cp311-linux_x86_64.whl

WORKDIR /app/MiniGemini
RUN pip install --no-cache-dir --no-deps -e .

WORKDIR /app
COPY requirements.*.txt .
RUN for r in requirements.*.txt ; do pip install -U --no-cache-dir -r $r; done

RUN pip install --no-cache-dir -U openai

COPY *.py .
COPY backend /app/backend

COPY model_conf_tests.json /app/model_conf_tests.json

ENV CLI_COMMAND="python vision.py"
CMD $CLI_COMMAND
10 changes: 0 additions & 10 deletions Dockerfile.cogvlm

This file was deleted.

25 changes: 0 additions & 25 deletions Dockerfile.minigemini

This file was deleted.

10 changes: 0 additions & 10 deletions Dockerfile.yi-vl

This file was deleted.

Loading

0 comments on commit c65f54c

Please sign in to comment.