arcan3 commited on
Commit
35916c5
β€’
1 Parent(s): 7375741

adding rust

Browse files
Languages/deu/G_100000.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf70a8d4b18a87bd237e1d8e5789f5dc3181d8cf577683cf0bacace87d44ffaa
3
+ size 145489905
Languages/deu/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec453d50be1976ddb3b501c7dc09128cdf360b83e5b0cf7dec68dc5caa460f49
3
+ size 1887
Languages/deu/vocab.txt ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ v
3
+ 2
4
+ q
5
+ g
6
+ -
7
+ f
8
+ 1
9
+ 8
10
+ a
11
+ h
12
+ 4
13
+ ΓΆ
14
+ 3
15
+ r
16
+ m
17
+ Γ€
18
+ l
19
+ n
20
+ t
21
+ Γ«
22
+ d
23
+ b
24
+ y
25
+ ß
26
+ o
27
+ u
28
+ _
29
+ j
30
+ s
31
+ 6
32
+ 5
33
+ Γ―
34
+ c
35
+ i
36
+ ΓΌ
37
+ p
38
+ k
39
+ e
40
+ –
41
+ w
42
+ z
43
+ 7
44
+ x
45
+ 0
app.py CHANGED
@@ -23,7 +23,7 @@ from configurations.get_constants import constantConfig
23
 
24
  from speaker_encoder.voice_encoder import SpeakerEncoder
25
 
26
- from df.enhance import enhance, init_df, load_audio, save_audio
27
  from configurations.get_hyperparameters import hyperparameterConfig
28
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
29
 
 
23
 
24
  from speaker_encoder.voice_encoder import SpeakerEncoder
25
 
26
+ from df_local.enhance import enhance, init_df, load_audio, save_audio
27
  from configurations.get_hyperparameters import hyperparameterConfig
28
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
29
 
{df β†’ df_local}/__init__.py RENAMED
File without changes
{df β†’ df_local}/checkpoint.py RENAMED
@@ -8,9 +8,9 @@ import torch
8
  from loguru import logger
9
  from torch import nn
10
 
11
- from df.config import Csv, config
12
- from df.model import init_model
13
- from df.utils import check_finite_module
14
  from libdf import DF
15
 
16
 
 
8
  from loguru import logger
9
  from torch import nn
10
 
11
+ from df_local.config import Csv, config
12
+ from df_local.model import init_model
13
+ from df_local.utils import check_finite_module
14
  from libdf import DF
15
 
16
 
{df β†’ df_local}/config.py RENAMED
File without changes
{df β†’ df_local}/deepfilternet2.py RENAMED
@@ -5,8 +5,8 @@ import torch
5
  from loguru import logger
6
  from torch import Tensor, nn
7
 
8
- from df.config import Csv, DfParams, config
9
- from df.modules import (
10
  Conv2dNormAct,
11
  ConvTranspose2dNormAct,
12
  DfOp,
@@ -18,7 +18,7 @@ from df.modules import (
18
  erb_fb,
19
  get_device,
20
  )
21
- from df.multiframe import MF_METHODS, MultiFrameModule
22
  from libdf import DF
23
 
24
 
 
5
  from loguru import logger
6
  from torch import Tensor, nn
7
 
8
+ from df_local.config import Csv, DfParams, config
9
+ from df_local.modules import (
10
  Conv2dNormAct,
11
  ConvTranspose2dNormAct,
12
  DfOp,
 
18
  erb_fb,
19
  get_device,
20
  )
21
+ from df_local.multiframe import MF_METHODS, MultiFrameModule
22
  from libdf import DF
23
 
24
 
{df β†’ df_local}/enhance.py RENAMED
@@ -12,13 +12,13 @@ from torch import Tensor, nn
12
  from torch.nn import functional as F
13
  from torchaudio.backend.common import AudioMetaData
14
 
15
- import df
16
- from df import config
17
- from df.checkpoint import load_model as load_model_cp
18
- from df.logger import init_logger, warn_once
19
- from df.model import ModelParams
20
- from df.modules import get_device
21
- from df.utils import as_complex, as_real, get_norm_alpha, resample
22
  from libdf import DF, erb, erb_norm, unit_norm
23
 
24
 
@@ -100,7 +100,7 @@ def init_df(
100
  use_default_model = True
101
  model_base_dir = os.path.relpath(
102
  os.path.join(
103
- os.path.dirname(df.__file__), os.pardir, "pretrained_models", default_model
104
  )
105
  )
106
  if not os.path.isdir(model_base_dir):
 
12
  from torch.nn import functional as F
13
  from torchaudio.backend.common import AudioMetaData
14
 
15
+ import df_local
16
+ from df_local import config
17
+ from df_local.checkpoint import load_model as load_model_cp
18
+ from df_local.logger import init_logger, warn_once
19
+ from df_local.model import ModelParams
20
+ from df_local.modules import get_device
21
+ from df_local.utils import as_complex, as_real, get_norm_alpha, resample
22
  from libdf import DF, erb, erb_norm, unit_norm
23
 
24
 
 
100
  use_default_model = True
101
  model_base_dir = os.path.relpath(
102
  os.path.join(
103
+ os.path.dirname(df_local.__file__), os.pardir, "pretrained_models", default_model
104
  )
105
  )
106
  if not os.path.isdir(model_base_dir):
{df β†’ df_local}/logger.py RENAMED
@@ -10,8 +10,8 @@ import torch
10
  from loguru import logger
11
  from torch.types import Number
12
 
13
- from df.modules import GroupedLinearEinsum
14
- from df.utils import get_branch_name, get_commit_hash, get_device, get_host
15
 
16
  _logger_initialized = False
17
  WARN_ONCE_NO = logger.level("WARNING").no + 1
@@ -171,7 +171,7 @@ def log_model_summary(model: torch.nn.Module, verbose=False):
171
  logger.debug("Failed to import ptflops. Cannot print model summary.")
172
  return
173
 
174
- from df.model import ModelParams
175
 
176
  # Generate input of 1 second audio
177
  # Necessary inputs are:
 
10
  from loguru import logger
11
  from torch.types import Number
12
 
13
+ from df_local.modules import GroupedLinearEinsum
14
+ from df_local.utils import get_branch_name, get_commit_hash, get_device, get_host
15
 
16
  _logger_initialized = False
17
  WARN_ONCE_NO = logger.level("WARNING").no + 1
 
171
  logger.debug("Failed to import ptflops. Cannot print model summary.")
172
  return
173
 
174
+ from df_local.model import ModelParams
175
 
176
  # Generate input of 1 second audio
177
  # Necessary inputs are:
{df β†’ df_local}/model.py RENAMED
@@ -3,13 +3,13 @@ from importlib import import_module
3
  import torch
4
  from loguru import logger
5
 
6
- from df.config import DfParams, config
7
 
8
 
9
  class ModelParams(DfParams):
10
  def __init__(self):
11
  self.__model = config("MODEL", default="deepfilternet", section="train")
12
- self.__params = getattr(import_module("df." + self.__model), "ModelParams")()
13
 
14
  def __getattr__(self, attr: str):
15
  return getattr(self.__params, attr)
@@ -19,6 +19,6 @@ def init_model(*args, **kwargs):
19
  """Initialize the model specified in the config."""
20
  model = config("MODEL", default="deepfilternet", section="train")
21
  logger.info(f"Initializing model `{model}`")
22
- model = getattr(import_module("df." + model), "init_model")(*args, **kwargs)
23
  model.to(memory_format=torch.channels_last)
24
  return model
 
3
  import torch
4
  from loguru import logger
5
 
6
+ from df_local.config import DfParams, config
7
 
8
 
9
  class ModelParams(DfParams):
10
  def __init__(self):
11
  self.__model = config("MODEL", default="deepfilternet", section="train")
12
+ self.__params = getattr(import_module("df_local." + self.__model), "ModelParams")()
13
 
14
  def __getattr__(self, attr: str):
15
  return getattr(self.__params, attr)
 
19
  """Initialize the model specified in the config."""
20
  model = config("MODEL", default="deepfilternet", section="train")
21
  logger.info(f"Initializing model `{model}`")
22
+ model = getattr(import_module("df_local." + model), "init_model")(*args, **kwargs)
23
  model.to(memory_format=torch.channels_last)
24
  return model
{df β†’ df_local}/modules.py RENAMED
@@ -10,8 +10,8 @@ from torch.nn import init
10
  from torch.nn.parameter import Parameter
11
  from typing_extensions import Final
12
 
13
- from df.model import ModelParams
14
- from df.utils import as_complex, as_real, get_device, get_norm_alpha
15
  from libdf import unit_norm_init
16
 
17
 
@@ -875,7 +875,7 @@ def test_grouped_gru():
875
 
876
  def test_erb():
877
  import libdf
878
- from df.config import config
879
 
880
  config.use_defaults()
881
  p = ModelParams()
@@ -895,7 +895,7 @@ def test_erb():
895
 
896
 
897
  def test_unit_norm():
898
- from df.config import config
899
  from libdf import unit_norm
900
 
901
  config.use_defaults()
@@ -915,7 +915,7 @@ def test_unit_norm():
915
 
916
 
917
  def test_dfop():
918
- from df.config import config
919
 
920
  config.use_defaults()
921
  p = ModelParams()
 
10
  from torch.nn.parameter import Parameter
11
  from typing_extensions import Final
12
 
13
+ from df_local.model import ModelParams
14
+ from df_local.utils import as_complex, as_real, get_device, get_norm_alpha
15
  from libdf import unit_norm_init
16
 
17
 
 
875
 
876
  def test_erb():
877
  import libdf
878
+ from df_local.config import config
879
 
880
  config.use_defaults()
881
  p = ModelParams()
 
895
 
896
 
897
  def test_unit_norm():
898
+ from df_local.config import config
899
  from libdf import unit_norm
900
 
901
  config.use_defaults()
 
915
 
916
 
917
  def test_dfop():
918
+ from df_local.config import config
919
 
920
  config.use_defaults()
921
  p = ModelParams()
{df β†’ df_local}/multiframe.py RENAMED
File without changes
{df β†’ df_local}/utils.py RENAMED
@@ -14,8 +14,8 @@ from torch import Tensor
14
  from torch.autograd import Function
15
  from torch.types import Number
16
 
17
- from df.config import config
18
- from df.model import ModelParams
19
 
20
  try:
21
  from torchaudio.functional import resample as ta_resample
 
14
  from torch.autograd import Function
15
  from torch.types import Number
16
 
17
+ from df_local.config import config
18
+ from df_local.model import ModelParams
19
 
20
  try:
21
  from torchaudio.functional import resample as ta_resample
{libdf β†’ model_weights/libdf}/__init__.py RENAMED
File without changes
{libdf β†’ model_weights/libdf}/__init__.pyi RENAMED
File without changes
{libdf β†’ model_weights/libdf}/libdf.cpython-311-x86_64-linux-gnu.so RENAMED
File without changes
{libdf β†’ model_weights/libdf}/py.typed RENAMED
File without changes
requirements.txt CHANGED
@@ -20,6 +20,8 @@ ctranslate2==3.18.0
20
  cycler==0.11.0
21
  Cython==3.0.0
22
  decorator==5.1.1
 
 
23
  executing==1.2.0
24
  fastapi==0.101.1
25
  faster-whisper==0.7.1
 
20
  cycler==0.11.0
21
  Cython==3.0.0
22
  decorator==5.1.1
23
+ DeepFilterLib==0.2.4
24
+ deepfilternet==0.2.4
25
  executing==1.2.0
26
  fastapi==0.101.1
27
  faster-whisper==0.7.1