sssssungk commited on
Commit
8d72588
ยท
verified ยท
1 Parent(s): 9f8665b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -45,9 +45,7 @@ def seprate_speaker(audio_file, pipeline):
45
  audio = Audio()
46
  waveform, sample_rate = torchaudio.load(audio_file)
47
  diarization = pipeline(audio_file)
48
- # ํด๋”๊ฐ€ ์กด์žฌํ•˜๋ฉด ์‚ญ์ œ
49
- if os.path.exists("/tmp/wav" ):
50
- shutil.rmtree("/tmp/wav" ) # ํด๋” ๋ฐ ๋‚ด๋ถ€ ํŒŒ์ผ ์‚ญ์ œ
51
 
52
  # ํ™”์ž๋ณ„๋กœ ๋ฐœํ™” ๊ตฌ๊ฐ„์„ ์ €์žฅํ•  ๋”•์…”๋„ˆ๋ฆฌ ์ดˆ๊ธฐํ™”
53
  speaker_segments = {}
@@ -141,6 +139,10 @@ def real_fake_check(list_dir, path, model):
141
 
142
 
143
  def main(file_name):
 
 
 
 
144
  hf_token = os.getenv("HUGGINGFACE_TOKEN")
145
  pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1",use_auth_token=hf_token)
146
  #device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')
 
45
  audio = Audio()
46
  waveform, sample_rate = torchaudio.load(audio_file)
47
  diarization = pipeline(audio_file)
48
+
 
 
49
 
50
  # ํ™”์ž๋ณ„๋กœ ๋ฐœํ™” ๊ตฌ๊ฐ„์„ ์ €์žฅํ•  ๋”•์…”๋„ˆ๋ฆฌ ์ดˆ๊ธฐํ™”
51
  speaker_segments = {}
 
139
 
140
 
141
  def main(file_name):
142
+ # ํด๋”๊ฐ€ ์กด์žฌํ•˜๋ฉด ์‚ญ์ œ
143
+ if os.path.exists("/tmp/wav" ):
144
+ shutil.rmtree("/tmp/wav" ) # ํด๋” ๋ฐ ๋‚ด๋ถ€ ํŒŒ์ผ ์‚ญ์ œ
145
+
146
  hf_token = os.getenv("HUGGINGFACE_TOKEN")
147
  pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1",use_auth_token=hf_token)
148
  #device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')