Skip to content

Commit a8093ad

Browse files
committed
Merge branch 'dev'
2 parents 935c134 + e73bcf3 commit a8093ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4718
-5100
lines changed

.env.example

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ JUDGE_API_KEY=
1818

1919
# App
2020
APP_PORT=8080 # this is the forwarded port
21+
API_NUM_WORKERS=1 # Number of uvicorn workers for the FastAPI app
22+
# ENABLE_RAY_SERVE=true # Use Ray Serve for the API instead of Uvicorn
2123

2224
# # VLLM
2325
# VLLM_PORT=8000
@@ -70,7 +72,9 @@ RAY_NUM_GPUS=0.1
7072
RAY_POOL_SIZE=1 # Number of serializer actor instances
7173
RAY_MAX_TASKS_PER_WORKER=5 # Number of tasks per serializer instance
7274
RAY_DASHBOARD_PORT=8265
73-
RAY_RUNTIME_ENV_HOOK=ray._private.runtime_env.uv_runtime_env_hook.hook
75+
RAY_ENABLE_RECORD_ACTOR_TASK_LOGGING=1
76+
RAY_task_retry_delay_ms=3000
77+
RAY_ENABLE_UV_RUN_RUNTIME_ENV=0
7478

7579
# SAVE UPLOADED FILES
7680
SAVE_UPLOADED_FILES=true # usefull for chainlit source viewing
@@ -92,6 +96,7 @@ SAVE_UPLOADED_FILES=true # usefull for chainlit source viewing
9296
# UV_LINK_MODE=copy
9397
# UV_CACHE_DIR=/tmp/uv-cache
9498
# RAY_ADDRESS=ray://X.X.X.X:10001
99+
# HEAD_NODE_IP=X.X.X.X
95100

96101
# # Chainlit UI authentication
97102
# CHAINLIT_AUTH_SECRET=... # has to be generated with with this command: 'uv run chainlit create-secret' but a random value works too.

.github/workflows/build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
workflow_dispatch:
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
PYTHON_VERSION: "3.12"
12+
13+
jobs:
14+
build-and-push-image:
15+
runs-on: ubuntu-latest
16+
if: startsWith(github.ref, 'refs/tags/') && github.event.base_ref == 'refs/heads/main'
17+
permissions:
18+
contents: read
19+
packages: write
20+
attestations: write
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
tags: |
43+
type=ref,event=tag
44+
type=raw,value=latest,enable={{is_default_branch}}
45+
46+
- name: Extract tag version
47+
id: get_version
48+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
49+
50+
- name: Build and push Docker image
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: .
54+
platforms: linux/amd64
55+
push: true
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
cache-from: type=gha
59+
cache-to: type=gha,mode=max
60+
61+
release:
62+
runs-on: ubuntu-latest
63+
if: startsWith(github.ref, 'refs/tags/') && github.event.base_ref == 'refs/heads/main'
64+
needs: [build-and-push-image]
65+
permissions:
66+
contents: write
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Create GitHub Release
71+
uses: ncipollo/release-action@v1
72+
with:
73+
generateReleaseNotes: true
74+
draft: false
75+
prerelease: false

.hydra_config/chunker/base.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
contextual_retrieval: ${oc.decode:${oc.env:CONTEXTUAL_RETRIEVAL, true}}
1+
contextual_retrieval: ${oc.decode:${oc.env:CONTEXTUAL_RETRIEVAL, true}}
2+
chunk_size: 512
3+
chunk_overlap_rate: 0.2

.hydra_config/chunker/markdown_splitter.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
defaults:
22
- base
33
name: markdown_splitter
4-
chunk_size: 512
5-
chunk_overlap: 100
64

75

86
# https://chat.deepseek.com/a/chat/s/28913c5d-1f62-40b0-9247-4655994fe16b

.hydra_config/chunker/recursive_splitter.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
defaults:
22
- base
33
name: recursive_splitter
4-
chunk_size: 512
5-
chunk_overlap: 100
64

75

86
# https://chat.deepseek.com/a/chat/s/28913c5d-1f62-40b0-9247-4655994fe16b
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
defaults:
22
- base
33
name: semantic_splitter
4-
min_chunk_size: 1000
54
breakpoint_threshold_amount: 95

.hydra_config/config.yaml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ vectordb:
3636
host: ${oc.env:VDB_HOST, milvus}
3737
port: ${oc.env:VDB_iPORT, 19530}
3838
connector_name: ${oc.env:VDB_CONNECTOR_NAME, milvus}
39-
collection_name: vdb_test
40-
hybrid_mode: true
39+
collection_name: ${oc.env:VDB_COLLECTION_NAME, vdb_test}
40+
hybrid_search: true
4141
enable: true
4242

43+
rdb:
44+
host: ${oc.env:POSTGRES_HOST, rdb}
45+
port: ${oc.env:POSTGRES_PORT, 5432}
46+
user: ${oc.env:POSTGRES_USER, root}
47+
password: ${oc.env:POSTGRES_PASSWORD, root_password}
48+
4349
reranker:
4450
enable: ${oc.decode:${oc.env:RERANKER_ENABLED, true}}
4551
model_name: ${oc.env:RERANKER_MODEL, Alibaba-NLP/gte-multilingual-reranker-base}
@@ -69,9 +75,21 @@ loader:
6975
image_captioning: true
7076
save_markdown: false
7177
audio_model: ${oc.env:WHISPER_MODEL, base} # tiny, base, small, medium, large-v1, large-v2, large-v3
78+
mimetypes:
79+
text/plain: .txt
80+
text/markdown: .md
81+
application/pdf: .pdf
82+
message/rfc822: .eml
83+
application/vnd.openxmlformats-officedocument.wordprocessingml.document: .docx
84+
application/vnd.openxmlformats-officedocument.presentationml.presentation: .pptx
85+
application/msword: .doc
86+
image/png: .png
87+
image/jpeg: .jpeg
88+
audio/vnd.wav: .wav
89+
audio/mpeg: .mp3
7290
file_loaders:
7391
txt: TextLoader
74-
pdf: ${oc.env:PDFLoader, DoclingLoader} # DoclingLoader # MarkerLoader # PyMuPDFLoader # Custompymupdf4llm
92+
pdf: ${oc.env:PDFLoader, MarkerLoader} # DoclingLoader # MarkerLoader # PyMuPDFLoader # Custompymupdf4llm
7593
eml: EmlLoader
7694
docx: MarkItDownLoader
7795
pptx: PPTXLoader
@@ -93,8 +111,26 @@ loader:
93111
marker_max_processes: ${oc.decode:${oc.env:MARKER_MAX_PROCESSES, 2}}
94112
marker_min_processes: ${oc.decode:${oc.env:MARKER_MIN_PROCESSES, 1}}
95113
marker_num_gpus: ${oc.decode:${oc.env:MARKER_NUM_GPUS, 0.01}}
114+
marker_timeout: ${oc.decode:${oc.env:MARKER_TIMEOUT, 3600}}
96115

97116
ray:
98117
num_gpus: ${oc.decode:${oc.env:RAY_NUM_GPUS, 0.01}}
99118
pool_size: ${oc.decode:${oc.env:RAY_POOL_SIZE, 1}}
100119
max_tasks_per_worker: ${oc.decode:${oc.env:RAY_MAX_TASKS_PER_WORKER, 5}}
120+
indexer:
121+
max_task_retries: ${oc.decode:${oc.env:RAY_MAX_TASK_RETRIES, 2}}
122+
serialize_timeout: ${oc.decode:${oc.env:INDEXER_SERIALIZE_TIMEOUT, 36000}}
123+
concurrency_groups:
124+
default: ${oc.decode:${oc.env:INDEXER_DEFAULT_CONCURRENCY, 1000}}
125+
update: ${oc.decode:${oc.env:INDEXER_UPDATE_CONCURRENCY, 100}}
126+
search: ${oc.decode:${oc.env:INDEXER_SEARCH_CONCURRENCY, 100}}
127+
delete: ${oc.decode:${oc.env:INDEXER_DELETE_CONCURRENCY, 100}}
128+
chunk: ${oc.decode:${oc.env:INDEXER_CHUNK_CONCURRENCY, 1000}}
129+
insert: ${oc.decode:${oc.env:INDEXER_INSERT_CONCURRENCY, 1}}
130+
semaphore:
131+
concurrency: ${oc.decode:${oc.env:RAY_SEMAPHORE_CONCURRENCY, 100000}}
132+
serve:
133+
enable: ${oc.decode:${oc.env:ENABLE_RAY_SERVE, false}}
134+
num_replicas: ${oc.decode:${oc.env:RAY_SERVE_NUM_REPLICAS, 1}}
135+
host: ${oc.env:RAY_SERVE_HOST, 0.0.0.0}
136+
port: ${oc.env:RAY_SERVE_PORT, 8080}

.hydra_config/rag/ChatBotRag.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Config for chatbot RAG
22
mode: ChatBotRag
3-
chat_history_depth: 4
3+
chat_history_depth: 4
4+
max_contextualized_query_len: 512
5+

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN apt-get update && apt-get install -y \
1010
gcc \
1111
cmake \
1212
make \
13+
libpq-dev python3-dev \
1314
&& rm -rf /var/lib/apt/lists/*
1415

1516
# install ffmpeg
@@ -44,4 +45,4 @@ COPY prompts/ /app/prompts/
4445
COPY .hydra_config/ /app/.hydra_config/
4546
ENV PYTHONPATH=/app/openrag/
4647
ENV APP_iPORT=${APP_iPORT:-8080}
47-
ENTRYPOINT ../entrypoint.sh
48+
ENTRYPOINT ../entrypoint.sh

Dockerfile.ray

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y \
1212
make \
1313
ssh \
1414
rsync \
15+
libpq-dev python3-dev \
1516
&& rm -rf /var/lib/apt/lists/*
1617

1718
# install ffmpeg
@@ -38,8 +39,6 @@ RUN pip3 install uv && \
3839
COPY entrypoint.sh /app/entrypoint.sh
3940
RUN chmod +x /app/entrypoint.sh
4041

41-
COPY ray-cluster/ /app/ray-cluster/
42-
4342
# Set workdir for source code
4443
WORKDIR /app/openrag
4544

0 commit comments

Comments
 (0)