feat: cache huggingface gpt2 tokenizer files (#1138)

This commit is contained in:
takatost 2023-09-10 12:16:21 +08:00 committed by GitHub
parent 6637629045
commit 877da82b06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ EXPOSE 5001
WORKDIR /app/api WORKDIR /app/api
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends bash curl wget vim nodejs \ && apt-get install -y --no-install-recommends bash curl wget vim nodejs \
&& apt-get autoremove \ && apt-get autoremove \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -34,6 +34,8 @@ RUN apt-get update \
COPY --from=base /pkg /usr/local COPY --from=base /pkg /usr/local
COPY . /app/api/ COPY . /app/api/
RUN python -c "from transformers import GPT2TokenizerFast; GPT2TokenizerFast.from_pretrained('gpt2')"
COPY docker/entrypoint.sh /entrypoint.sh COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh