Skip to content

Commit

Permalink
verbose condition for openai startup
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudotensor committed Jun 13, 2024
1 parent b237877 commit 6de8635
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions openai_server/server_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def run(wait=True, **kwargs):
if kwargs['workers'] > 1 or kwargs['workers'] == 0:
if not kwargs['multiple_workers_gunicorn']:
# popen now, so launch uvicorn with string app
print(f"Multi-worker {name} Proxy uvicorn: {kwargs['workers']}")
if kwargs.get('verbose', False):
print(f"Multi-worker {name} Proxy uvicorn: {kwargs['workers']}")
# avoid CUDA forking
command = ['python', 'openai_server/server_start.py']
# Convert the kwargs to command line arguments
Expand All @@ -141,12 +142,14 @@ def run(wait=True, **kwargs):
elif wait:
kwargs['multiple_workers_gunicorn'] = False # force uvicorn since not using multiple workers
# launch uvicorn in this thread/process
print(f"Single-worker {name} Proxy uvicorn in this thread: {kwargs['workers']}")
if kwargs.get('verbose', False):
print(f"Single-worker {name} Proxy uvicorn in this thread: {kwargs['workers']}")
run_server(**kwargs)
else:
kwargs['multiple_workers_gunicorn'] = False # force uvicorn since not using multiple workers
# launch uvicorn in this process in new thread
print(f"Single-worker {name} Proxy uvicorn in new thread: {kwargs['workers']}")
if kwargs.get('verbose', False):
print(f"Single-worker {name} Proxy uvicorn in new thread: {kwargs['workers']}")
Thread(target=run_server, kwargs=kwargs, daemon=True).start()


Expand Down
1 change: 1 addition & 0 deletions src/gradio_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6089,6 +6089,7 @@ def wrap_embedding_func_api(text, h2ogpt_key1, is_list1, requests_state1):
auth_access=kwargs['auth_access'],
guest_name=kwargs['guest_name'],
main_kwargs=json.dumps(kwargs['main_kwargs']),
verbose=verbose,
)

if kwargs['openai_server']:
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0a12b3728a683b73bb21fdc20e9c4846e4710c02"
__version__ = "b237877bda663c2ee5d762290fa450e9cd15550d"

0 comments on commit 6de8635

Please sign in to comment.