Fix linting
This commit is contained in:
@@ -12,6 +12,7 @@ from dotenv import load_dotenv
|
|||||||
# the OS environment variables take precedence over the .env file
|
# the OS environment variables take precedence over the .env file
|
||||||
load_dotenv(dotenv_path=".env", override=False)
|
load_dotenv(dotenv_path=".env", override=False)
|
||||||
|
|
||||||
|
|
||||||
class OllamaServerInfos:
|
class OllamaServerInfos:
|
||||||
# Constants for emulated Ollama model information
|
# Constants for emulated Ollama model information
|
||||||
LIGHTRAG_NAME = "lightrag"
|
LIGHTRAG_NAME = "lightrag"
|
||||||
|
@@ -321,9 +321,7 @@ def create_app(args):
|
|||||||
# namespace_prefix=args.namespace_prefix,
|
# namespace_prefix=args.namespace_prefix,
|
||||||
auto_manage_storages_states=False,
|
auto_manage_storages_states=False,
|
||||||
max_parallel_insert=args.max_parallel_insert,
|
max_parallel_insert=args.max_parallel_insert,
|
||||||
addon_params={
|
addon_params={"language": args.summary_language},
|
||||||
"language": args.summary_language
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
else: # azure_openai
|
else: # azure_openai
|
||||||
rag = LightRAG(
|
rag = LightRAG(
|
||||||
@@ -354,9 +352,7 @@ def create_app(args):
|
|||||||
# namespace_prefix=args.namespace_prefix,
|
# namespace_prefix=args.namespace_prefix,
|
||||||
auto_manage_storages_states=False,
|
auto_manage_storages_states=False,
|
||||||
max_parallel_insert=args.max_parallel_insert,
|
max_parallel_insert=args.max_parallel_insert,
|
||||||
addon_params={
|
addon_params={"language": args.summary_language},
|
||||||
"language": args.summary_language
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add routes
|
# Add routes
|
||||||
|
@@ -120,12 +120,22 @@ def main():
|
|||||||
|
|
||||||
# Set configuration variables in gunicorn_config, prioritizing command line arguments
|
# Set configuration variables in gunicorn_config, prioritizing command line arguments
|
||||||
gunicorn_config.workers = (
|
gunicorn_config.workers = (
|
||||||
global_args.workers if global_args.workers else int(os.getenv("WORKERS", 1))
|
global_args.workers
|
||||||
|
if global_args.workers
|
||||||
|
else int(os.getenv("WORKERS", 1))
|
||||||
)
|
)
|
||||||
|
|
||||||
# Bind configuration prioritizes command line arguments
|
# Bind configuration prioritizes command line arguments
|
||||||
host = global_args.host if global_args.host != "0.0.0.0" else os.getenv("HOST", "0.0.0.0")
|
host = (
|
||||||
port = global_args.port if global_args.port != 9621 else int(os.getenv("PORT", 9621))
|
global_args.host
|
||||||
|
if global_args.host != "0.0.0.0"
|
||||||
|
else os.getenv("HOST", "0.0.0.0")
|
||||||
|
)
|
||||||
|
port = (
|
||||||
|
global_args.port
|
||||||
|
if global_args.port != 9621
|
||||||
|
else int(os.getenv("PORT", 9621))
|
||||||
|
)
|
||||||
gunicorn_config.bind = f"{host}:{port}"
|
gunicorn_config.bind = f"{host}:{port}"
|
||||||
|
|
||||||
# Log level configuration prioritizes command line arguments
|
# Log level configuration prioritizes command line arguments
|
||||||
@@ -137,7 +147,9 @@ def main():
|
|||||||
|
|
||||||
# Timeout configuration prioritizes command line arguments
|
# Timeout configuration prioritizes command line arguments
|
||||||
gunicorn_config.timeout = (
|
gunicorn_config.timeout = (
|
||||||
global_args.timeout if global_args.timeout * 2 else int(os.getenv("TIMEOUT", 150 * 2))
|
global_args.timeout
|
||||||
|
if global_args.timeout * 2
|
||||||
|
else int(os.getenv("TIMEOUT", 150 * 2))
|
||||||
)
|
)
|
||||||
|
|
||||||
# Keepalive configuration
|
# Keepalive configuration
|
||||||
@@ -157,7 +169,9 @@ def main():
|
|||||||
else os.getenv("SSL_CERTFILE")
|
else os.getenv("SSL_CERTFILE")
|
||||||
)
|
)
|
||||||
gunicorn_config.keyfile = (
|
gunicorn_config.keyfile = (
|
||||||
global_args.ssl_keyfile if global_args.ssl_keyfile else os.getenv("SSL_KEYFILE")
|
global_args.ssl_keyfile
|
||||||
|
if global_args.ssl_keyfile
|
||||||
|
else os.getenv("SSL_KEYFILE")
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set configuration options from the module
|
# Set configuration options from the module
|
||||||
|
Reference in New Issue
Block a user