Просмотр исходного кода

reusing helper function to get cached directory

cadenmackenzie 9 месяцев назад
Родитель
Сommit
de09e2a831
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      exo/api/chatgpt_api.py

+ 2 - 1
exo/api/chatgpt_api.py

@@ -18,6 +18,7 @@ from exo.orchestration import Node
 from exo.models import build_base_shard, model_cards, get_repo, pretty_name
 from typing import Callable
 import os
+from exo.download.hf.hf_helpers import get_hf_home
 
 
 class Message:
@@ -205,7 +206,7 @@ class ChatGPTAPI:
     if DEBUG >= 2:
         print(f"\nChecking if model {model_name} is downloaded:")
     
-    cache_dir = Path.home() / ".cache" / "huggingface" / "hub"
+    cache_dir = get_hf_home() / "hub"
     repo = get_repo(model_name, self.inference_engine_classname)
     
     if DEBUG >= 2: