mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-31 02:02:22 +01:00
Merge pull request #6732 from dxrpl/fix/hwfit-skip-non-llm-collection-models
fix(hwfit): keep non-LLM HF collection models out of the LLM catalog (#6731)
This commit is contained in:
@@ -202,10 +202,26 @@ def _infer_use_case(repo_id, pipeline_tag):
|
||||
return "general"
|
||||
|
||||
|
||||
# HF collections mix in models no Cookbook LLM backend can serve (vision
|
||||
# encoders, time-series forecasters, image/video generators). Image models
|
||||
# have their own registry, so keep these out of the LLM catalog.
|
||||
_NON_LLM_PIPELINE_TAGS = frozenset({
|
||||
"time-series-forecasting",
|
||||
"zero-shot-image-classification",
|
||||
"image-classification",
|
||||
"image-feature-extraction",
|
||||
"text-to-image",
|
||||
"image-to-video",
|
||||
"text-to-video",
|
||||
})
|
||||
|
||||
|
||||
def _entry_from_collection_item(collection, item, source):
|
||||
repo_id = item.get("id") or ""
|
||||
if item.get("type") != "model" or not repo_id:
|
||||
return None
|
||||
if (item.get("pipeline_tag") or "").strip().lower() in _NON_LLM_PIPELINE_TAGS:
|
||||
return None
|
||||
repo_prefix = source.get("repo_prefix")
|
||||
if repo_prefix and not repo_id.startswith(repo_prefix):
|
||||
return None
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import pytest
|
||||
|
||||
from services.hwfit.hf_discovery import _entry_from_collection_item
|
||||
|
||||
_SOURCE = {"owner": "google", "provider": "Google"}
|
||||
_COLLECTION = {"title": "collection"}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("repo_id,pipeline_tag", [
|
||||
("google/timesfm-3.0-pytorch", "time-series-forecasting"),
|
||||
("google/siglip2-base-patch16-224", "zero-shot-image-classification"),
|
||||
("moonshotai/MoonViT-SO-400M", "image-feature-extraction"),
|
||||
("zai-org/CogView4-6B", "text-to-image"),
|
||||
("zai-org/CogVideoX-5b-I2V", "image-to-video"),
|
||||
("zai-org/CogVideoX1.5-5B", "text-to-video"),
|
||||
])
|
||||
def test_non_llm_collection_models_are_skipped(repo_id, pipeline_tag):
|
||||
item = {"id": repo_id, "type": "model", "pipeline_tag": pipeline_tag, "numParameters": 1_000_000_000}
|
||||
assert _entry_from_collection_item(_COLLECTION, item, _SOURCE) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize("repo_id,pipeline_tag", [
|
||||
("google/gemma-4-12B-it", "image-text-to-text"),
|
||||
("Qwen/Qwen3.6-27B", "text-generation"),
|
||||
("Qwen/Qwen3-Embedding-4B", "feature-extraction"),
|
||||
("NousResearch/DeepHermes-Egregore-v2-RLAIF-8b-Atropos", "reinforcement-learning"),
|
||||
("Qwen/Qwen3-Next-80B-A3B-Instruct", ""),
|
||||
])
|
||||
def test_servable_collection_models_are_kept(repo_id, pipeline_tag):
|
||||
item = {"id": repo_id, "type": "model", "pipeline_tag": pipeline_tag, "numParameters": 4_000_000_000}
|
||||
assert _entry_from_collection_item(_COLLECTION, item, _SOURCE) is not None
|
||||
Reference in New Issue
Block a user