Skip to content

Commit a577435

Browse files
authored
Annotate tqdm type in compute_request_limits (stanford-crfm#1836)
1 parent 18000c6 commit a577435

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/compute_request_limits.py

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def figure_out_max_prompt_length(
9090

9191
# Perform a binary search to find the max tokens between lower_bound and upper_bound
9292
lower_bound += num_tokens_prefix + num_tokens_suffix
93+
pbar: tqdm
9394
with tqdm(total=int(math.log2(upper_bound - lower_bound))) as pbar:
9495
while lower_bound < upper_bound:
9596
middle = math.ceil((lower_bound + upper_bound) / 2)
@@ -142,6 +143,7 @@ def figure_out_max_prompt_length_plus_tokens(
142143
print("The model has a limit on the number of tokens")
143144

144145
# Perform a binary search to find the max tokens between lower_bound and upper_bound
146+
pbar: tqdm
145147
with tqdm(total=int(math.log2(upper_bound - lower_bound))) as pbar:
146148
while lower_bound < upper_bound:
147149
middle = math.ceil((lower_bound + upper_bound) / 2)

0 commit comments

Comments
 (0)