changed to multi threads
Browse files- controller.py +1 -4
controller.py
CHANGED
@@ -582,11 +582,8 @@ current_langchain_chart_lock = threading.Lock()
|
|
582 |
max_cpus = os.cpu_count()
|
583 |
print("Available CPUs:", max_cpus)
|
584 |
|
585 |
-
max_workers = min(14, (os.cpu_count() or 1) - 2)
|
586 |
-
print(f"Implementing max workers: {max_workers}")
|
587 |
-
|
588 |
# Use a process pool to run CPU-bound chart generation
|
589 |
-
process_executor = ProcessPoolExecutor(max_workers=
|
590 |
|
591 |
# --- GROQ-BASED CHART GENERATION ---
|
592 |
# def groq_chart(csv_url: str, question: str):
|
|
|
582 |
max_cpus = os.cpu_count()
|
583 |
print("Available CPUs:", max_cpus)
|
584 |
|
|
|
|
|
|
|
585 |
# Use a process pool to run CPU-bound chart generation
|
586 |
+
process_executor = ProcessPoolExecutor(max_workers=10)
|
587 |
|
588 |
# --- GROQ-BASED CHART GENERATION ---
|
589 |
# def groq_chart(csv_url: str, question: str):
|