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: Add more vllm supported models #756

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
with:
src: "xinference"
options: "--check"
version: "23.12.0"
- uses: isort/isort-action@master
with:
sortPaths: "xinference"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
files: xinference
repos:
- repo: https://github.com/psf/black
rev: 24.1a1
rev: 23.12.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
6 changes: 4 additions & 2 deletions xinference/api/restful_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ def read_main():
SPAStaticFiles(directory=ui_location, html=True),
)
else:
warnings.warn(f"""
warnings.warn(
f"""
Xinference ui is not built at expected directory: {ui_location}
To resolve this warning, navigate to {os.path.join(lib_location, "web/ui/")}
And build the Xinference ui by running "npm run build"
""")
"""
)

config = Config(
app=self._app, host=self._host, port=self._port, log_config=logging_conf
Expand Down
12 changes: 8 additions & 4 deletions xinference/core/chat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,13 @@ def retry(text, hist, max_tokens, temperature) -> Generator:
) as generate_interface:
history = gr.State([])

Markdown(f"""
Markdown(
f"""
<h1 style='text-align: center; margin-bottom: 1rem'>🚀 Xinference Generate Bot : {self.model_name} 🚀</h1>
""")
Markdown(f"""
"""
)
Markdown(
f"""
<div class="center">
Model ID: {self.model_uid}
</div>
Expand All @@ -298,7 +301,8 @@ def retry(text, hist, max_tokens, temperature) -> Generator:
<div class="center">
Model Quantization: {self.quantization}
</div>
""")
"""
)

with Column(variant="panel"):
textbox = Textbox(
Expand Down
6 changes: 3 additions & 3 deletions xinference/core/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def __init__(self):
super().__init__()
self._worker_address_to_worker: Dict[str, xo.ActorRefType["WorkerActor"]] = {}
self._worker_status: Dict[str, WorkerStatus] = {}
self._replica_model_uid_to_worker: Dict[str, xo.ActorRefType["WorkerActor"]] = (
{}
)
self._replica_model_uid_to_worker: Dict[
str, xo.ActorRefType["WorkerActor"]
] = {}
self._model_uid_to_replica_info: Dict[str, ReplicaInfo] = {}
self._uptime = None
self._lock = asyncio.Lock()
Expand Down
6 changes: 3 additions & 3 deletions xinference/model/llm/pytorch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ def _sanitize_generate_config(
and self.model_family.prompt_style
and self.model_family.prompt_style.stop_token_ids
):
generate_config["stop_token_ids"] = (
self.model_family.prompt_style.stop_token_ids.copy()
)
generate_config[
"stop_token_ids"
] = self.model_family.prompt_style.stop_token_ids.copy()

return generate_config

Expand Down
4 changes: 4 additions & 0 deletions xinference/model/llm/vllm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ class VLLMGenerateConfig(TypedDict, total=False):
"internlm-chat-20b",
"qwen-chat",
"Yi",
"Yi-chat",
"code-llama",
"code-llama-python",
"code-llama-instruct",
"mistral-instruct-v0.1",
"chatglm3",
]
Expand Down
Loading