Kamal-prog-code commited on
Commit
cf4c436
·
1 Parent(s): e8782b1

Add application file

Browse files
Files changed (2) hide show
  1. requirements.txt +11 -0
  2. sitecustomize.py +29 -0
requirements.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ torch==2.6.0
2
+ transformers==4.46.3
3
+ tokenizers==0.20.3
4
+ accelerate
5
+ einops
6
+ addict
7
+ easydict
8
+ torchvision
9
+ flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
10
+ PyMuPDF
11
+ hf_transfer
sitecustomize.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+
4
+ def _install_hf_folder_shim() -> None:
5
+ try:
6
+ import huggingface_hub
7
+ except Exception:
8
+ return
9
+
10
+ if hasattr(huggingface_hub, "HfFolder"):
11
+ return
12
+
13
+ class HfFolder:
14
+ @staticmethod
15
+ def get_token() -> str | None:
16
+ return os.getenv("HUGGINGFACE_HUB_TOKEN") or os.getenv("HF_TOKEN")
17
+
18
+ @staticmethod
19
+ def save_token(token: str) -> None:
20
+ os.environ["HUGGINGFACE_HUB_TOKEN"] = token
21
+
22
+ @staticmethod
23
+ def delete_token() -> None:
24
+ os.environ.pop("HUGGINGFACE_HUB_TOKEN", None)
25
+
26
+ huggingface_hub.HfFolder = HfFolder
27
+
28
+
29
+ _install_hf_folder_shim()