Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
  • Loading branch information
jeanyu-habana committed Mar 1, 2025
1 parent 6653204 commit 2991022
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions comps/text2cypher/src/integrations/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class OpeaText2Cypher(OpeaComponent):
"""

def __init__(self, name: str, description: str, config: dict = None):
logger.info("OpeaText2Cypher initialization started.")
logger.info("[ OpeaText2Cypher ] initialization started.")
super().__init__(name, ServiceType.TEXT2CYPHER.name.lower(), description, config)

# initialize model and tokenizer
Expand All @@ -80,7 +80,7 @@ def __init__(self, name: str, description: str, config: dict = None):
# elif device == "cpu":
else:
raise NotImplementedError(f"Only support hpu device now, device {device} not supported.")
logger.info("OpeaText2Cypher initialization completed.")
logger.info("[ OpeaText2Cypher ] initialization completed.")

async def invoke(self, input: Input):
"""Invokes the text2cypher service.
Expand All @@ -104,7 +104,7 @@ async def invoke(self, input: Input):

graph_store.query(cypher_cleanup)
graph_store.query(cypher_insert)
logger.info(f"Graph has been built with the following graph schema: {graph_store.schema}")
logger.info(f"[ NativeInvoke ] Graph has been built with the following graph schema: {graph_store.schema}")

cypher_prompt = PromptTemplate(input_variables=["schema"], template=prepare_chat_template(prompt))

Expand Down Expand Up @@ -139,8 +139,8 @@ async def invoke(self, input: Input):
end_time = time.time()
latency = end_time - start_time

logger.info(f"Latency: {latency:.2f} seconds.")
logger.info(f"result: {result}")
logger.info(f"[ NativeInvoke ] Latency: {latency:.2f} seconds.")
logger.info(f"[ NativeInvoke ] result: {result}")
return result

def check_health(self) -> bool:
Expand Down

0 comments on commit 2991022

Please sign in to comment.