jadechoghari commited on
Commit
15b879a
·
verified ·
1 Parent(s): e3cbaf9

Update modeling.py

Browse files
Files changed (1) hide show
  1. modeling.py +4 -1
modeling.py CHANGED
@@ -10,6 +10,7 @@ import argparse
10
  from model import OptimizedAudioRestorationModel
11
  import librosa
12
  from inference_long import apply_overlap_windowing_waveform, reconstruct_waveform_from_windows
 
13
 
14
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
15
 
@@ -27,9 +28,11 @@ class VoiceRestoreConfig(PretrainedConfig):
27
  # Model class for VoiceRestore
28
  class VoiceRestore(PreTrainedModel):
29
  config_class = VoiceRestoreConfig
30
-
31
  def __init__(self, config: VoiceRestoreConfig):
32
  super().__init__(config)
 
 
33
  self.steps = config.steps
34
  self.cfg_strength = config.cfg_strength
35
  self.window_size_sec = config.window_size_sec
 
10
  from model import OptimizedAudioRestorationModel
11
  import librosa
12
  from inference_long import apply_overlap_windowing_waveform, reconstruct_waveform_from_windows
13
+ from huggingface_hub import snapshot_download
14
 
15
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
16
 
 
28
  # Model class for VoiceRestore
29
  class VoiceRestore(PreTrainedModel):
30
  config_class = VoiceRestoreConfig
31
+
32
  def __init__(self, config: VoiceRestoreConfig):
33
  super().__init__(config)
34
+ # download repo
35
+ snapshot_download(repo_id="jadechoghari/VoiceRestore", repo_type="model")
36
  self.steps = config.steps
37
  self.cfg_strength = config.cfg_strength
38
  self.window_size_sec = config.window_size_sec