Angstormy commited on
Commit
b1e736b
·
verified ·
1 Parent(s): 09d1d8c

Upload download_model.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. download_model.py +19 -0
download_model.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gdown
2
+ import os
3
+
4
+ def download_english_model():
5
+ folder_id = "1m0OPfEoFs_oFhkTbjlRDA5oRbuXPWN8J"
6
+ output_dir = "trocr-large-english"
7
+
8
+ print(f"Downloading model files to {output_dir}/ ...")
9
+ print("This is a 2.5 GB download and may take a while. Please wait...")
10
+
11
+ os.makedirs(output_dir, exist_ok=True)
12
+
13
+ # Download the entire folder from Google Drive
14
+ gdown.download_folder(id=folder_id, output=output_dir, quiet=False, use_cookies=False)
15
+
16
+ print("\n[OK] Download complete! The 2.5 GB model is now ready for local inference.")
17
+
18
+ if __name__ == "__main__":
19
+ download_english_model()