Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ef82d954 |
26
main.py
26
main.py
@@ -157,7 +157,7 @@ def search_models(keyword: str) -> list:
|
||||
|
||||
|
||||
def check_architecture(model_id: str) -> tuple:
|
||||
"""检查模型架构"""
|
||||
"""检查模型是否有有效的 config.json(不限架构类型)"""
|
||||
try:
|
||||
cfg_url = f"{MODELSCOPE_API}/models/{model_id}/repo?Revision=master&FilePath=config.json"
|
||||
resp = requests.get(cfg_url, timeout=10)
|
||||
@@ -165,20 +165,13 @@ def check_architecture(model_id: str) -> tuple:
|
||||
cfg = resp.json()
|
||||
archs = cfg.get('architectures', [])
|
||||
mtype = cfg.get('model_type', '')
|
||||
arch_str = str(archs)
|
||||
for special in SUPPORTED_SPECIAL_ARCHS:
|
||||
if special in arch_str:
|
||||
return True, special
|
||||
for kw in SUPPORTED_ARCH_KEYWORDS:
|
||||
if kw in arch_str:
|
||||
return True, kw
|
||||
if mtype in SUPPORTED_MODEL_TYPES:
|
||||
return True, mtype
|
||||
return False, f"arch={archs} type={mtype}"
|
||||
if archs or mtype:
|
||||
return True, f"arch={archs} type={mtype}"
|
||||
return False, "empty config"
|
||||
mid_upper = model_id.upper()
|
||||
if 'QWEN3' in mid_upper or 'QWEN2' in mid_upper:
|
||||
return True, "GGUF"
|
||||
return False, "no config, not Qwen"
|
||||
if 'LLAMA' in mid_upper:
|
||||
return True, "Llama(GGUF)"
|
||||
return False, "no config"
|
||||
except Exception as e:
|
||||
return True, f"check error: {e}"
|
||||
|
||||
@@ -425,8 +418,9 @@ def run_pipeline(submit_limit: int = 2):
|
||||
submitted += 1
|
||||
log(f" ✅ {m['model_id']}")
|
||||
db_conn.execute(
|
||||
'INSERT OR REPLACE INTO submitted VALUES (?,?,?,?)',
|
||||
(m['model_id'], TARGET_GPU, str(task_id), datetime.now().isoformat())
|
||||
'INSERT OR REPLACE INTO submitted VALUES (?,?,?,?,?,?)',
|
||||
(m['model_id'], TARGET_GPU, str(task_id), 'submitted',
|
||||
datetime.now().isoformat(), None)
|
||||
)
|
||||
else:
|
||||
log(f" ❌ {m['model_id']}: {msg}")
|
||||
|
||||
Reference in New Issue
Block a user