multimodalart HF Staff commited on
Commit
78f528e
·
verified ·
1 Parent(s): 798a242

Read the kernel cache with FASTH3_KERNEL_CACHE_TOKEN when set

Browse files

The org Space's HF_TOKEN cannot read the private multimodalart cache repo.

Files changed (1) hide show
  1. fasth3_engine.py +2 -1
fasth3_engine.py CHANGED
@@ -57,7 +57,8 @@ def fetch_kernel_cache() -> bool:
57
 
58
  t0 = time.time()
59
  try:
60
- archive = hf_hub_download(KERNEL_CACHE_REPO, kernel_cache_name(), repo_type="dataset", token=_hf_token())
 
61
  with tarfile.open(archive) as tar:
62
  tar.extractall(KERNEL_CACHE_DIR, filter="tar")
63
  except Exception as error:
 
57
 
58
  t0 = time.time()
59
  try:
60
+ token = os.getenv("FASTH3_KERNEL_CACHE_TOKEN") or _hf_token()
61
+ archive = hf_hub_download(KERNEL_CACHE_REPO, kernel_cache_name(), repo_type="dataset", token=token)
62
  with tarfile.open(archive) as tar:
63
  tar.extractall(KERNEL_CACHE_DIR, filter="tar")
64
  except Exception as error: