Skip to content

Commit

Permalink
add ci for both remote and local models deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
etwk committed Aug 2, 2024
1 parent a5800e0 commit 74c1fe6
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and Push remote version
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.remote
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/check:remote

- name: Build and Push local version
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.local
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/check:local


9 changes: 9 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM intel/intel-optimized-pytorch:2.3.0-serving-cpu
WORKDIR /app
COPY requirements.local.txt /app
RUN pip install --no-cache-dir -r requirements.local.txt
COPY . /app
EXPOSE 8000
ENV NAME "Fact-check API"
WORKDIR /app/src
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
4 changes: 2 additions & 2 deletions Dockerfile → Dockerfile.remote
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11-slim-bookworm
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
COPY requirements.remote.txt /app
RUN pip install --no-cache-dir -r requirements.remote.txt
COPY . /app
EXPOSE 8000
ENV NAME "Fact-check API"
Expand Down
8 changes: 8 additions & 0 deletions requirements.local.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
aiohttp
fastapi
llama-index
llama-index-embeddings-huggingface
llama-index-embeddings-ollama
llama-index-postprocessor-jinaai-rerank
pyautogen
uvicorn
File renamed without changes.
4 changes: 2 additions & 2 deletions src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def get_automerging_query_engine(

if RAG_MODEL_DEPLOY == "local":
rerank = SentenceTransformerRerank(
top_n=rerank_top_n, model="jinaai/jina-reranker-v2-base-multilingual"
)
top_n=rerank_top_n, model="BAAI/bge-reranker-v2-m3",
) # todo: add support `trust_remote_code=True`
else:
rerank = jinaai_rerank.JinaRerank(api_key='', top_n=rerank_top_n, model="jina-reranker-v2")

Expand Down

0 comments on commit 74c1fe6

Please sign in to comment.