feat: Add local model worker parameters (#2974)

This commit is contained in:
shaohuzhang1 2025-04-24 16:22:01 +08:00 committed by GitHub
parent 33b1cd65b0
commit e79e7d505d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -24,12 +24,13 @@ class GunicornLocalModelService(BaseService):
os.environ.setdefault('SERVER_NAME', 'local_model')
log_format = '%(h)s %(t)s %(L)ss "%(r)s" %(s)s %(b)s '
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
worker = CONFIG.get("LOCAL_MODEL_HOST_WORKER", 1)
cmd = [
'gunicorn', 'smartdoc.wsgi:application',
'-b', bind,
'-k', 'gthread',
'--threads', '200',
'-w', "1",
'-w', worker,
'--max-requests', '10240',
'--max-requests-jitter', '2048',
'--access-logformat', log_format,

View File

@ -93,7 +93,8 @@ class Config(dict):
'SANDBOX': False,
'LOCAL_MODEL_HOST': '127.0.0.1',
'LOCAL_MODEL_PORT': '11636',
'LOCAL_MODEL_PROTOCOL': "http"
'LOCAL_MODEL_PROTOCOL': "http",
'LOCAL_MODEL_HOST_WORKER': 1
}