Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Added the check for reserved model uid like "instances", "prompts" etc. #1303

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions xinference/core/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

ASYNC_LAUNCH_TASKS = {} # type: ignore

RESERVED_MODEL_UIDS = ["prompts", "families", "vllm-supported", "instances"]


def callback_for_async_launch(model_uid: str):
ASYNC_LAUNCH_TASKS.pop(model_uid, None)
Expand Down Expand Up @@ -747,6 +749,11 @@ async def launch_builtin_model(

if model_uid is None:
model_uid = self._gen_model_uid(model_name)
else:
if model_uid in RESERVED_MODEL_UIDS:
raise ValueError(
f"Model uid cannot be the reserved name: '{model_uid}'."
)

model_size = str(model_size_in_billions) if model_size_in_billions else ""
logger.debug(
Expand Down
Loading