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

Test chunked #17

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
13 changes: 10 additions & 3 deletions llm_bench/load_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def __init__(self, distribution: str, mean: int, cap: Optional[int], alpha: floa
raise ValueError(f"Unknown distribution {self.distribution}")

def sample(self) -> int:
return 0

for _ in range(1000):
sample = self.sample_func()
if sample <= 0:
Expand Down Expand Up @@ -250,7 +252,7 @@ def format_payload(self, prompt, max_tokens, images):
"max_tokens": max_tokens,
"stream": self.parsed_options.stream,
"temperature": self.parsed_options.temperature,
"n": self.parsed_options.n,
# "n": self.parsed_options.n,
}
if self.parsed_options.chat:
if images is None:
Expand Down Expand Up @@ -278,7 +280,7 @@ def format_payload(self, prompt, max_tokens, images):
def parse_output_json(self, data, prompt):
usage = data.get("usage", None)

assert len(data["choices"]) == 1, f"Too many choices {len(data['choices'])}"
# assert len(data["choices"]) == 1, f"Too many choices {len(data['choices'])}"
choice = data["choices"][0]
if self.parsed_options.chat:
if self.parsed_options.stream:
Expand All @@ -300,8 +302,13 @@ def parse_output_json(self, data, prompt):
class FireworksProvider(OpenAIProvider):
def format_payload(self, prompt, max_tokens, images):
data = super().format_payload(prompt, max_tokens, images)
data["min_tokens"] = max_tokens
data["prompt"] = [prompt] * self.parsed_options.n
data["min_tokens"] = 1
data["max_tokens"] = 1
data["prompt_cache_max_len"] = self.parsed_options.prompt_cache_max_len
# data["echo"] = True
# data["logprobs"] = 0

return data


Expand Down