Skip to content

Commit

Permalink
Merge branch 'master' into loadams/update-opencv-python-cve
Browse files Browse the repository at this point in the history
  • Loading branch information
loadams committed Sep 3, 2024
2 parents bb19a3f + 1293d45 commit 1789678
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 1789678

Please sign in to comment.