Skip to content

Commit

Permalink
Merge branch 'main' into ser_tut
Browse files Browse the repository at this point in the history
  • Loading branch information
wilke0818 authored Jan 16, 2025
2 parents 672c434 + b71e80d commit b664a79
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/senselab/utils/data_structures/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion src/tests/utils/data_structures/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions tutorials/audio/extract_speaker_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -187,7 +187,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "senselab",
"display_name": "senselab-KP8v1V64-py3.10",
"language": "python",
"name": "python3"
},
Expand All @@ -201,7 +201,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.0"
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/audio/speaker_verification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b664a79

Please sign in to comment.