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

extend max_prompt_length and input text for 128k evaluation #891

Merged
merged 3 commits into from
Sep 3, 2024
Merged
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
8 changes: 8 additions & 0 deletions benchmarks/inference/mii/src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ def run_client(args):
p.start()

tokenizer = AutoTokenizer.from_pretrained(args.model)

# make sure max_prompt_length is longer than the target prompt length
args.max_prompt_length = max(args.max_prompt_length, int(args.mean_prompt_length * 3))
# check if the all_text is longer than the max prompt length, if not expand it
global all_text
while len(tokenizer.tokenize(all_text)) < args.max_prompt_length:
all_text += all_text

query_generator = RandomQueryGenerator(all_text, tokenizer, seed=42)
request_text = query_generator.get_random_request_text(
args.mean_prompt_length,
Expand Down
Loading