From deee837bb07d15c8ca085a3abd6988c50d923148 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 31 Jan 2024 15:31:20 -0800 Subject: [PATCH] (fix) try/except new ui feature --- litellm/proxy/proxy_server.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 430be55c6..40d5fd843 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -161,9 +161,12 @@ router = APIRouter() origins = ["*"] # get current directory -current_dir = os.getcwd() -ui_path = os.path.join(current_dir, "_experimental", "out") -app.mount("/ui", StaticFiles(directory=ui_path, html=True), name="ui") +try: + current_dir = os.getcwd() + ui_path = os.path.join(current_dir, "_experimental", "out") + app.mount("/ui", StaticFiles(directory=ui_path, html=True), name="ui") +except: + pass app.add_middleware( CORSMiddleware, allow_origins=origins,