Skip to content

Commit 74c1fe6

Browse files
committed
add ci for both remote and local models deploy
1 parent a5800e0 commit 74c1fe6

File tree

6 files changed

+60
-4
lines changed

6 files changed

+60
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check Out Repo
12+
uses: actions/checkout@v3
13+
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v1
16+
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
22+
23+
- name: Build and Push remote version
24+
uses: docker/build-push-action@v2
25+
with:
26+
context: .
27+
file: ./Dockerfile.remote
28+
push: true
29+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/check:remote
30+
31+
- name: Build and Push local version
32+
uses: docker/build-push-action@v2
33+
with:
34+
context: .
35+
file: ./Dockerfile.local
36+
push: true
37+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/check:local
38+
39+

Dockerfile.local

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM intel/intel-optimized-pytorch:2.3.0-serving-cpu
2+
WORKDIR /app
3+
COPY requirements.local.txt /app
4+
RUN pip install --no-cache-dir -r requirements.local.txt
5+
COPY . /app
6+
EXPOSE 8000
7+
ENV NAME "Fact-check API"
8+
WORKDIR /app/src
9+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Dockerfile renamed to Dockerfile.remote

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM python:3.11-slim-bookworm
22
WORKDIR /app
3-
COPY requirements.txt /app
4-
RUN pip install --no-cache-dir -r requirements.txt
3+
COPY requirements.remote.txt /app
4+
RUN pip install --no-cache-dir -r requirements.remote.txt
55
COPY . /app
66
EXPOSE 8000
77
ENV NAME "Fact-check API"

requirements.local.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
aiohttp
2+
fastapi
3+
llama-index
4+
llama-index-embeddings-huggingface
5+
llama-index-embeddings-ollama
6+
llama-index-postprocessor-jinaai-rerank
7+
pyautogen
8+
uvicorn
File renamed without changes.

src/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def get_automerging_query_engine(
6969

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

0 commit comments

Comments
 (0)