mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Main: Only import psutil when the experimental function is run
Experimental options shouldn't be imported at the top level until the testing period is over. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
4
main.py
4
main.py
@@ -9,8 +9,6 @@ import signal
|
|||||||
from loguru import logger
|
from loguru import logger
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import psutil
|
|
||||||
|
|
||||||
from common import config, gen_logging, sampling, model
|
from common import config, gen_logging, sampling, model
|
||||||
from common.args import convert_args_to_dict, init_argparser
|
from common.args import convert_args_to_dict, init_argparser
|
||||||
from common.auth import load_auth_keys
|
from common.auth import load_auth_keys
|
||||||
@@ -162,6 +160,8 @@ def entrypoint(arguments: Optional[dict] = None):
|
|||||||
|
|
||||||
# Set the process priority
|
# Set the process priority
|
||||||
if unwrap(developer_config.get("realtime_process_priority"), False):
|
if unwrap(developer_config.get("realtime_process_priority"), False):
|
||||||
|
import psutil
|
||||||
|
|
||||||
current_process = psutil.Process(os.getpid())
|
current_process = psutil.Process(os.getpid())
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
current_process.nice(psutil.REALTIME_PRIORITY_CLASS)
|
current_process.nice(psutil.REALTIME_PRIORITY_CLASS)
|
||||||
|
|||||||
Reference in New Issue
Block a user