Skip to content

Commit e79e7d5

Browse files
authored
feat: Add local model worker parameters (#2974)
1 parent 33b1cd6 commit e79e7d5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/common/management/commands/services/services/local_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ def cmd(self):
2424
os.environ.setdefault('SERVER_NAME', 'local_model')
2525
log_format = '%(h)s %(t)s %(L)ss "%(r)s" %(s)s %(b)s '
2626
bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}'
27+
worker = CONFIG.get("LOCAL_MODEL_HOST_WORKER", 1)
2728
cmd = [
2829
'gunicorn', 'smartdoc.wsgi:application',
2930
'-b', bind,
3031
'-k', 'gthread',
3132
'--threads', '200',
32-
'-w', "1",
33+
'-w', worker,
3334
'--max-requests', '10240',
3435
'--max-requests-jitter', '2048',
3536
'--access-logformat', log_format,

apps/smartdoc/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class Config(dict):
9393
'SANDBOX': False,
9494
'LOCAL_MODEL_HOST': '127.0.0.1',
9595
'LOCAL_MODEL_PORT': '11636',
96-
'LOCAL_MODEL_PROTOCOL': "http"
96+
'LOCAL_MODEL_PROTOCOL': "http",
97+
'LOCAL_MODEL_HOST_WORKER': 1
9798

9899
}
99100

0 commit comments

Comments
 (0)