Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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')
|