Spaces:
Build error
Build error
Download utils/processing_helpers.py from cryogenic22/RFP_Analyzer_Agent: direct link, hf CLI and curl.
- Browser
- Download file 700 Bytes
-
https://huggingface.co/spaces/cryogenic22/RFP_Analyzer_Agent/resolve/main/utils/processing_helpers.py
- Command line
-
hf download hf://spaces/cryogenic22/RFP_Analyzer_Agent/utils/processing_helpers.py
-
curl -L -o processing_helpers.py https://huggingface.co/spaces/cryogenic22/RFP_Analyzer_Agent/resolve/main/utils/processing_helpers.py
700 Bytes
| import multiprocessing | |
| import streamlit as st | |
| def get_optimal_workers(): | |
| """Get optimal number of workers based on CPU cores.""" | |
| return max(multiprocessing.cpu_count() - 1, 1) | |
| def display_performance_metrics(): | |
| """Display current system performance metrics.""" | |
| st.sidebar.markdown("### System Performance") | |
| available_cores = multiprocessing.cpu_count() | |
| used_cores = st.sidebar.slider( | |
| "CPU Cores to Use", | |
| min_value=1, | |
| max_value=available_cores, | |
| value=get_optimal_workers(), | |
| help="Adjust the number of CPU cores used for processing" | |
| ) | |
| return { | |
| 'used_cores': used_cores, | |
| 'total_cores': available_cores | |
| } |