diff --git a/Dockerfile-base b/Dockerfile-base index e672c76b7470afbcd754bbd752f7ee9afec495fb..c8769cb277ba7a81f12d6b78a864bbcd1a3ffe1a 100644 --- a/Dockerfile-base +++ b/Dockerfile-base @@ -20,7 +20,9 @@ USER eulercopilot # 复制 requirements.txt 文件到 /rag-service 目录 COPY --chown=1001:1001 requirements.txt /rag-service/ COPY --chown=1001:1001 tika-server-standard-2.9.2.jar /rag-service/ +COPY --chown=1001:1001 install_titkon_packge.py /rag-service/ # 安装 Python 依赖 RUN pip3 install --no-cache-dir -r /rag-service/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple && \ chmod -R 750 /rag-service +RUN python3 /rag-service/install_titkon_packge.py \ No newline at end of file diff --git a/install_titkon_packge.py b/install_titkon_packge.py new file mode 100644 index 0000000000000000000000000000000000000000..bcf7f39fdcfec3dcd9413d15aae9bbb8581852e5 --- /dev/null +++ b/install_titkon_packge.py @@ -0,0 +1,3 @@ +import tiktoken +enc = tiktoken.encoding_for_model("gpt-4") +print(len(enc.encode('hello world'))) \ No newline at end of file