yellow60852 commited on
Commit
c98619c
·
verified ·
1 Parent(s): 58f9f55

Upload download_models.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. download_models.py +25 -0
download_models.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from huggingface_hub import snapshot_download
3
+
4
+ def main():
5
+ MODEL_CACHE_DIR = "/code/models"
6
+ os.makedirs(MODEL_CACHE_DIR, exist_ok=True)
7
+
8
+ print("Downloading SenseVoiceSmall model...")
9
+ snapshot_download(
10
+ repo_id="FunAudioLLM/SenseVoiceSmall",
11
+ local_dir=os.path.join(MODEL_CACHE_DIR, "SenseVoiceSmall"),
12
+ ignore_patterns=["*.onnx"]
13
+ )
14
+
15
+ print("Downloading FSMN-VAD model...")
16
+ snapshot_download(
17
+ repo_id="funasr/fsmn-vad",
18
+ local_dir=os.path.join(MODEL_CACHE_DIR, "fsmn-vad"),
19
+ ignore_patterns=["*.onnx"]
20
+ )
21
+
22
+ print("All models downloaded successfully.")
23
+
24
+ if __name__ == "__main__":
25
+ main()