Skip to content

Commit

Permalink
ENH: support cline style messages for all backend engines (#2763)
Browse files Browse the repository at this point in the history
  • Loading branch information
liunux4odoo authored Jan 15, 2025
1 parent d44765e commit 42a9561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions xinference/model/llm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def get_full_context(
tokenize=False,
**kwargs,
):
if "vision" not in self.model_family.model_ability: # type: ignore
messages = self.convert_messages_with_content_list_to_str_conversion(
messages
)
if tokenizer is not None:
try:
full_context = tokenizer.apply_chat_template(
Expand Down
1 change: 0 additions & 1 deletion xinference/model/llm/vllm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,6 @@ async def async_chat(
generate_config: Optional[Dict] = None,
request_id: Optional[str] = None,
) -> Union[ChatCompletion, AsyncGenerator[ChatCompletionChunk, None]]:
messages = self.convert_messages_with_content_list_to_str_conversion(messages)
tools = generate_config.pop("tools", []) if generate_config else None
model_family = self.model_family.model_family or self.model_family.model_name
full_context_kwargs = {}
Expand Down

0 comments on commit 42a9561

Please sign in to comment.