Merge pull request #2473 from cheahjs/fix/space-litellm-config

fix: space startup script
This commit is contained in:
Timothy Jaeryang Baek 2024-05-21 18:28:39 -10:00 committed by GitHub
commit 45bd0f2a91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,8 +37,10 @@ if [ -n "$SPACE_ID" ]; then
# Copy litellm_config.yaml with specified ownership
echo "Copying litellm_config.yaml to the desired location with specified ownership..."
cp ./backend/space/litellm_config.yaml ./data/litellm/config.yaml
cp -f ./space/litellm_config.yaml ./data/litellm/config.yaml
if [ -n "$ADMIN_USER_EMAIL" ] && [ -n "$ADMIN_USER_PASSWORD" ]; then
echo "Admin user configured, creating"
WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" uvicorn main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*' &
webui_pid=$!
echo "Waiting for webui to start..."
@ -53,6 +55,8 @@ if [ -n "$SPACE_ID" ]; then
-d "{ \"email\": \"${ADMIN_USER_EMAIL}\", \"password\": \"${ADMIN_USER_PASSWORD}\", \"name\": \"Admin\" }"
echo "Shutting down webui..."
kill $webui_pid
fi
export WEBUI_URL=${SPACE_HOST}
fi