Skip to content

Commit

Permalink
Merge branch 'loadams/update-opencv-python-cve' of https://github.com…
Browse files Browse the repository at this point in the history
…/microsoft/DeepSpeedExamples into loadams/update-opencv-python-cve
  • Loading branch information
loadams committed Sep 3, 2024
2 parents d899591 + 1789678 commit e858a4d
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 e858a4d

Please sign in to comment.