mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
remove autocast for text encoder forwad
This commit is contained in:
@@ -381,12 +381,11 @@ class PhotonPipeline(
|
||||
attention_mask = tokens["attention_mask"].bool().to(device)
|
||||
|
||||
with torch.no_grad():
|
||||
with torch.autocast("cuda", enabled=False):
|
||||
emb = self.text_encoder(
|
||||
input_ids=input_ids,
|
||||
attention_mask=attention_mask,
|
||||
output_hidden_states=True,
|
||||
)
|
||||
emb = self.text_encoder(
|
||||
input_ids=input_ids,
|
||||
attention_mask=attention_mask,
|
||||
output_hidden_states=True,
|
||||
)
|
||||
|
||||
all_embeddings = emb["last_hidden_state"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user