From 877da82b069dc7644d55cb02424788f73ea684a2 Mon Sep 17 00:00:00 2001 From: takatost Date: Sun, 10 Sep 2023 12:16:21 +0800 Subject: [PATCH] feat: cache huggingface gpt2 tokenizer files (#1138) --- api/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 4bd1e68db7..824506c46b 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -26,7 +26,7 @@ EXPOSE 5001 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 autoremove \ && rm -rf /var/lib/apt/lists/* @@ -34,6 +34,8 @@ RUN apt-get update \ COPY --from=base /pkg /usr/local COPY . /app/api/ +RUN python -c "from transformers import GPT2TokenizerFast; GPT2TokenizerFast.from_pretrained('gpt2')" + COPY docker/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh