1 line
2.9 KiB
JSON
1 line
2.9 KiB
JSON
{"repo": "a15280020511/expert-assessment-center", "files": {"open-model-market/v5_model_company.py": {"95cdda0e0d00109c81f2a286e7ac706319cc2c5f": {"t": 1785674656.6253726, "n": 2495, "h": "20aa20bfaf252702", "c": "\"\"\"Canonical model-company identity and platform diversity boundaries for V5.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Any, Mapping\n\nREQUIRE_DISTINCT_MODEL_COMPANIES = True\n# Two is the mathematical lower bound needed to exercise company diversity.\n# It is not a normal production pool width; production breadth is task-adaptive.\nMINIMUM_CANDIDATES_PER_WORK = 2\nABSOLUTE_INTELLIGENCE_RANKING_CEILING = 150\n# Compatibility alias for callers that treat this value as a catalog ceiling.\nDEFAULT_INTELLIGENCE_RANKING_LIMIT = ABSOLUTE_INTELLIGENCE_RANKING_CEILING\n\nMODEL_COMPANY_ALIASES: Mapping[str, str] = {\n \"01-ai\": \"01-ai\",\n \"ai21\": \"ai21-labs\",\n \"ai21-labs\": \"ai21-labs\",\n \"alibaba\": \"alibaba\",\n \"qwen\": \"alibaba\",\n \"anthropic\": \"anthropic\",\n \"amazon\": \"amazon\",\n \"amazon-nova\": \"amazon\",\n \"bytedance\": \"bytedance\",\n \"bytedance-seed\": \"bytedance\",\n \"cohere\": \"cohere\",\n \"deepmind\": \"google\",\n \"google\": \"google\",\n \"google-ai\": \"google\",\n \"deepseek\": \"deepseek\",\n \"meta\": \"meta\",\n \"meta-llama\": \"meta\",\n \"microsoft\": \"microsoft\",\n \"minimax\": \"minimax\",\n \"mistral\": \"mistral\",\n \"mistralai\": \"mistral\",\n \"moonshot\": \"moonshot\",\n \"moonshotai\": \"moonshot\",\n \"nous-research\": \"nous-research\",\n \"nousresearch\": \"nous-research\",\n \"nvidia\": \"nvidia\",\n \"openai\": \"openai\",\n \"perplexity\": \"perplexity\",\n \"stepfun\": \"stepfun\",\n \"tencent\": \"tencent\",\n \"thudm\": \"zhipu\",\n \"x-ai\": \"xai\",\n \"xai\": \"xai\",\n \"z-ai\": \"zhipu\",\n \"zhipu\": \"zhipu\",\n \"zhipu-ai\": \"zhipu\",\n}\n\n\ndef canonical_model_company(model_id: str) -> str:\n \"\"\"Return a stable company identity from one direct model ID.\"\"\"\n value = str(model_id or \"\").strip().casefold()\n author = value.split(\"/\", 1)[0].strip() if \"/\" in value else value\n if not author:\n return \"unknown\"\n return MODEL_COMPANY_ALIASES.get(author, author)\n\n\ndef candidate_company(candidate: Any) -> str:\n \"\"\"Return the canonical company for candidates, market rows, or models.\"\"\"\n if isinstance(candidate, Mapping):\n model_id = (\n candidate.get(\"model\")\n or candidate.get(\"model_id\")\n or candidate.get(\"id\")\n or \"\"\n )\n else:\n model_id = (\n getattr(candidate, \"model\", None)\n or getattr(candidate, \"model_id\", None)\n or getattr(candidate, \"id\", None)\n or \"\"\n )\n return canonical_model_company(str(model_id))\n"}}}} |