From e28c130ecef5081a07392dbff16f7996536e7c7a Mon Sep 17 00:00:00 2001 From: Fabio Catania Date: Mon, 30 Dec 2024 20:53:39 +0100 Subject: [PATCH 1/5] Update model.py --- src/senselab/utils/data_structures/model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/senselab/utils/data_structures/model.py b/src/senselab/utils/data_structures/model.py index 2111b03f..000af2a2 100644 --- a/src/senselab/utils/data_structures/model.py +++ b/src/senselab/utils/data_structures/model.py @@ -153,7 +153,10 @@ def check_hf_repo_exists(repo_id: str, revision: str = "main", repo_type: str = """Private function to check if a Hugging Face repository exists.""" api = HfApi() try: - api.list_repo_commits(repo_id=repo_id, revision=revision, repo_type=repo_type) + if repo_type == "model": + api.model_info(repo_id=repo_id, revision=revision) + else: + api.list_repo_commits(repo_id=repo_id, revision=revision, repo_type=repo_type) return True except Exception: # raise RuntimeError(f"An error occurred: {e}") From 315579b214d9a90e98638c2b15e1dae8a6575dcc Mon Sep 17 00:00:00 2001 From: Fabio Catania Date: Mon, 30 Dec 2024 21:05:40 +0100 Subject: [PATCH 2/5] Update model_test.py --- src/tests/utils/data_structures/model_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/utils/data_structures/model_test.py b/src/tests/utils/data_structures/model_test.py index 5ee14b6e..d240cc2c 100644 --- a/src/tests/utils/data_structures/model_test.py +++ b/src/tests/utils/data_structures/model_test.py @@ -9,7 +9,7 @@ def test_check_hf_repo_exists_true() -> None: """Test HF repo exists.""" - with patch("huggingface_hub.HfApi.list_repo_commits") as mock_list_repo_commits: + with patch("huggingface_hub.HfApi.model_info") as mock_list_repo_commits: mock_list_repo_commits.return_value = True assert check_hf_repo_exists("valid_repo") is True From dd2c18fa9bbf8f1b07bc3f52b751ae500441197e Mon Sep 17 00:00:00 2001 From: bot Date: Mon, 30 Dec 2024 20:32:28 +0000 Subject: [PATCH 3/5] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c34b8b36..a89d6b11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +# 0.26.1 (Mon Dec 30 2024) + +#### 🐛 Bug Fix + +- Update model.py [#228](https://github.com/sensein/senselab/pull/228) ([@fabiocat93](https://github.com/fabiocat93)) + +#### 📝 Documentation + +- Updating tutorial files [#210](https://github.com/sensein/senselab/pull/210) ([@900miles](https://github.com/900miles) [@fabiocat93](https://github.com/fabiocat93)) + +#### 🔩 Dependency Updates + +- Bump codecov/codecov-action from 4 to 5 [#211](https://github.com/sensein/senselab/pull/211) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@fabiocat93](https://github.com/fabiocat93)) + +#### Authors: 3 + +- [@900miles](https://github.com/900miles) +- [@dependabot[bot]](https://github.com/dependabot[bot]) +- Fabio Catania ([@fabiocat93](https://github.com/fabiocat93)) + +--- + # 0.26.0 (Mon Dec 23 2024) #### 🚀 Enhancement From fb08f5c0a896e86b5d59eb5b27b7492e63618f6f Mon Sep 17 00:00:00 2001 From: fabiocat93 Date: Wed, 15 Jan 2025 12:16:35 -0500 Subject: [PATCH 4/5] fixing broken colab link --- tutorials/audio/speaker_verification.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/audio/speaker_verification.ipynb b/tutorials/audio/speaker_verification.ipynb index 409340df..bb588ee4 100644 --- a/tutorials/audio/speaker_verification.ipynb +++ b/tutorials/audio/speaker_verification.ipynb @@ -6,7 +6,7 @@ "source": [ "# Speaker Verification\n", "\n", - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sensein/senselab/blob/main/tutorials/audio/speaker_diarization.ipynb)\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sensein/senselab/blob/main/tutorials/audio/speaker_verification.ipynb)\n", "\n", "Speaker Verification is a process in which an audio system determines whether a given set of speech samples are from the same speaker. This technology is widely used in various applications such as security systems, authentication processes, and personalized user experiences. The core concept revolves around comparing voice characteristics extracted from speech samples to verify the identity of the speaker.\n", "\n", From c185232b9b9ee24b0934b8de6c4b0f2d18705850 Mon Sep 17 00:00:00 2001 From: fabiocat93 Date: Wed, 15 Jan 2025 12:25:20 -0500 Subject: [PATCH 5/5] fixing import in the speaker emebeddings tutorial --- tutorials/audio/extract_speaker_embeddings.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/audio/extract_speaker_embeddings.ipynb b/tutorials/audio/extract_speaker_embeddings.ipynb index f0c47a85..5b7b4e92 100644 --- a/tutorials/audio/extract_speaker_embeddings.ipynb +++ b/tutorials/audio/extract_speaker_embeddings.ipynb @@ -112,7 +112,7 @@ "metadata": {}, "outputs": [], "source": [ - "from senselab.utils.tasks.cosine_similarity import cosine_similarity\n", + "from senselab.utils.tasks.cosine_similarity import compute_cosine_similarity\n", "\n", "\n", "# DIRECTLY PLOT THE EMBEDDINGS FOR THE TWO FILES\n", @@ -142,7 +142,7 @@ " \n", " for i in range(n):\n", " for j in range(n):\n", - " similarity_matrix[i, j] = cosine_similarity(embeddings[i], embeddings[j])\n", + " similarity_matrix[i, j] = compute_cosine_similarity(embeddings[i], embeddings[j])\n", " \n", " fig, ax = plt.subplots(figsize=(8, 6))\n", " im = ax.imshow(similarity_matrix, cmap='coolwarm', vmin=-1, vmax=1)\n", @@ -187,7 +187,7 @@ ], "metadata": { "kernelspec": { - "display_name": "senselab", + "display_name": "senselab-KP8v1V64-py3.10", "language": "python", "name": "python3" }, @@ -201,7 +201,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.0" + "version": "3.10.10" } }, "nbformat": 4,