Studio: do not show Run for embedding-only non-GGUF models in the Model Hub (#7245)
* Studio: do not show Run for embedding-only non-GGUF models in the Model Hub A downloaded embedding-only repo (sentence-transformers, feature-extraction) reports canChat by safetensors format and classifies as supported, so the Model Hub showed a Run button that dead-ends at load. Keep embedding-only non-GGUF models out of the Run gate. GGUF is unaffected (llama.cpp resolves embed vs generate at load time), and these models stay trainable. * Gate embedding-only models on the pipeline tag, not just capabilities An embedding repo whose name or tags also imply code, vision, audio or reasoning (e.g. jina-embeddings-v2-base-code picks up code from its -code suffix) slipped the embedding-only Run gate and dead-ended on a chat load. Treat a feature-extraction or sentence-similarity pipeline tag as authoritative for the gate; the change only ever widens it. * studio: tighten comments in the hub embedding run guard * Tighten comments in the hub embedding run guard --------- Co-authored-by: danielhanchen <unslothshared@gmail.com>
This commit is contained in:
parent
66808ab25d
commit
6c78147980
1 changed files with 23 additions and 0 deletions
|
|
@ -59,6 +59,13 @@ import { ModelReadme } from "./model-readme";
|
|||
import { OwnerAvatar } from "./owner-avatar";
|
||||
import { AccessChip, CapabilityPill } from "./shared";
|
||||
|
||||
// HF pipeline_tag values authoritative for embedding-only repos; capability
|
||||
// labels (code/vision/audio) can leak onto them via name or tags.
|
||||
const EMBEDDING_PIPELINE_TAGS: ReadonlySet<string> = new Set([
|
||||
"feature-extraction",
|
||||
"sentence-similarity",
|
||||
]);
|
||||
|
||||
function ViewRepositoryButton({
|
||||
repoId,
|
||||
isDataset,
|
||||
|
|
@ -531,11 +538,27 @@ export const ModelInspector = memo(function ModelInspector({
|
|||
? formatCompact(model.totalParams)
|
||||
: "N/A";
|
||||
const unslothSupported = unslothSupport.status !== "unsupported";
|
||||
// Embedding-only non-GGUF repos have no generative head, so keep them out of
|
||||
// the Run gate. Prefer the pipeline tag, else the capability heuristic.
|
||||
const isEmbeddingOnly =
|
||||
!model.isGguf &&
|
||||
model.capabilities.some((c) => c.key === "embedding") &&
|
||||
(EMBEDDING_PIPELINE_TAGS.has(model.pipelineTag?.toLowerCase() ?? "") ||
|
||||
!model.capabilities.some(
|
||||
(c) =>
|
||||
c.key === "conversational" ||
|
||||
c.key === "tools" ||
|
||||
c.key === "reasoning" ||
|
||||
c.key === "code" ||
|
||||
c.key === "vision" ||
|
||||
c.key === "audio",
|
||||
));
|
||||
// Chat-only hosts (no supported GPU / usable MLX) run inference only through
|
||||
// llama.cpp, so only GGUF is loadable.
|
||||
const canRunModel =
|
||||
!isDataset &&
|
||||
(model.runtimeCapabilities?.canChat ?? true) &&
|
||||
!isEmbeddingOnly &&
|
||||
(model.isGguf || (!chatOnly && unslothSupported));
|
||||
const canTrainModel =
|
||||
!isDataset &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue