Skip to content

Commit

Permalink
make style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarshney-habana committed Aug 2, 2024
1 parent 191289e commit 00c84c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/text-generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@ def patch_scoped_linear_all_reduce(model):


def get_torch_compiled_model(model):
if model.config.model_type in ['gpt_bigcode']:
model.transformer = torch.compile(model.transformer, backend="hpu_backend", options={"keep_input_mutations": True})
if model.config.model_type in ["gpt_bigcode"]:
model.transformer = torch.compile(
model.transformer, backend="hpu_backend", options={"keep_input_mutations": True}
)
else:
model.model = torch.compile(model.model, backend="hpu_backend", options={"keep_input_mutations": True})
model.model = torch.compile(model.model, backend="hpu_backend", options={"keep_input_mutations": True})
return model


Expand Down

0 comments on commit 00c84c1

Please sign in to comment.