Kryst4lDem0ni4s commented on PR #181:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/181#issuecomment-2690926064

   Changed:
   ```
   log_path = "logs/llm-server.log"
       try:
           with open(log_path, "r", encoding='utf-8') as f:
               return ''.join(deque(f, maxlen=lines))
       except FileNotFoundError:
           log.critical("Log file not found: %s", log_path)
           return "LLM Server log file not found."
   ```
   to
   ```
   log_path = "logs/llm-server.log"
       try:
           with open(log_path, "r", encoding='utf-8') as f:
               data = f.read()
               return ''.join(deque(data, maxlen=lines))
       except FileNotFoundError:
           print(f"Log file not found: {log_path}")
           return "LLM Server log file not found."
       except UnicodeDecodeError as e:
           print(f"Decoding error occurred: {e}")
           # ignore the bad bytes and continue processing
           with open(log_path, "r", encoding='utf-8', errors='ignore') as f:
               data = f.read()
               return ''.join(deque(data, maxlen=lines))
   ```
   in order to handle frequent unicode encoding errors during attempts to read 
logs.
   
   Also added task ID generation for RAG functions, and enabled concurrency 
using Gradio Blocks in rag_block.py in rag_demo by creating a task ID 
generation decorator and used Gradio Blocks for concurrency control. Added logs 
for clear understanding. Issue: #176 
https://github.com/apache/incubator-hugegraph-ai/issues/176


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to