Update GraphRAG to be compatible with latest component changes (#1427)

- Updated ENV VARS to align with recent changes in neo4j dataprep and retriever.
- upgraded tgi-gaudi image version
Related to GenAIComps repo issue #1025 (opea-project/GenAIComps#1025)

Original PR #1384
Original contributor is @rbrugaro

Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Co-authored-by: Liang Lv <liang1.lv@intel.com>
This commit is contained in:
XinyaoWa
2025-01-21 00:18:01 +08:00
committed by GitHub
parent 0ba3decb6b
commit d0cd0aaf53
5 changed files with 15 additions and 5 deletions

View File

@@ -52,6 +52,7 @@ RETRIEVER_SERVICE_HOST_IP = os.getenv("RETRIEVER_SERVICE_HOST_IP", "0.0.0.0")
RETRIEVER_SERVICE_PORT = int(os.getenv("RETRIEVER_SERVICE_PORT", 7000))
LLM_SERVER_HOST_IP = os.getenv("LLM_SERVER_HOST_IP", "0.0.0.0")
LLM_SERVER_PORT = int(os.getenv("LLM_SERVER_PORT", 80))
LLM_MODEL_ID = os.getenv("LLM_MODEL_ID", "meta-llama/Meta-Llama-3.1-8B-Instruct")
def align_inputs(self, inputs, cur_node, runtime_graph, llm_parameters_dict, **kwargs):
@@ -60,7 +61,7 @@ def align_inputs(self, inputs, cur_node, runtime_graph, llm_parameters_dict, **k
elif self.services[cur_node].service_type == ServiceType.LLM:
# convert TGI/vLLM to unified OpenAI /v1/chat/completions format
next_inputs = {}
next_inputs["model"] = "tgi" # specifically clarify the fake model to make the format unified
next_inputs["model"] = LLM_MODEL_ID
next_inputs["messages"] = [{"role": "user", "content": inputs["inputs"]}]
next_inputs["max_tokens"] = llm_parameters_dict["max_tokens"]
next_inputs["top_p"] = llm_parameters_dict["top_p"]