mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
[Generate
] Fix no grad on some models (#39008)
Some checks are pending
Self-hosted runner (benchmark) / Benchmark (aws-g5-4xlarge-cache) (push) Waiting to run
Build documentation / build (push) Waiting to run
New model PR merged notification / Notify new model (push) Waiting to run
Slow tests on important models (on Push - A10) / Get all modified files (push) Waiting to run
Slow tests on important models (on Push - A10) / Slow & FA2 tests (push) Blocked by required conditions
Self-hosted runner (push-caller) / Check if setup was changed (push) Waiting to run
Self-hosted runner (push-caller) / build-docker-containers (push) Blocked by required conditions
Self-hosted runner (push-caller) / Trigger Push CI (push) Blocked by required conditions
Secret Leaks / trufflehog (push) Waiting to run
Update Transformers metadata / build_and_package (push) Waiting to run
Some checks are pending
Self-hosted runner (benchmark) / Benchmark (aws-g5-4xlarge-cache) (push) Waiting to run
Build documentation / build (push) Waiting to run
New model PR merged notification / Notify new model (push) Waiting to run
Slow tests on important models (on Push - A10) / Get all modified files (push) Waiting to run
Slow tests on important models (on Push - A10) / Slow & FA2 tests (push) Blocked by required conditions
Self-hosted runner (push-caller) / Check if setup was changed (push) Waiting to run
Self-hosted runner (push-caller) / build-docker-containers (push) Blocked by required conditions
Self-hosted runner (push-caller) / Trigger Push CI (push) Blocked by required conditions
Secret Leaks / trufflehog (push) Waiting to run
Update Transformers metadata / build_and_package (push) Waiting to run
fixes on torch no grad for generate
This commit is contained in:
parent
583db52bc6
commit
f85b47d1b8
@ -1265,6 +1265,7 @@ class BarkFineModel(BarkPreTrainedModel):
|
||||
attentions=all_self_attentions,
|
||||
)
|
||||
|
||||
@torch.no_grad()
|
||||
def generate(
|
||||
self,
|
||||
coarse_output: torch.Tensor,
|
||||
|
@ -1720,6 +1720,7 @@ class PatchTSMixerForPrediction(PatchTSMixerPreTrainedModel):
|
||||
scale=scale,
|
||||
)
|
||||
|
||||
@torch.no_grad()
|
||||
def generate(
|
||||
self,
|
||||
past_values: torch.Tensor,
|
||||
@ -2104,6 +2105,7 @@ class PatchTSMixerForRegression(PatchTSMixerPreTrainedModel):
|
||||
hidden_states=model_output.hidden_states,
|
||||
)
|
||||
|
||||
@torch.no_grad()
|
||||
def generate(
|
||||
self,
|
||||
past_values: torch.Tensor,
|
||||
|
@ -1724,6 +1724,7 @@ class PatchTSTForPrediction(PatchTSTPreTrainedModel):
|
||||
scale=scale,
|
||||
)
|
||||
|
||||
@torch.no_grad()
|
||||
def generate(
|
||||
self,
|
||||
past_values: torch.Tensor,
|
||||
@ -1933,6 +1934,7 @@ class PatchTSTForRegression(PatchTSTPreTrainedModel):
|
||||
attentions=model_output.attentions,
|
||||
)
|
||||
|
||||
@torch.no_grad()
|
||||
def generate(
|
||||
self,
|
||||
past_values: torch.Tensor,
|
||||
|
Loading…
Reference in New Issue
Block a user