gpt-omni commited on
Commit
9b186d7
·
1 Parent(s): eb83dcd
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -67,6 +67,11 @@ _answer_a = audio_vocabsize + 3
67
  _split = audio_vocabsize + 4
68
 
69
 
 
 
 
 
 
70
  if not os.path.exists(ckpt_dir):
71
  print(f"checkpoint directory {ckpt_dir} not found, downloading from huggingface")
72
  download_model(ckpt_dir)
@@ -88,11 +93,6 @@ model = model.to(device)
88
  model.eval()
89
 
90
 
91
- def download_model(ckpt_dir):
92
- repo_id = "gpt-omni/mini-omni"
93
- snapshot_download(repo_id, local_dir=ckpt_dir, revision="main")
94
-
95
-
96
  def get_input_ids_whisper_ATBatch(mel, leng, whispermodel, device):
97
  with torch.no_grad():
98
  mel = mel.unsqueeze(0).to(device)
 
67
  _split = audio_vocabsize + 4
68
 
69
 
70
+ def download_model(ckpt_dir):
71
+ repo_id = "gpt-omni/mini-omni"
72
+ snapshot_download(repo_id, local_dir=ckpt_dir, revision="main")
73
+
74
+
75
  if not os.path.exists(ckpt_dir):
76
  print(f"checkpoint directory {ckpt_dir} not found, downloading from huggingface")
77
  download_model(ckpt_dir)
 
93
  model.eval()
94
 
95
 
 
 
 
 
 
96
  def get_input_ids_whisper_ATBatch(mel, leng, whispermodel, device):
97
  with torch.no_grad():
98
  mel = mel.unsqueeze(0).to(device)