JonnyRysler commited on
Commit
0f37292
1 Parent(s): d255325
Files changed (7) hide show
  1. .gitignore +62 -0
  2. MANIFEST.in +15 -0
  3. Makefile +40 -0
  4. mypy.ini +4 -0
  5. requirements.txt +23 -0
  6. setup.cfg +14 -0
  7. setup.py +62 -0
.gitignore ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # macOS dir files
10
+ .DS_Store
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ env/
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ *.egg-info/
28
+ .installed.cfg
29
+ *.egg
30
+ .ipynb_checkpoints
31
+
32
+ # Tests and linter
33
+ .pytest_cache/
34
+ .mypy_cache/
35
+ .coverage
36
+
37
+ # docs
38
+ /api_docs
39
+
40
+ # dotenv
41
+ .env
42
+ .envrc
43
+
44
+ # virtualenv
45
+ .venv
46
+ venv/
47
+ ENV/
48
+
49
+ # egs with manifest files
50
+ egs/*
51
+ !egs/example
52
+ # local datasets
53
+ dataset/*
54
+ !dataset/example
55
+
56
+ # personal notebooks & scripts
57
+ */local_scripts
58
+ */notes
59
+ .vscode/
60
+ /notebooks
61
+ /local_scripts
62
+ /notes
MANIFEST.in ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ include Makefile
2
+ include LICENSE
3
+ include LICENSE_weights
4
+ include *.md
5
+ include *.ini
6
+ include requirements.txt
7
+ include audiocraft/py.typed
8
+ include assets/*.mp3
9
+ include datasets/*.mp3
10
+ recursive-include config *.yaml
11
+ recursive-include demos *.py
12
+ recursive-include demos *.ipynb
13
+ recursive-include scripts *.py
14
+ recursive-include model_cards *.md
15
+ recursive-include docs *.md
Makefile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ INTEG=AUDIOCRAFT_DORA_DIR="/tmp/magma_$(USER)" python3 -m dora -v run --clear device=cpu dataset.num_workers=0 optim.epochs=1 \
2
+ dataset.train.num_samples=10 dataset.valid.num_samples=10 \
3
+ dataset.evaluate.num_samples=10 dataset.generate.num_samples=2 sample_rate=16000 \
4
+ logging.level=DEBUG
5
+ INTEG_COMPRESSION = $(INTEG) solver=compression/debug rvq.n_q=2 rvq.bins=48 checkpoint.save_last=true # SIG is 5091833e
6
+ INTEG_MUSICGEN = $(INTEG) solver=musicgen/debug dset=audio/example compression_model_checkpoint=//sig/5091833e \
7
+ transformer_lm.n_q=2 transformer_lm.card=48 transformer_lm.dim=16 checkpoint.save_last=false # Using compression model from 5091833e
8
+ INTEG_AUDIOGEN = $(INTEG) solver=audiogen/debug dset=audio/example compression_model_checkpoint=//sig/5091833e \
9
+ transformer_lm.n_q=2 transformer_lm.card=48 transformer_lm.dim=16 checkpoint.save_last=false # Using compression model from 5091833e
10
+ INTEG_MBD = $(INTEG) solver=diffusion/debug dset=audio/example \
11
+ checkpoint.save_last=false # Using compression model from 616d7b3c
12
+
13
+ default: linter tests
14
+
15
+ install:
16
+ pip install -U pip
17
+ pip install -U -e '.[dev]'
18
+
19
+ linter:
20
+ flake8 audiocraft && mypy audiocraft
21
+ flake8 tests && mypy tests
22
+
23
+ tests:
24
+ coverage run -m pytest tests
25
+ coverage report
26
+
27
+ tests_integ:
28
+ $(INTEG_COMPRESSION)
29
+ $(INTEG_MBD)
30
+ $(INTEG_MUSICGEN)
31
+ $(INTEG_AUDIOGEN)
32
+
33
+
34
+ api_docs:
35
+ pdoc3 --html -o api_docs -f audiocraft
36
+
37
+ dist:
38
+ python setup.py sdist
39
+
40
+ .PHONY: linter tests api_docs dist
mypy.ini ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [mypy]
2
+
3
+ [mypy-treetable,torchaudio.*,soundfile,einops.*,av.*,tqdm.*,num2words.*,spacy,xformers.*,scipy,huggingface_hub,transformers,dac.*]
4
+ ignore_missing_imports = True
requirements.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # please make sure you have already a pytorch install that is cuda enabled!
2
+ av
3
+ einops
4
+ flashy>=0.0.1
5
+ hydra-core>=1.1
6
+ hydra_colorlog
7
+ julius
8
+ num2words
9
+ numpy
10
+ sentencepiece
11
+ spacy>=3.6.1
12
+ torch==2.1.0
13
+ torchaudio>=2.0.0
14
+ huggingface_hub
15
+ tqdm
16
+ transformers>=4.31.0 # need Encodec there.
17
+ xformers
18
+ demucs
19
+ librosa
20
+ gradio
21
+ torchmetrics
22
+ encodec
23
+ protobuf
setup.cfg ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [pep8]
2
+ max-line-length = 120
3
+
4
+ [flake8]
5
+ max-line-length = 120
6
+
7
+ [coverage:report]
8
+ include = audiocraft/*
9
+ omit =
10
+ audiocraft/environment.py
11
+ audiocraft/solvers/*
12
+ audiocraft/utils/*
13
+ audiocraft/*/loaders.py
14
+ audiocraft/*/builders.py
setup.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+ #
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ from pathlib import Path
8
+
9
+ from setuptools import setup, find_packages
10
+
11
+
12
+ NAME = 'audiocraft'
13
+ DESCRIPTION = 'Audio generation research library for PyTorch'
14
+
15
+ URL = 'https://github.com/facebookresearch/audiocraft'
16
+ AUTHOR = 'FAIR Speech & Audio'
17
+ EMAIL = 'defossez@meta.com, jadecopet@meta.com'
18
+ REQUIRES_PYTHON = '>=3.8.0'
19
+
20
+ for line in open('audiocraft/__init__.py'):
21
+ line = line.strip()
22
+ if '__version__' in line:
23
+ context = {}
24
+ exec(line, context)
25
+ VERSION = context['__version__']
26
+
27
+ HERE = Path(__file__).parent
28
+
29
+ try:
30
+ with open(HERE / "README.md", encoding='utf-8') as f:
31
+ long_description = '\n' + f.read()
32
+ except FileNotFoundError:
33
+ long_description = DESCRIPTION
34
+
35
+ REQUIRED = [i.strip() for i in open(HERE / 'requirements.txt') if not i.startswith('#')]
36
+
37
+ setup(
38
+ name=NAME,
39
+ version=VERSION,
40
+ description=DESCRIPTION,
41
+ author_email=EMAIL,
42
+ long_description=long_description,
43
+ long_description_content_type='text/markdown',
44
+ author=AUTHOR,
45
+ url=URL,
46
+ python_requires=REQUIRES_PYTHON,
47
+ install_requires=REQUIRED,
48
+ extras_require={
49
+ 'dev': ['coverage', 'flake8', 'mypy', 'pdoc3', 'pytest'],
50
+ },
51
+ packages=find_packages(),
52
+ package_data={'audiocraft': ['py.typed']},
53
+ include_package_data=True,
54
+ license='MIT License',
55
+ classifiers=[
56
+ # Trove classifiers
57
+ # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
58
+ 'License :: OSI Approved :: MIT License',
59
+ 'Topic :: Multimedia :: Sound/Audio',
60
+ 'Topic :: Scientific/Engineering :: Artificial Intelligence',
61
+ ],
62
+ )