Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bad check #683

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def forward(


class FlashGemma2ForCausalLM(torch.nn.Module):
def __init__(self, prefix, config, weights, causal: bool):
def __init__(self, prefix, config, weights, causal=True):
super().__init__()
self.config = config

Expand Down
12 changes: 2 additions & 10 deletions server/lorax_server/models/flash_causal_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,15 +1114,6 @@ def __init__(
weights._set_config(model_id, config)

self._supports_embeddings = embedding_dim is not None
if (
not (weights.has_tensor("lm_head.weight") or weights.has_tensor("language_model.lm_head.weight"))
and not self._supports_embeddings
):
raise ValueError(
"Model does not have lm head so it is presumed to be for embeddings."
"No embedding_dim was provided so we cannot load the model."
"Please pass in an embedding_dim to the model."
)

prefix = ""
model = model_cls(prefix, config, weights)
Expand Down Expand Up @@ -1750,7 +1741,8 @@ def generate_token(
# Only save tokens if we are done prefilling for this request
batch.all_input_ids_tensor[
i,
batch.cache_lengths_tensor[i] + batch.input_lengths[i] : batch.cache_lengths_tensor[i]
batch.cache_lengths_tensor[i]
+ batch.input_lengths[i] : batch.cache_lengths_tensor[i]
+ batch.input_lengths[i]
+ accepted_ids[i],
] = next_input_ids[cu_accepted_ids[i] : cu_accepted_ids[i + 1]]
Expand Down
Loading