Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add an audio dependency(Asteroid) (#573)
Browse files Browse the repository at this point in the history
* Create datatype_audio.txt

* Update setup.py

* Update imports.py

* Update imports.py

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: thomas chaton <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 14, 2021
1 parent bd3ce7f commit adfa434
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ For help or questions, join our huge community on [Slack](https://join.slack.com
## Citations
We’re excited to continue the strong legacy of opensource software and have been inspired over the years by Caffee, Theano, Keras, PyTorch, torchbearer, and fast.ai. When/if a paper is written about this, we’ll be happy to cite these frameworks and the corresponding authors.

Flash leverages models from [torchvision](https://pytorch.org/vision/stable/index.html), [huggingface/transformers](https://huggingface.co/transformers/), [timm](https://github.com/rwightman/pytorch-image-models), and [pytorch-tabnet](https://dreamquark-ai.github.io/tabnet/) for the `vision`, `text`, and `tabular` tasks respectively. Also supports self-supervised backbones from [bolts](https://github.com/PyTorchLightning/lightning-bolts).
Flash leverages models from [torchvision](https://pytorch.org/vision/stable/index.html), [huggingface/transformers](https://huggingface.co/transformers/), [timm](https://github.com/rwightman/pytorch-image-models), [pytorch-tabnet](https://dreamquark-ai.github.io/tabnet/), and [asteroid](https://github.com/asteroid-team/asteroid) for the `vision`, `text`, `tabular`, and `audio` tasks respectively. Also supports self-supervised backbones from [bolts](https://github.com/PyTorchLightning/lightning-bolts).

## License
Please observe the Apache 2.0 license that is listed in this repository. In addition
Expand Down
5 changes: 5 additions & 0 deletions flash/core/utilities/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def _compare_version(package: str, op, version) -> bool:
_CYTOOLZ_AVAILABLE = _module_available("cytoolz")
_UVICORN_AVAILABLE = _module_available("uvicorn")
_PIL_AVAILABLE = _module_available("PIL")
_ASTEROID_AVAILABLE = _module_available("asteroid")
_SEGMENTATION_MODELS_AVAILABLE = _module_available("segmentation_models_pytorch")

if Version:
Expand All @@ -103,13 +104,17 @@ def _compare_version(package: str, op, version) -> bool:
_SEGMENTATION_MODELS_AVAILABLE,
])
_SERVE_AVAILABLE = _FASTAPI_AVAILABLE and _PYDANTIC_AVAILABLE and _CYTOOLZ_AVAILABLE and _UVICORN_AVAILABLE
_AUDIO_AVAILABLE = all([
_ASTEROID_AVAILABLE,
])

_EXTRAS_AVAILABLE = {
'image': _IMAGE_AVAILABLE,
'tabular': _TABULAR_AVAILABLE,
'text': _TEXT_AVAILABLE,
'video': _VIDEO_AVAILABLE,
'serve': _SERVE_AVAILABLE,
'audio': _AUDIO_AVAILABLE,
}


Expand Down
1 change: 1 addition & 0 deletions requirements/datatype_audio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
asteroid>=0.5.1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _load_py_module(fname, pkg="flash"):
"image": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="datatype_image.txt"),
"video": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="datatype_video.txt"),
"serve": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="serve.txt"),
"audio": setup_tools._load_requirements(path_dir=_PATH_REQUIRE, file_name="datatype_audio.txt"),
}

# remove possible duplicate.
Expand Down

0 comments on commit adfa434

Please sign in to comment.