From 8be0669b04d0c7b71f6e6425cdc052a886417cc5 Mon Sep 17 00:00:00 2001 From: LawyZheng Date: Fri, 23 Jan 2026 05:55:45 +0800 Subject: [PATCH] cache tiktoken (#4521) Co-authored-by: Shuchang Zheng --- Dockerfile | 3 +++ scripts/load_tiktoken.py | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 scripts/load_tiktoken.py diff --git a/Dockerfile b/Dockerfile index 9734890c..fff4da1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,9 @@ ENV HAR_PATH=/data/har ENV LOG_PATH=/data/log ENV ARTIFACT_STORAGE_PATH=/data/artifacts +# cache tiktoken +RUN python /app/scripts/load_tiktoken.py + COPY ./entrypoint-skyvern.sh /app/entrypoint-skyvern.sh RUN chmod +x /app/entrypoint-skyvern.sh diff --git a/scripts/load_tiktoken.py b/scripts/load_tiktoken.py new file mode 100644 index 00000000..181fc129 --- /dev/null +++ b/scripts/load_tiktoken.py @@ -0,0 +1,4 @@ +import tiktoken + +for model in tiktoken.model.MODEL_TO_ENCODING.keys(): + tiktoken.encoding_for_model(model)