Kryst4lDem0ni4s opened a new pull request, #188:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/188

   Cause of the Problem:
   Blocking and Queuing Behavior: Gradio, by default, has a concurrency limit 
of 1. This causes blocking when multiple users or windows are accessing the 
application simultaneously.
   No Asynchronous Execution: The current implementation does not specify 
concurrency_limit, leading to sequential execution.
   Queue Configuration: If queue() is not configured properly, tasks are 
processed one at a time.
   
   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
   
   Closed previous PRs due to merge conflicts. please check this @imbajin 


-- 
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