code: def save_encoder(self, name:str):
          "Save the encoder to `name` inside the model directory."
          encoder = get_model(self.model)[0]
          if hasattr(encoder, 'module'): encoder = encoder.module
          torch.save(encoder.state_dict(), self.path/self.model_dir/f'{name}.pth'f save_encoder(self, name:str):
          "Save the encoder to `name` inside the model directory."
          encoder = get_model(self.model)[0]
          if hasattr(encoder, 'module'): encoder = encoder.module
          torch.save(encoder.state_dict(), self.path/self.model_dir/f'{name}.pth')
docs: Save the encoder to `name` inside the model directory.