Skip to content

Commit

Permalink
Adding git to Dockerfile, tested dockerfile and dockercompose. Also p…
Browse files Browse the repository at this point in the history
…arametrized variables in prepare_doc_arango.py
  • Loading branch information
ajaykallepalli committed Dec 16, 2024
1 parent 5ae912e commit 678fcf1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
5 changes: 3 additions & 2 deletions comps/dataprep/arango/langchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missin
build-essential \
default-jre \
libgl1-mesa-glx \
libjemalloc-dev
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
Expand All @@ -35,4 +36,4 @@ USER user

WORKDIR /home/user/comps/dataprep/arango/langchain

ENTRYPOINT ["python", "prepare_doc_arango.py"]
ENTRYPOINT ["python", "prepare_doc_arango.py"]
2 changes: 1 addition & 1 deletion comps/dataprep/arango/langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ curl -X POST \
http://localhost:6007/v1/dataprep
```

Additional options that can be specified from the config.py file are as follows:
Additional options that can be specified from the environment variables are as follows (default values are in the config.py file):

OpenAI Configuration:
- `OPENAI_EMBED_MODEL`: The embedding model to use for the OpenAI service.
Expand Down
18 changes: 10 additions & 8 deletions comps/dataprep/arango/langchain/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
ARANGO_DB_NAME = os.getenv("ARANGO_DB_NAME", "_system")

# ArangoDB graph configuration
USE_ONE_ENTITY_COLLECTION = True
INSERT_ASYNC = False
ARANGO_BATCH_SIZE = 1000
INCLUDE_SOURCE = True
USE_ONE_ENTITY_COLLECTION = os.getenv("USE_ONE_ENTITY_COLLECTION", True)
INSERT_ASYNC = os.getenv("INSERT_ASYNC", False)
ARANGO_BATCH_SIZE = os.getenv("ARANGO_BATCH_SIZE", 1000)
INCLUDE_SOURCE = os.getenv("INCLUDE_SOURCE", True)

# Text Generation Inference configuration
TGI_LLM_ENDPOINT = os.getenv("TGI_LLM_ENDPOINT", "http://localhost:8080")
Expand All @@ -27,11 +27,13 @@
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
OPENAI_EMBED_MODEL = os.getenv("OPENAI_EMBED_MODEL", "text-embedding-3-small")
OPENAI_EMBED_DIMENSIONS = os.getenv("OPENAI_EMBED_DIMENSIONS", 512)
OPENAI_CHAT_MODEL = os.getenv("OPENAI_CHAT_MODEL", "gpt-4o")
OPENAI_CHAT_TEMPERATURE = os.getenv("OPENAI_CHAT_TEMPERATURE", 0)

# LLMGraphTransformer configuration
ALLOWED_NODES = [] # ["Person", "Organization"]
ALLOWED_RELATIONSHIPS = [] # [("Person", "knows", "Person"), ("Person", "works_at", "Organization")]
NODE_PROPERTIES = False # ["description"]
RELATIONSHIP_PROPERTIES = False # ["description"]
ALLOWED_NODES = os.getenv("ALLOWED_NODES", []) # ["Person", "Organization"]
ALLOWED_RELATIONSHIPS = os.getenv("ALLOWED_RELATIONSHIPS", []) # [("Person", "knows", "Person"), ("Person", "works_at", "Organization")]
NODE_PROPERTIES = os.getenv("NODE_PROPERTIES", ['description'])
RELATIONSHIP_PROPERTIES = os.getenv("RELATIONSHIP_PROPERTIES", ['description'])

SYSTEM_PROMPT_PATH = os.getenv("SYSTEM_PROMPT_PATH", "./prompt.txt")
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
container_name: arango-graph-db
ports:
- "8529:8529"
environment:
ARANGO_ROOT_PASSWORD: ${ARANGO_PASSWORD}
tgi_gaudi_service:
image: ghcr.io/huggingface/tgi-gaudi:2.0.5
container_name: tgi-service
Expand All @@ -23,7 +25,7 @@ services:
HF_TOKEN: ${HF_TOKEN}
command: --model-id ${LLM_MODEL_ID} --auto-truncate --max-input-tokens 1024 --max-total-tokens 2048
dataprep-arango:
image: opea/gen-ai-comps:dataprep-arango-xeon-server
image: opea/dataprep-arango:latest
container_name: dataprep-arango-server
depends_on:
- arango-vector-db
Expand All @@ -35,7 +37,7 @@ services:
no_proxy: ${no_proxy}
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
ARANGO_URL: ${ARANGO_URL}
ARANGO_URL: http://arango-graph-db:8529
ARANGO_USERNAME: ${ARANGO_USERNAME}
ARANGO_PASSWORD: ${ARANGO_PASSWORD}
ARANGO_DB_NAME: ${ARANGO_DB_NAME}
Expand Down

0 comments on commit 678fcf1

Please sign in to comment.