| from huggingface_hub import HfApi | |
| from concurrent.futures import ThreadPoolExecutor | |
| import os | |
| api = HfApi() | |
| files = [f"model-000{i:02d}-of-00029.safetensors" for i in range(7, 30)] | |
| def upload_file(filepath): | |
| return api.upload_file( | |
| path_or_fileobj=filepath, | |
| path_in_repo=filepath, | |
| repo_id="emissary-ai/Python-Tab-Completion-CodeLlama-70b", | |
| repo_type="model" | |
| ) | |
| with ThreadPoolExecutor(max_workers=50) as executor: | |
| executor.map(upload_file, files) |