forked from phoenix/litellm-mirror
(fix) import gunicorn
This commit is contained in:
parent
1276112119
commit
67dc9adc71
2 changed files with 2 additions and 4 deletions
|
@ -367,15 +367,14 @@ def run_server(
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
import gunicorn.app.base
|
||||||
except:
|
except:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"Uvicorn needs to be imported. Run - `pip install uvicorn`"
|
"Uvicorn, gunicorn needs to be imported. Run - `pip 'litellm[proxy]'`"
|
||||||
)
|
)
|
||||||
if port == 8000 and is_port_in_use(port):
|
if port == 8000 and is_port_in_use(port):
|
||||||
port = random.randint(1024, 49152)
|
port = random.randint(1024, 49152)
|
||||||
|
|
||||||
import gunicorn.app.base
|
|
||||||
|
|
||||||
class StandaloneApplication(gunicorn.app.base.BaseApplication):
|
class StandaloneApplication(gunicorn.app.base.BaseApplication):
|
||||||
def __init__(self, app, options=None):
|
def __init__(self, app, options=None):
|
||||||
self.options = options or {}
|
self.options = options or {}
|
||||||
|
|
|
@ -14,7 +14,6 @@ sys.path.insert(
|
||||||
) # Adds the parent directory to the system path - for litellm local dev
|
) # Adds the parent directory to the system path - for litellm local dev
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import uvicorn
|
|
||||||
import fastapi
|
import fastapi
|
||||||
import backoff
|
import backoff
|
||||||
import yaml
|
import yaml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue