aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels <niels.rogge1@gmail.com>2024-09-21 13:35:10 +0200
committerNiels <niels.rogge1@gmail.com>2024-09-21 13:35:10 +0200
commite9d2942e133a3a006cc622aa625551e960061883 (patch)
treec6e9b0071e3c3aafa0e339ff1387d3f56bb04116
parent851a8c2d322e789de74a081d5d00774e06780ee7 (diff)
downloadapollo-gfx803-e9d2942e133a3a006cc622aa625551e960061883.tar.gz
Add mixin
-rw-r--r--look2hear/models/base_model.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/look2hear/models/base_model.py b/look2hear/models/base_model.py
index 89b36ad..730194d 100644
--- a/look2hear/models/base_model.py
+++ b/look2hear/models/base_model.py
@@ -7,6 +7,8 @@
import torch
import torch.nn as nn
+from huggingface_hub import PyTorchModelHubMixin
+
def _unsqueeze_to_3d(x):
"""Normalize shape of `x` to [batch, n_chan, time]."""
@@ -32,7 +34,7 @@ def pad_to_appropriate_length(x, lcm):
return x
-class BaseModel(nn.Module):
+class BaseModel(nn.Module, PyTorchModelHubMixin, repo_url="https://github.com/JusperLee/Apollo", pipeline_tag="audio-to-audio"):
def __init__(self, sample_rate, in_chan=1):
super().__init__()
self._sample_rate = sample_rate