tomxxie commited on
Commit
df9fbc1
·
1 Parent(s): 74be1c1

适配zeroGPU

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -58,9 +58,11 @@ def init_model_my():
58
  logging.basicConfig(level=logging.DEBUG,
59
  format='%(asctime)s %(levelname)s %(message)s')
60
  config_path = "train.yaml"
61
- checkpoint_path = "step_32499.pt"
 
 
62
  args = SimpleNamespace(**{
63
- "checkpoint": checkpoint_path,
64
  })
65
  configs = load_dict_from_yaml(config_path)
66
  model, configs = init_model(args, configs)
@@ -69,7 +71,7 @@ def init_model_my():
69
  print(model)
70
  return model, tokenizer
71
 
72
- # model, tokenizer = init_model_my()
73
  print("model init success")
74
  def do_resample(input_wav_path, output_wav_path):
75
  """"""
 
58
  logging.basicConfig(level=logging.DEBUG,
59
  format='%(asctime)s %(levelname)s %(message)s')
60
  config_path = "train.yaml"
61
+ from huggingface_hub import hf_hub_download
62
+ # 从Hugging Face下载.pt文件
63
+ pt_file_path = hf_hub_download(repo_id="ASLP-lab/OSUM", filename="infer.pt")
64
  args = SimpleNamespace(**{
65
+ "checkpoint": pt_file_path,
66
  })
67
  configs = load_dict_from_yaml(config_path)
68
  model, configs = init_model(args, configs)
 
71
  print(model)
72
  return model, tokenizer
73
 
74
+ model, tokenizer = init_model_my()
75
  print("model init success")
76
  def do_resample(input_wav_path, output_wav_path):
77
  """"""