feat(model): Support database model registry (#1656)

This commit is contained in:
Fangyin Cheng
2024-06-24 19:07:10 +08:00
committed by GitHub
parent c57ee0289b
commit 47d205f676
35 changed files with 2014 additions and 792 deletions

View File

@@ -34,15 +34,16 @@ RUN pip3 install --upgrade pip -i $PIP_INDEX_URL \
# install openai for proxyllm
&& pip3 install -i $PIP_INDEX_URL ".[openai]"
RUN (if [ "${LANGUAGE}" = "zh" ]; \
# language is zh, download zh_core_web_sm from github
then wget https://github.com/explosion/spacy-models/releases/download/zh_core_web_sm-3.7.0/zh_core_web_sm-3.7.0-py3-none-any.whl -O /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl \
&& pip3 install /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl -i $PIP_INDEX_URL \
&& rm /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl; \
# not zh, download directly
else python3 -m spacy download zh_core_web_sm; \
fi;) \
&& rm -rf `pip3 cache dir`
# Not install spacy model for now
#RUN (if [ "${LANGUAGE}" = "zh" ]; \
# # language is zh, download zh_core_web_sm from github
# then wget https://github.com/explosion/spacy-models/releases/download/zh_core_web_sm-3.7.0/zh_core_web_sm-3.7.0-py3-none-any.whl -O /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl \
# && pip3 install /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl -i $PIP_INDEX_URL \
# && rm /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl; \
# # not zh, download directly
# else python3 -m spacy download zh_core_web_sm; \
# fi;) \
# && rm -rf `pip3 cache dir`
ARG BUILD_LOCAL_CODE="false"
# COPY the rest of the app

View File

@@ -0,0 +1,17 @@
#!/bin/bash
SCRIPT_LOCATION=$0
cd "$(dirname "$SCRIPT_LOCATION")"
WORK_DIR=$(pwd)
if [[ " $* " == *" --help "* ]] || [[ " $* " == *" -h "* ]]; then
bash $WORK_DIR/build_image.sh "$@"
exit 0
fi
bash $WORK_DIR/build_image.sh --install-mode openai "$@"
if [ 0 -ne $? ]; then
echo "Error: build base image failed"
exit 1
fi