Skip to content

Commit

Permalink
Merge branch 'main' into mmqna-image-query
Browse files Browse the repository at this point in the history
  • Loading branch information
mhbuehler authored Jan 14, 2025
2 parents 17a25cc + 7d218b9 commit 152a6b6
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/workflows/_example-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
fi
if [[ $(grep -c "vllm-gaudi:" ${docker_compose_path}) != 0 ]]; then
git clone https://github.com/HabanaAI/vllm-fork.git
cd vllm-fork && git checkout 3c39626 && cd ../
fi
git clone https://github.com/opea-project/GenAIComps.git
cd GenAIComps && git checkout ${{ inputs.opea_branch }} && git rev-parse HEAD && cd ../
Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/tests/test_compose_vllm_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ip_address=$(hostname -I | awk '{print $1}')
function build_docker_images() {
cd $WORKPATH/docker_image_build
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork && git checkout 3c39626 && cd ../
git clone https://github.com/HabanaAI/vllm-fork.git

echo "Build all the images with --no-cache, check docker_image_build.log for details..."
service_list="chatqna chatqna-ui dataprep-redis retriever-redis vllm-gaudi nginx"
Expand Down
4 changes: 2 additions & 2 deletions EdgeCraftRAG/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ quality and performance.
## What's New in this release?

- Support image/url data retrieval and display in EC-RAG
- Support display of LLM-used context sources in UI
- Support display of document source used by LLM in UI
- Support pipeline remove operation in RESTful API and UI
- Support RAG pipeline performance benchmark and display in UI
- Fixed known issues in EC-RAG UI and server
Expand Down Expand Up @@ -77,7 +77,7 @@ export RENDERGROUPID=$(getent group render | cut -d: -f3)
pip install --upgrade --upgrade-strategy eager "optimum[openvino]"

optimum-cli export openvino -m BAAI/bge-small-en-v1.5 ${MODEL_PATH}/BAAI/bge-small-en-v1.5 --task sentence-similarity
optimum-cli export openvino -m BAAI/bge-reranker-large ${MODEL_PATH}/BAAI/bge-reranker-large --task sentence-similarity
optimum-cli export openvino -m BAAI/bge-reranker-large ${MODEL_PATH}/BAAI/bge-reranker-large --task text-classification
optimum-cli export openvino -m Qwen/Qwen2-7B-Instruct ${MODEL_PATH}/Qwen/Qwen2-7B-Instruct/INT4_compressed_weights --weight-format int4

```
Expand Down
8 changes: 4 additions & 4 deletions EdgeCraftRAG/docker_compose/intel/gpu/arc/compose_vllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ services:
ports:
- ${VLLM_SERVICE_PORT:-8008}:80
environment:
HTTPS_PROXY: ${https_proxy}
HTTP_PROXY: ${https_proxy}
no_proxy: ${no_proxy}
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
VLLM_OPENVINO_DEVICE: GPU
HF_ENDPOINT: ${HF_ENDPOINT}
HF_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
volumes:
- /dev/dri/by-path:/dev/dri/by-path
- $HOME/.cache/huggingface:/root/.cache/huggingface
- ${HF_CACHE:-${HOME}/.cache}:/root/.cache
devices:
- /dev/dri
group_add:
Expand Down
4 changes: 2 additions & 2 deletions EdgeCraftRAG/edgecraftrag/api/v1/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ async def get_files():


# GET a file
@data_app.get(path="/v1/data/files")
@data_app.get(path="/v1/data/files/{name}")
async def get_file_docs(name):
return ctx.get_file_mgr().get_docs_by_file(name)
return ctx.get_file_mgr().get_file_by_name_or_id(name)


# DELETE a file
Expand Down
11 changes: 9 additions & 2 deletions EdgeCraftRAG/edgecraftrag/api/v1/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ async def add_pipeline(request: PipelineCreateIn):
pass
else:
return "Unable to patch an active pipeline..."
update_pipeline_handler(pl, request)
try:
update_pipeline_handler(pl, request)
except ValueError as e:
ctx.get_pipeline_mgr().remove_pipeline_by_name_or_id(request.name)
return str(e)
return pl


Expand All @@ -71,7 +75,10 @@ async def update_pipeline(name, request: PipelineCreateIn):
else:
return "Unable to patch an active pipeline..."
async with ctx.get_pipeline_mgr()._lock:
update_pipeline_handler(pl, request)
try:
update_pipeline_handler(pl, request)
except ValueError as e:
return str(e)
return pl


Expand Down
2 changes: 1 addition & 1 deletion EdgeCraftRAG/edgecraftrag/api_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NodeParserIn(BaseModel):
chunk_overlap: Optional[int] = None
chunk_sizes: Optional[list] = None
parser_type: str
window_size: Optional[int] = None
window_size: Optional[int] = 3


class IndexerIn(BaseModel):
Expand Down
3 changes: 0 additions & 3 deletions EdgeCraftRAG/edgecraftrag/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class FileType(str, Enum):

class NodeParserType(str, Enum):

DEFAULT = "default"
SIMPLE = "simple"
HIERARCHY = "hierarchical"
SENTENCEWINDOW = "sentencewindow"
Expand All @@ -49,14 +48,12 @@ class NodeParserType(str, Enum):

class IndexerType(str, Enum):

DEFAULT = "default"
FAISS_VECTOR = "faiss_vector"
DEFAULT_VECTOR = "vector"


class RetrieverType(str, Enum):

DEFAULT = "default"
VECTORSIMILARITY = "vectorsimilarity"
AUTOMERGE = "auto_merge"
BM25 = "bm25"
Expand Down
3 changes: 2 additions & 1 deletion EdgeCraftRAG/edgecraftrag/components/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def run(self, **kwargs) -> Any:
for k, v in kwargs.items():
if k == "query":
nodes = cast(List[BaseNode], list(self._docstore.docs.values()))
bm25_retr = BM25Retriever.from_defaults(nodes=nodes, similarity_top_k=self.topk)
similarity_top_k = min(len(nodes), self.topk)
bm25_retr = BM25Retriever.from_defaults(nodes=nodes, similarity_top_k=similarity_top_k)
return bm25_retr.retrieve(v)

return None
3 changes: 2 additions & 1 deletion EdgeCraftRAG/edgecraftrag/controllers/nodemgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def del_nodes(self, nodes):
pass

def del_nodes_by_np_idx(self, np_idx):
del self.nodes[np_idx]
if np_idx in self.nodes:
del self.nodes[np_idx]

def get_nodes(self, np_idx) -> List[BaseNode]:
if np_idx in self.nodes:
Expand Down

0 comments on commit 152a6b6

Please sign in to comment.