chienweichang commited on
Commit
f0cae54
1 Parent(s): d118bab

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -0
Dockerfile CHANGED
@@ -11,6 +11,15 @@ RUN pip install --no-cache-dir -r requirements.txt
11
  # 複製應用程式碼到容器內
12
  COPY . .
13
 
 
 
 
 
 
 
 
 
 
14
  # 暴露端口
15
  EXPOSE 7860
16
 
 
11
  # 複製應用程式碼到容器內
12
  COPY . .
13
 
14
+ # 設置 transformers cache 目錄
15
+ ENV TRANSFORMERS_CACHE=/app/cache
16
+
17
+ # 預先下載模型
18
+ RUN python -c "from transformers import AutoTokenizer, AutoModel; AutoTokenizer.from_pretrained('intfloat/multilingual-e5-large'); AutoModel.from_pretrained('intfloat/multilingual-e5-large')"
19
+
20
+ # 創建 cache 目錄
21
+ RUN mkdir -p /app/cache
22
+
23
  # 暴露端口
24
  EXPOSE 7860
25