VietCat commited on
Commit
3b7f3b9
·
1 Parent(s): 1cf6170

fix runtime error

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -4
  2. app.py +0 -2
Dockerfile CHANGED
@@ -8,10 +8,10 @@ RUN pip install --no-cache-dir -r requirements.txt
8
 
9
  COPY . .
10
 
11
- # Tạo thư mục cache cấp quyền ghi
12
- RUN mkdir -p /app/cache
13
 
14
- # Đặt biến môi trường để Transformers ghi cache ở nơi được phép
15
- ENV TRANSFORMERS_CACHE=/app/cache
16
 
17
  CMD ["python", "app.py"]
 
8
 
9
  COPY . .
10
 
11
+ # Tạo thư mục cache theo chuẩn Hugging Face
12
+ RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
13
 
14
+ # Đặt biến môi trường đúng chuẩn mới
15
+ ENV HF_HOME=/app/hf_cache
16
 
17
  CMD ["python", "app.py"]
app.py CHANGED
@@ -1,6 +1,4 @@
1
  import os
2
- os.environ["TRANSFORMERS_CACHE"] = "/app/cache"
3
-
4
  import gradio as gr
5
  from transformers import GPT2Tokenizer, GPT2LMHeadModel
6
 
 
1
  import os
 
 
2
  import gradio as gr
3
  from transformers import GPT2Tokenizer, GPT2LMHeadModel
4