Skip to content
Open
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
7 changes: 7 additions & 0 deletions esm/utils/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,15 @@ def decode_structure(
plddt = plddt[0, 1:-1].detach().cpu()

ptm = decoder_output.get("ptm", None)
if ptm is not None:
ptm = ptm.detach().cpu() # fix memory leak

pae = decoder_output.get("predicted_aligned_error", None)
if pae is not None:
pae = pae.detach().cpu() # fix memory leak
# free decoder output
del decoder_output
torch.cuda.empty_cache()

chain = ProteinChain.from_backbone_atom_coordinates(bb_coords, sequence=sequence)
chain = chain.infer_oxygen()
Expand Down