[Deprecation] Remove fallbacks for Embeddings API (#18795)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-05-28 15:09:04 +08:00
committed by GitHub
parent 0f0926b43f
commit 0c492b7824
3 changed files with 11 additions and 59 deletions

View File

@@ -797,17 +797,12 @@ class ModelConfig:
else:
# Aliases
if task_option == "embedding":
preferred_task = self._get_preferred_task(
architectures, supported_tasks)
if preferred_task != "embed":
msg = ("The 'embedding' task will be restricted to "
"embedding models in a future release. Please "
"pass `--task classify`, `--task score`, or "
"`--task reward` explicitly for other pooling "
"models.")
warnings.warn(msg, DeprecationWarning, stacklevel=2)
msg = ("The 'embedding' task has been renamed to "
"'embed', please use the new name. The old name "
"will be removed in v1.0.")
warnings.warn(msg, DeprecationWarning, stacklevel=2)
task_option = preferred_task or "embed"
task_option = "embed"
if task_option not in supported_tasks:
msg = (