-
Notifications
You must be signed in to change notification settings - Fork 408
[WIP] feat(perf): add --max-turn-tokens for per-turn max_tokens override in multi-turn mode #1359
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
base: main
Are you sure you want to change the base?
Changes from all commits
7a06dba
3a8be9e
9b28a0f
f06de36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| import aiohttp | ||||||
| import json | ||||||
| from typing import Any, AsyncGenerator, Dict, List, Tuple, Union | ||||||
| from typing import Any, AsyncGenerator, Dict, List, Tuple, Union, Optional | ||||||
|
|
||||||
| from evalscope.perf.arguments import Arguments | ||||||
| from evalscope.perf.multi_turn_args import _sample_int_or_range | ||||||
|
|
@@ -37,7 +37,7 @@ def __init__(self, param: Arguments): | |||||
| else: | ||||||
| self.tokenizer = None | ||||||
|
|
||||||
| def build_request(self, messages: Union[List[Dict], str], param: Arguments = None) -> Dict: | ||||||
| def build_request(self, messages: Union[List[Dict], str], param: Arguments = None, turn_index: Optional[int] = None) -> Dict: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| """Build a custom API request body based on the input messages and parameters. | ||||||
|
|
||||||
| This method formats the input messages into the expected request format | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| import json | ||||||
| import os | ||||||
| from typing import Any, Dict, Iterator, List | ||||||
| from typing import Any, Dict, Iterator, List, Optional | ||||||
|
|
||||||
| from evalscope.perf.arguments import Arguments | ||||||
| from evalscope.perf.multi_turn_args import _sample_int_or_range | ||||||
|
|
@@ -17,7 +17,7 @@ class DashScopeApiPlugin(ApiPluginBase): | |||||
| def __init__(self, param: Arguments): | ||||||
| super().__init__(param) | ||||||
|
|
||||||
| def build_request(self, messages: List[Dict], param: Arguments = None) -> Dict: | ||||||
| def build_request(self, messages: List[Dict], param: Arguments = None, turn_index: Optional[int] = None) -> Dict: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| """Build the openai format request based on prompt, dataset | ||||||
|
|
||||||
| Args: | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two improvements for this validator:
max_tokensvalidator (line 373) allows values>= 0, while this validator requires>= 1. It's better to allow0for consistency, as some APIs might use0to indicate a default or metadata-only request.vwill be anint, and subsequent logic inopenai_api.py(which expects a list) will fail. It's safer to coerce single values into a list.