danicor commited on
Commit
ef895ac
·
verified ·
1 Parent(s): 9c29bc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,6 +1,9 @@
1
  import os
2
  from huggingface_hub import hf_hub_download
3
 
 
 
 
4
  # مسیر CelebAMask-HQ
5
  celeb_path = "/home/user/CelebAMask-HQ"
6
  face_parsing_path = os.path.join(celeb_path, "face_parsing")
@@ -12,8 +15,7 @@ print("[Info] face_parsing folder exists:", os.path.exists(face_parsing_path))
12
  # دانلود مدل از Hugging Face (اگر موجود نیست)
13
  model_path = hf_hub_download(
14
  repo_id="public-data/CelebAMask-HQ-Face-Parsing",
15
- filename="models/model.pth",
16
- cache_dir="./huggingface_models"
17
  )
18
 
19
  print("[Info] Model downloaded to:", model_path)
 
1
  import os
2
  from huggingface_hub import hf_hub_download
3
 
4
+ # مسیر قابل نوشتن در داکر
5
+ os.environ["HF_HOME"] = "/home/user/hf_cache"
6
+
7
  # مسیر CelebAMask-HQ
8
  celeb_path = "/home/user/CelebAMask-HQ"
9
  face_parsing_path = os.path.join(celeb_path, "face_parsing")
 
15
  # دانلود مدل از Hugging Face (اگر موجود نیست)
16
  model_path = hf_hub_download(
17
  repo_id="public-data/CelebAMask-HQ-Face-Parsing",
18
+ filename="models/model.pth"
 
19
  )
20
 
21
  print("[Info] Model downloaded to:", model_path)