Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import multiprocessing
- from huggingface_hub import hf_hub_download
- def download_file(model_name, filename):
- try:
- model_path = hf_hub_download(model_name, filename=filename)
- print(f"Successfully downloaded: {filename}")
- return model_path
- except Exception as e:
- print(f"Error downloading {filename}: {str(e)}")
- return None
- def download_files_parallel(model_name, file_parts):
- with multiprocessing.Pool() as pool:
- results = pool.starmap(
- download_file,
- [(model_name, filename) for filename in file_parts]
- )
- return results
- if __name__ == "__main__":
- model_name = "mradermacher/Tess-3-Llama-3.1-405B-GGUF"
- file_parts = [
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part1of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part2of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part3of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part4of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part5of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part6of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part7of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part8of9",
- "Tess-3-Llama-3.1-405B.Q8_0.gguf.part9of9",
- ]
- downloaded_paths = download_files_parallel(model_name, file_parts)
- for filename, path in zip(file_parts, downloaded_paths):
- if path:
- print(f"{filename}: {path}")
- else:
- print(f"{filename}: Download failed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement