Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten committed Nov 14, 2024
1 parent b694ba5 commit fac07af
Showing 1 changed file with 49 additions and 40 deletions.
89 changes: 49 additions & 40 deletions tests/models/decoder_only/language/test_mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
Run `pytest tests/models/test_mistral.py`.
"""
import copy

import pytest

import copy
from vllm import SamplingParams
from vllm.entrypoints.openai.tool_parsers.mistral_tool_parser import MistralToolParser # noqa
from vllm.entrypoints.openai.tool_parsers.mistral_tool_parser import ( # noqa
MistralToolParser)

from ...utils import check_logprobs_close

Expand Down Expand Up @@ -78,44 +80,51 @@
}
}
}]
MSGS = [{
"role": "system",
"content": "You are an assistant."
}, {
"role":
"user",
"content":
"Could you please rewrite the below article? \n\n My English needs improvving, maybe I make erors." # noqa
}, {
"role":
"assistant",
"content":
"",
"tool_calls": [{
"id": "bbc5b7ede",
"type": "function",
"function": {
"name":
"rewrite",
"arguments":
'{\"text\":\"My English needs improvving, maybe I make erors.\"}'
}
}]
}, {
"role": "tool",
"content":
"{\"action\":\"rewrite\",\"outcome\":\"My English needs improving, maybe I make errors.\"}", # noqa
"tool_call_id": "bbc5b7ede",
"name": "rewrite"
}, {
"role": "assistant",
"content": "---\n\nMy English needs improving, maybe I make errors"
}, {
"role":
"user",
"content": ("Can you tell me what the temperate"
" will be in Dallas, in fahrenheit?")
}]
MSGS = [
{
"role": "system",
"content": "You are an assistant."
},
{
"role":
"user",
"content":
"Could you please rewrite the below article? \n\n My English needs improvving, maybe I make erors." # noqa
},
{
"role":
"assistant",
"content":
"",
"tool_calls": [{
"id": "bbc5b7ede",
"type": "function",
"function": {
"name":
"rewrite",
"arguments":
'{\"text\":\"My English needs improvving, maybe I make erors.\"}'

Check failure on line 106 in tests/models/decoder_only/language/test_mistral.py

View workflow job for this annotation

GitHub Actions / ruff (3.12)

Ruff (E501)

tests/models/decoder_only/language/test_mistral.py:106:81: E501 Line too long (81 > 80)
}
}]
},
{
"role": "tool",
"content":
"{\"action\":\"rewrite\",\"outcome\":\"My English needs improving, maybe I make errors.\"}", # noqa
"tool_call_id": "bbc5b7ede",
"name": "rewrite"
},
{
"role": "assistant",
"content": "---\n\nMy English needs improving, maybe I make errors"
},
{
"role":
"user",
"content": ("Can you tell me what the temperate"
" will be in Dallas, in fahrenheit?")
}
]


@pytest.mark.parametrize("model", MODELS)
Expand Down

0 comments on commit fac07af

Please sign in to comment.