Skip to content

Commit

Permalink
simplified ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Shapira committed Dec 10, 2024
1 parent 2aafd32 commit b2a56fe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fuse/data/tokenizers/modular_tokenizer/inject_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,9 @@ def build_scalars_and_embeddings(
num_tokens_token_so_far,
embedding_input,
)
num_tokens_token_so_far += 1
num_inputs_needing_embeddings += 1

elif tokenizer_name.startswith("VECTORS_"):
raise NotImplementedError
else:
num_tokens_token_so_far += len(curr_placeholder_encoding.ids)

curr_scalar_values = torch.full(
(len(curr_placeholder_encoding.ids),),
Expand All @@ -235,6 +231,7 @@ def build_scalars_and_embeddings(
curr_scalar_values, fill_value=False, dtype=torch.bool
)
)
num_tokens_token_so_far += len(curr_placeholder_encoding.ids)

all_scalars_values = torch.concat(all_scalars_values)
all_scalars_valid_mask = torch.concat(all_scalars_valid_mask)
Expand Down

0 comments on commit b2a56fe

Please sign in to comment.