Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,36 +1,18 @@
|
|
| 1 |
import os
|
| 2 |
import tempfile
|
| 3 |
import subprocess
|
| 4 |
-
import json
|
| 5 |
-
import requests
|
| 6 |
from huggingface_hub import login, HfApi
|
| 7 |
|
| 8 |
REPO_NAME = "Andrewstivan/AURA"
|
| 9 |
|
| 10 |
-
# Скачиваем и исправляем конфиг Saiga
|
| 11 |
-
print("Fixing Saiga config...")
|
| 12 |
-
saiga_config_url = "https://huggingface.co/IlyaGusev/saiga_mistral_7b/raw/main/config.json"
|
| 13 |
-
response = requests.get(saiga_config_url)
|
| 14 |
-
saiga_config = response.json()
|
| 15 |
-
|
| 16 |
-
if saiga_config.get("architectures") is None:
|
| 17 |
-
saiga_config["architectures"] = ["MistralForCausalLM"]
|
| 18 |
-
print("✅ Added architectures field to Saiga config")
|
| 19 |
-
else:
|
| 20 |
-
print("Saiga config already has architectures")
|
| 21 |
-
|
| 22 |
-
# Сохраняем исправленный конфиг
|
| 23 |
-
with open("/tmp/saiga_config_fixed.json", "w") as f:
|
| 24 |
-
json.dump(saiga_config, f)
|
| 25 |
-
|
| 26 |
YAML_CONFIG = """slices:
|
| 27 |
- sources:
|
| 28 |
- model: ResplendentAI/Aura_v3_7B
|
| 29 |
layer_range: [0, 32]
|
| 30 |
-
|
| 31 |
- model: IlyaGusev/saiga_mistral_7b
|
| 32 |
layer_range: [0, 32]
|
| 33 |
-
|
| 34 |
merge_method: slerp
|
| 35 |
base_model: ResplendentAI/Aura_v3_7B
|
| 36 |
parameters:
|
|
@@ -54,9 +36,6 @@ with tempfile.TemporaryDirectory() as tmpdir:
|
|
| 54 |
merged_path = f"{tmpdir}/merged"
|
| 55 |
os.makedirs(merged_path, exist_ok=True)
|
| 56 |
|
| 57 |
-
# Указываем mergekit использовать локальный конфиг для Saiga
|
| 58 |
-
os.environ["HF_HUB_OFFLINE"] = "0"
|
| 59 |
-
|
| 60 |
cmd = f"mergekit-yaml {config_path} {merged_path} --copy-tokenizer --allow-crimes --out-shard-size 1B --trust-remote-code"
|
| 61 |
|
| 62 |
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
|
|
|
|
| 1 |
import os
|
| 2 |
import tempfile
|
| 3 |
import subprocess
|
|
|
|
|
|
|
| 4 |
from huggingface_hub import login, HfApi
|
| 5 |
|
| 6 |
REPO_NAME = "Andrewstivan/AURA"
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
YAML_CONFIG = """slices:
|
| 9 |
- sources:
|
| 10 |
- model: ResplendentAI/Aura_v3_7B
|
| 11 |
layer_range: [0, 32]
|
| 12 |
+
model_type: mistral
|
| 13 |
- model: IlyaGusev/saiga_mistral_7b
|
| 14 |
layer_range: [0, 32]
|
| 15 |
+
model_type: mistral
|
| 16 |
merge_method: slerp
|
| 17 |
base_model: ResplendentAI/Aura_v3_7B
|
| 18 |
parameters:
|
|
|
|
| 36 |
merged_path = f"{tmpdir}/merged"
|
| 37 |
os.makedirs(merged_path, exist_ok=True)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
cmd = f"mergekit-yaml {config_path} {merged_path} --copy-tokenizer --allow-crimes --out-shard-size 1B --trust-remote-code"
|
| 40 |
|
| 41 |
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
|