forked from luopingyi/xc_agent_platform_demo
20 lines
778 B
Python
20 lines
778 B
Python
"""Case-insensitive live model exclusions."""
|
|
import re
|
|
|
|
RULES = (
|
|
('gguf', r'gguf|\.gguf|ggml'),
|
|
('openchat', r'openchat'),
|
|
# Full-weight exports override adapter hints anywhere in the identifier.
|
|
('peft-lora', r'^(?!.*(?:merged|merge|fullft|full-ft)).*(?:\blora\b|adapter_model|adapter-config|peft)'),
|
|
('gpt2', r'gpt-?2|dialogpt|distilgpt2'),
|
|
('phi', r'phi[-_. ]?(?:3(?:\.5)?|4)(?:\D|$)'),
|
|
('nemotron-h', r'nemotron-h'), ('olmo2', r'olmo-?2'),
|
|
('lfm2', r'lfm2'), ('spark2.5', r'spark2_5|spark-x2\.5'),
|
|
('breeze', r'breeze'), ('gemma2', r'gemma-?2'),
|
|
('mistral-v0.1', r'mistral.*v0\.1'), ('tinyllama', r'tinyllama'),
|
|
)
|
|
|
|
|
|
def banned_rule(model):
|
|
return next((name for name, pattern in RULES if re.search(pattern, model, re.I)), None)
|