none commited on
Commit
0389089
·
1 Parent(s): 3f053af
app.py CHANGED
@@ -5,7 +5,6 @@ import tempfile
5
  import gradio as gr
6
  import librosa
7
  import soundfile
8
- import tomli
9
  import torch
10
  import torch.nn.functional as F
11
  import torchaudio
 
5
  import gradio as gr
6
  import librosa
7
  import soundfile
 
8
  import torch
9
  import torch.nn.functional as F
10
  import torchaudio
src/moviedubber/infer_with_mmlm_result.py CHANGED
@@ -71,7 +71,9 @@ def load_models(device):
71
 
72
  vocoder = load_vocoder(local_path="nvidia/bigvgan_v2_24khz_100band_256x", device=device)
73
 
74
- model_path = hf_hub_download(repo_id="woak-oa/DeepDubber-V1")
 
 
75
 
76
  model_cls = DiT
77
  model_cfg = OmegaConf.load(model_cfg).model.arch
@@ -80,9 +82,9 @@ def load_models(device):
80
  ema_model = load_model(
81
  model_cls,
82
  model_cfg,
83
- ckpt_path=f"{model_path}/mmdubber.pt",
84
  mel_spec_type=vocoder_name,
85
- vocab_file=f"{model_path}/vocab.txt",
86
  controlnet=controlnet,
87
  device=device,
88
  )
@@ -92,7 +94,7 @@ def load_models(device):
92
  option.intra_op_num_threads = 1
93
  providers = ["CPUExecutionProvider"]
94
  ort_session = onnxruntime.InferenceSession(
95
- f"{model_path}/campplus.onnx",
96
  sess_options=option,
97
  providers=providers,
98
  )
 
71
 
72
  vocoder = load_vocoder(local_path="nvidia/bigvgan_v2_24khz_100band_256x", device=device)
73
 
74
+ ckpt_path = hf_hub_download(repo_id="woak-oa/DeepDubber-V1", filename="mmdubber.pt")
75
+ vocab_file = hf_hub_download(repo_id="woak-oa/DeepDubber-V1", filename="vocab.txt")
76
+ campplus_path = hf_hub_download(repo_id="woak-oa/DeepDubber-V1", filename="campplus.onnx")
77
 
78
  model_cls = DiT
79
  model_cfg = OmegaConf.load(model_cfg).model.arch
 
82
  ema_model = load_model(
83
  model_cls,
84
  model_cfg,
85
+ ckpt_path=ckpt_path,
86
  mel_spec_type=vocoder_name,
87
+ vocab_file=vocab_file,
88
  controlnet=controlnet,
89
  device=device,
90
  )
 
94
  option.intra_op_num_threads = 1
95
  providers = ["CPUExecutionProvider"]
96
  ort_session = onnxruntime.InferenceSession(
97
+ campplus_path,
98
  sess_options=option,
99
  providers=providers,
100
  )