Convert formatting to use ruff instead of yapf + isort (#26247)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-05 07:06:22 -07:00
committed by GitHub
parent 17edd8a807
commit d6953beb91
1508 changed files with 115205 additions and 94107 deletions
+6 -3
View File
@@ -11,8 +11,10 @@ class UBatchSlice:
token_slice: slice
def is_empty(self) -> bool:
return self.request_slice.start == self.request_slice.stop \
return (
self.request_slice.start == self.request_slice.stop
or self.token_slice.start == self.token_slice.stop
)
@property
def num_tokens(self) -> int:
@@ -22,6 +24,7 @@ class UBatchSlice:
UBatchSlices: TypeAlias = list[UBatchSlice]
def is_second_ubatch_empty(orig_num_tokens_per_ubatch: int,
padded_num_tokens_per_ubatch: int) -> bool:
def is_second_ubatch_empty(
orig_num_tokens_per_ubatch: int, padded_num_tokens_per_ubatch: int
) -> bool:
return padded_num_tokens_per_ubatch >= 2 * orig_num_tokens_per_ubatch