Skip to content

Commit

Permalink
Merge pull request #16 from sanchit-gandhi/v0.2.1-release
Browse files Browse the repository at this point in the history
Release: v0.2.1
  • Loading branch information
sanchit-gandhi authored Jan 27, 2023
2 parents c757285 + 890490c commit 79eb397
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Installation

**With `pip`** (official package)
With `pip` (official package)

```bash
pip install speechbox
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def run(self):

setup(
name="speechbox",
version="0.2.0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
version="0.2.1", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
description="Speechbox",
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/speechbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# to defer the actual importing for when the objects are requested. This way `import transformers` provides the names
# in the namespace without actually importing anything (and especially none of the backends).

__version__ = "0.2.0"
__version__ = "0.2.1"

from .utils import (is_accelerate_available, is_pyannote_available,
is_scipy_available, is_torchaudio_available,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@


class ASRDiarizationPipeline(metaclass=DummyObject):
_backends = ["transformers", "torchaudio", "pyannote"]
_backends = ["transformers", "torchaudio", "pyannote.audio"]

This comment has been minimized.

Copy link
@sanchit-gandhi

sanchit-gandhi Jan 30, 2023

Author Collaborator

Running make fix-copies automatically creates this dummy file based on the required imports, but the string logic in utils/check_dummies.py means that pyannote.audio is truncated to pyannote - we have to account for this edge case!

cc @patrickvonplaten


def __init__(self, *args, **kwargs):
requires_backends(self, ["transformers", "torchaudio", "pyannote"])
requires_backends(self, ["transformers", "torchaudio", "pyannote.audio"])

@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["transformers", "torchaudio", "pyannote"])
requires_backends(cls, ["transformers", "torchaudio", "pyannote.audio"])

@classmethod
def from_pretrained(cls, *args, **kwargs):
requires_backends(cls, ["transformers", "torchaudio", "pyannote"])
requires_backends(cls, ["transformers", "torchaudio", "pyannote.audio"])
2 changes: 1 addition & 1 deletion src/speechbox/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
_torchaudio_available = importlib.util.find_spec("torchaudio") is not None
try:
_ = importlib_metadata.version("torchaudio")
_torchaudio_metadata = importlib_metadata.metadata("orchaudio")
_torchaudio_metadata = importlib_metadata.metadata("torchaudio")
except importlib_metadata.PackageNotFoundError:
_torchaudio_available = False

Expand Down
1 change: 1 addition & 0 deletions utils/check_dummies.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def create_dummy_files(backend_specific_objects=None):

for backend, objects in backend_specific_objects.items():
backend_name = "[" + ", ".join(f'"{b}"' for b in backend.split("_and_")) + "]"
backend_name = backend_name.replace("pyannote", "pyannote.audio")
dummy_file = "# This file is autogenerated by the command `make fix-copies`, do not edit.\n"
dummy_file += "# flake8: noqa\n\n"
dummy_file += "from ..utils import DummyObject, requires_backends\n\n"
Expand Down

0 comments on commit 79eb397

Please sign in to comment.