Skip to content

Automate browser based workflows with AI

cache tiktoken (#4521)

LawyZheng8be0669b04d0
diff --git a/Dockerfile b/Dockerfile
index 9734890c9..fff4da1d6 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 000000000..181fc1296
--- /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)