class VoiceCraft(
nn.Module,
PyTorchModelHubMixin,  # inherit from mixin
coders={
Namespace : (
lambda x: vars(x),  # Encoder: how to convert a `Namespace` to a valid jsonable value?
lambda data: Namespace(**data),  # Decoder: how to reconstruct a `Namespace` from a dictionary?
)
}
):
def __init__(self, args: Namespace): # annotate `args`
self.pattern = self.args.pattern
self.hidden_size = self.args.hidden_size
...
```