Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,20 +9,20 @@ description = """
|
|
| 9 |
A demo of conformer-based speaker recognition. Paper: https://arxiv.org/abs/2104.02125
|
| 10 |
"""
|
| 11 |
|
| 12 |
-
repo_id = "tflite-hub/conformer-
|
| 13 |
model_path = "models"
|
| 14 |
-
hf_hub_download(repo_id=repo_id, filename="
|
| 15 |
-
hf_hub_download(repo_id=repo_id, filename="
|
| 16 |
-
hf_hub_download(repo_id=repo_id, filename="
|
| 17 |
|
| 18 |
-
runner =
|
| 19 |
-
vad_model_file=os.path.join(model_path, "
|
| 20 |
-
vad_mean_stddev_file=os.path.join(model_path, "
|
| 21 |
-
|
| 22 |
|
| 23 |
def predict(enroll_audio, test_audio):
|
| 24 |
-
|
| 25 |
-
return "
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
| 28 |
demo = gr.Interface(
|
|
|
|
| 9 |
A demo of conformer-based speaker recognition. Paper: https://arxiv.org/abs/2104.02125
|
| 10 |
"""
|
| 11 |
|
| 12 |
+
repo_id = "tflite-hub/conformer-speaker-encoder"
|
| 13 |
model_path = "models"
|
| 14 |
+
hf_hub_download(repo_id=repo_id, filename="vad_long_model.tflite", local_dir=model_path)
|
| 15 |
+
hf_hub_download(repo_id=repo_id, filename="vad_long_mean_stddev.csv", local_dir=model_path)
|
| 16 |
+
hf_hub_download(repo_id=repo_id, filename="conformer_tisid_medium..tflite", local_dir=model_path)
|
| 17 |
|
| 18 |
+
runner = wav_to_dvector.WavToDvectorRunner(
|
| 19 |
+
vad_model_file=os.path.join(model_path, "vad_long_model.tflite"),
|
| 20 |
+
vad_mean_stddev_file=os.path.join(model_path, "vad_long_mean_stddev.csv"),
|
| 21 |
+
tisid_model_file=os.path.join(model_path, "conformer_tisid_medium.tflite"))
|
| 22 |
|
| 23 |
def predict(enroll_audio, test_audio):
|
| 24 |
+
score = runner.compute_score([enroll_audio], test_audio)
|
| 25 |
+
return "Speaker similarity score: " + score
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
| 28 |
demo = gr.Interface(
|