Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
2502bd8a
Unverified
Commit
2502bd8a
authored
May 21, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 21, 2024
Browse files
Merge pull request #2472 from cheahjs/fix/hf-space
fix: chown /app/backend/data after preloading models
parents
19bb6e36
54c29f8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
Dockerfile
Dockerfile
+2
-1
backend/start.sh
backend/start.sh
+0
-2
No files found.
Dockerfile
View file @
2502bd8a
...
@@ -132,7 +132,8 @@ RUN pip3 install uv && \
...
@@ -132,7 +132,8 @@ RUN pip3 install uv && \
uv pip install --system -r requirements.txt --no-cache-dir && \
uv pip install --system -r requirements.txt --no-cache-dir && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
fi
fi; \
chown -R $UID:$GID /app/backend/data/
...
...
backend/start.sh
View file @
2502bd8a
...
@@ -31,7 +31,6 @@ if [ "$USE_CUDA_DOCKER" = "true" ]; then
...
@@ -31,7 +31,6 @@ if [ "$USE_CUDA_DOCKER" = "true" ]; then
fi
fi
# HFSPACE:START
# Check if SPACE_ID is set, if so, configure for space
# Check if SPACE_ID is set, if so, configure for space
if
[
-n
"
$SPACE_ID
"
]
;
then
if
[
-n
"
$SPACE_ID
"
]
;
then
echo
"Configuring for HuggingFace Space deployment"
echo
"Configuring for HuggingFace Space deployment"
...
@@ -56,6 +55,5 @@ if [ -n "$SPACE_ID" ]; then
...
@@ -56,6 +55,5 @@ if [ -n "$SPACE_ID" ]; then
kill
$webui_pid
kill
$webui_pid
export
WEBUI_URL
=
${
SPACE_HOST
}
export
WEBUI_URL
=
${
SPACE_HOST
}
fi
fi
# HFSPACE:END
WEBUI_SECRET_KEY
=
"
$WEBUI_SECRET_KEY
"
exec
uvicorn main:app
--host
"
$HOST
"
--port
"
$PORT
"
--forwarded-allow-ips
'*'
WEBUI_SECRET_KEY
=
"
$WEBUI_SECRET_KEY
"
exec
uvicorn main:app
--host
"
$HOST
"
--port
"
$PORT
"
--forwarded-allow-ips
'*'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment