Spaces:
Runtime error
Runtime error
| import os | |
| import tempfile | |
| import subprocess | |
| from huggingface_hub import HfApi | |
| print("✅ Модель уже создана: https://huggingface.co/Andrewstivan/AURA") | |
| exit(0) | |
| REPO_NAME = "Andrewstivan/AURA" | |
| YAML_CONFIG = """slices: | |
| - sources: | |
| - model: ResplendentAI/Aura_v3_7B | |
| layer_range: [0, 32] | |
| - model: IlyaGusev/saiga_mistral_7b_merged | |
| layer_range: [0, 32] | |
| merge_method: slerp | |
| base_model: ResplendentAI/Aura_v3_7B | |
| parameters: | |
| t: | |
| - filter: self_attn | |
| value: [0, 0.5, 0.3, 0.7, 1] | |
| - filter: mlp | |
| value: [1, 0.5, 0.7, 0.3, 0] | |
| - value: 0.5 | |
| dtype: bfloat16 | |
| tokenizer_source: union | |
| """ | |
| print("Starting merge Aura + Saiga...") | |
| print("=" * 60) | |
| with tempfile.TemporaryDirectory() as tmpdir: | |
| config_path = f"{tmpdir}/config.yaml" | |
| with open(config_path, "w") as f: | |
| f.write(YAML_CONFIG) | |
| merged_path = f"{tmpdir}/merged" | |
| os.makedirs(merged_path, exist_ok=True) | |
| cmd = f"mergekit-yaml {config_path} {merged_path} --copy-tokenizer --allow-crimes --out-shard-size 1B --trust-remote-code" | |
| process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) | |
| for line in iter(process.stdout.readline, ''): | |
| print(line, end='') | |
| process.wait() | |
| if process.returncode == 0: | |
| print("=" * 60) | |
| print("✅ Merge complete! Uploading...") | |
| # Прямая загрузка без login() | |
| api = HfApi() | |
| api.create_repo(REPO_NAME, exist_ok=True) | |
| api.upload_folder( | |
| folder_path=merged_path, | |
| repo_id=REPO_NAME, | |
| repo_type="model", | |
| token=os.getenv("HF_TOKEN") | |
| ) | |
| print(f"🎉 Done! https://huggingface.co/{REPO_NAME}") | |
| else: | |
| print(f"❌ Error: {process.returncode}") |