yuping322 commited on
Commit
d5d7f55
1 Parent(s): 9b7f39a

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .config/.last_opt_in_prompt.yaml +1 -0
  2. .config/.last_survey_prompt.yaml +1 -0
  3. .config/.last_update_check.json +1 -0
  4. .config/active_config +1 -0
  5. .config/config_sentinel +0 -0
  6. .config/configurations/config_default +6 -0
  7. .config/default_configs.db +0 -0
  8. .config/gce +1 -0
  9. .config/logs/2023.08.03/13.43.26.810905.log +596 -0
  10. .config/logs/2023.08.03/13.43.52.311313.log +5 -0
  11. .config/logs/2023.08.03/13.44.15.972512.log +169 -0
  12. .config/logs/2023.08.03/13.44.23.058287.log +5 -0
  13. .config/logs/2023.08.03/13.44.47.473323.log +8 -0
  14. .config/logs/2023.08.03/13.44.48.234496.log +8 -0
  15. .gitattributes +2 -0
  16. .github/workflows/update_space.yml +28 -0
  17. README.md +2 -8
  18. audiocraft/.github/actions/audiocraft_build/action.yml +29 -0
  19. audiocraft/.github/workflows/audiocraft_docs.yml +32 -0
  20. audiocraft/.github/workflows/audiocraft_linter.yml +17 -0
  21. audiocraft/.github/workflows/audiocraft_tests.yml +17 -0
  22. audiocraft/.gitignore +55 -0
  23. audiocraft/CHANGELOG.md +23 -0
  24. audiocraft/CODE_OF_CONDUCT.md +80 -0
  25. audiocraft/CONTRIBUTING.md +35 -0
  26. audiocraft/LICENSE +21 -0
  27. audiocraft/LICENSE_weights +157 -0
  28. audiocraft/MANIFEST.in +8 -0
  29. audiocraft/MODEL_CARD.md +81 -0
  30. audiocraft/Makefile +21 -0
  31. audiocraft/Qma6mgf0vpW1.mp4 +0 -0
  32. audiocraft/README.md +124 -0
  33. audiocraft/app.py +367 -0
  34. audiocraft/assets/bach.mp3 +0 -0
  35. audiocraft/assets/bolero_ravel.mp3 +0 -0
  36. audiocraft/audiocraft/__init__.py +10 -0
  37. audiocraft/audiocraft/__pycache__/__init__.cpython-310.pyc +0 -0
  38. audiocraft/audiocraft/data/__init__.py +8 -0
  39. audiocraft/audiocraft/data/__pycache__/__init__.cpython-310.pyc +0 -0
  40. audiocraft/audiocraft/data/__pycache__/audio.cpython-310.pyc +0 -0
  41. audiocraft/audiocraft/data/__pycache__/audio_dataset.cpython-310.pyc +0 -0
  42. audiocraft/audiocraft/data/__pycache__/audio_utils.cpython-310.pyc +0 -0
  43. audiocraft/audiocraft/data/__pycache__/zip.cpython-310.pyc +0 -0
  44. audiocraft/audiocraft/data/audio.py +215 -0
  45. audiocraft/audiocraft/data/audio_dataset.py +525 -0
  46. audiocraft/audiocraft/data/audio_utils.py +174 -0
  47. audiocraft/audiocraft/data/zip.py +74 -0
  48. audiocraft/audiocraft/models/__init__.py +10 -0
  49. audiocraft/audiocraft/models/__pycache__/__init__.cpython-310.pyc +0 -0
  50. audiocraft/audiocraft/models/__pycache__/builders.cpython-310.pyc +0 -0
.config/.last_opt_in_prompt.yaml ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
.config/.last_survey_prompt.yaml ADDED
@@ -0,0 +1 @@
 
 
1
+ last_prompt_time: 1691070255.294357
.config/.last_update_check.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"last_update_check_time": 1691070262.4995341, "last_update_check_revision": 20230728162818, "notifications": [], "last_nag_times": {}}
.config/active_config ADDED
@@ -0,0 +1 @@
 
 
1
+ default
.config/config_sentinel ADDED
File without changes
.config/configurations/config_default ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ [component_manager]
2
+ disable_update_check = true
3
+
4
+ [compute]
5
+ gce_metadata_read_timeout_sec = 0
6
+
.config/default_configs.db ADDED
Binary file (12.3 kB). View file
 
.config/gce ADDED
@@ -0,0 +1 @@
 
 
1
+ False
.config/logs/2023.08.03/13.43.26.810905.log ADDED
@@ -0,0 +1,596 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2023-08-03 13:43:26,817 DEBUG root Loaded Command Group: ['gcloud', 'components']
2
+ 2023-08-03 13:43:26,820 DEBUG root Loaded Command Group: ['gcloud', 'components', 'update']
3
+ 2023-08-03 13:43:26,823 DEBUG root Running [gcloud.components.update] with arguments: [--allow-no-backup: "True", --compile-python: "True", --quiet: "True", COMPONENT-IDS:7: "['core', 'gcloud-deps', 'bq', 'gcloud', 'gcloud-crc32c', 'gsutil', 'anthoscli']"]
4
+ 2023-08-03 13:43:26,824 INFO ___FILE_ONLY___ Beginning update. This process may take several minutes.
5
+
6
+ 2023-08-03 13:43:38,871 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
7
+ 2023-08-03 13:43:38,954 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components-2.json HTTP/1.1" 200 208274
8
+ 2023-08-03 13:43:38,968 INFO ___FILE_ONLY___
9
+
10
+ 2023-08-03 13:43:38,969 INFO ___FILE_ONLY___
11
+ Your current Google Cloud CLI version is: 441.0.0
12
+
13
+ 2023-08-03 13:43:38,969 INFO ___FILE_ONLY___ Installing components from version: 441.0.0
14
+
15
+ 2023-08-03 13:43:38,969 INFO ___FILE_ONLY___
16
+
17
+ 2023-08-03 13:43:38,969 DEBUG root Chosen display Format:table[box,title="These components will be removed."](details.display_name:label=Name:align=left,version.version_string:label=Version:align=right,data.size.size(zero="",min=1048576):label=Size:align=right)
18
+ 2023-08-03 13:43:38,970 DEBUG root Chosen display Format:table[box,title="These components will be updated."](details.display_name:label=Name:align=left,version.version_string:label=Version:align=right,data.size.size(zero="",min=1048576):label=Size:align=right)
19
+ 2023-08-03 13:43:38,970 DEBUG root Chosen display Format:table[box,title="These components will be installed."](details.display_name:label=Name:align=left,version.version_string:label=Version:align=right,data.size.size(zero="",min=1048576):label=Size:align=right)
20
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___ ┌─────────────────────────────────────────────────────────────────────────────┐
21
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___
22
+
23
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___ │ These components will be installed. │
24
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___
25
+
26
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___ ├─────────────────────────────────────────────────────┬────────────┬──────────┤
27
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___
28
+
29
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___ │ Name │ Version │ Size │
30
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___
31
+
32
+ 2023-08-03 13:43:38,977 INFO ___FILE_ONLY___ ├─────────────────────────────────────────────────────┼────────────┼──────────┤
33
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___
34
+
35
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ │
36
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ BigQuery Command Line Tool
37
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___
38
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ │
39
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ 2.0.95
40
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___
41
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ │
42
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ 1.6 MiB
43
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___
44
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ │
45
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___
46
+
47
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ │
48
+ 2023-08-03 13:43:38,978 INFO ___FILE_ONLY___ BigQuery Command Line Tool (Platform Specific)
49
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___
50
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ │
51
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ 2.0.77
52
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___
53
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ │
54
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ < 1 MiB
55
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___
56
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ │
57
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___
58
+
59
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ │
60
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ Bundled Python 3.9
61
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___
62
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ │
63
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ 3.9.16
64
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___
65
+ 2023-08-03 13:43:38,979 INFO ___FILE_ONLY___ │
66
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ 63.6 MiB
67
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___
68
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ │
69
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___
70
+
71
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ │
72
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ Cloud Storage Command Line Tool
73
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___
74
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ │
75
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ 5.25
76
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___
77
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ │
78
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ 11.3 MiB
79
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___
80
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ │
81
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___
82
+
83
+ 2023-08-03 13:43:38,980 INFO ___FILE_ONLY___ │
84
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ Cloud Storage Command Line Tool (Platform Specific)
85
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___
86
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ │
87
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ 5.13
88
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___
89
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ │
90
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ < 1 MiB
91
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___
92
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ │
93
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___
94
+
95
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ │
96
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ Google Cloud CLI Core Libraries (Platform Specific)
97
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___
98
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ │
99
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___ 2022.09.20
100
+ 2023-08-03 13:43:38,981 INFO ___FILE_ONLY___
101
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ │
102
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ < 1 MiB
103
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___
104
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ │
105
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___
106
+
107
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ │
108
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ Google Cloud CRC32C Hash Tool
109
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___
110
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ │
111
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ 1.0.0
112
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___
113
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ │
114
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ 1.2 MiB
115
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___
116
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___ │
117
+ 2023-08-03 13:43:38,982 INFO ___FILE_ONLY___
118
+
119
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ │
120
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ anthoscli
121
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___
122
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ │
123
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ 0.2.38
124
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___
125
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ │
126
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ 68.4 MiB
127
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___
128
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ │
129
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___
130
+
131
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ │
132
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ gcloud cli dependencies
133
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___
134
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ │
135
+ 2023-08-03 13:43:38,983 INFO ___FILE_ONLY___ 2021.04.16
136
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___
137
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___ │
138
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___ < 1 MiB
139
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___
140
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___ │
141
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___
142
+
143
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___ └─────────────────────────────────────────────────────┴────────────┴──────────┘
144
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___
145
+
146
+ 2023-08-03 13:43:38,984 INFO ___FILE_ONLY___
147
+
148
+ 2023-08-03 13:43:38,988 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
149
+ 2023-08-03 13:43:39,076 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/RELEASE_NOTES HTTP/1.1" 200 1050956
150
+ 2023-08-03 13:43:39,102 INFO ___FILE_ONLY___ For the latest full release notes, please visit:
151
+ https://cloud.google.com/sdk/release_notes
152
+
153
+
154
+ 2023-08-03 13:43:39,104 INFO ___FILE_ONLY___ ╔═════════════════════════════════════════���══════════════════╗
155
+
156
+ 2023-08-03 13:43:39,104 INFO ___FILE_ONLY___ ╠═ Creating update staging area ═╣
157
+
158
+ 2023-08-03 13:43:39,105 INFO ___FILE_ONLY___ ╚
159
+ 2023-08-03 13:43:39,105 INFO ___FILE_ONLY___ ══════
160
+ 2023-08-03 13:43:39,105 INFO ___FILE_ONLY___ ══════
161
+ 2023-08-03 13:43:39,105 INFO ___FILE_ONLY___ ══════
162
+ 2023-08-03 13:43:39,254 INFO ___FILE_ONLY___ ═
163
+ 2023-08-03 13:43:39,310 INFO ___FILE_ONLY___ ═
164
+ 2023-08-03 13:43:39,348 INFO ___FILE_ONLY___ ═
165
+ 2023-08-03 13:43:39,389 INFO ___FILE_ONLY___ ═
166
+ 2023-08-03 13:43:39,441 INFO ___FILE_ONLY___ ═
167
+ 2023-08-03 13:43:39,487 INFO ___FILE_ONLY___ ═
168
+ 2023-08-03 13:43:39,527 INFO ___FILE_ONLY___ ═
169
+ 2023-08-03 13:43:39,569 INFO ___FILE_ONLY___ ═
170
+ 2023-08-03 13:43:39,613 INFO ___FILE_ONLY___ ═
171
+ 2023-08-03 13:43:39,666 INFO ___FILE_ONLY___ ═
172
+ 2023-08-03 13:43:39,706 INFO ___FILE_ONLY___ ═
173
+ 2023-08-03 13:43:39,747 INFO ___FILE_ONLY___ ═
174
+ 2023-08-03 13:43:39,816 INFO ___FILE_ONLY___ ═
175
+ 2023-08-03 13:43:39,863 INFO ___FILE_ONLY___ ═
176
+ 2023-08-03 13:43:39,910 INFO ___FILE_ONLY___ ═
177
+ 2023-08-03 13:43:39,951 INFO ___FILE_ONLY___ ═
178
+ 2023-08-03 13:43:40,147 INFO ___FILE_ONLY___ ═
179
+ 2023-08-03 13:43:40,282 INFO ___FILE_ONLY___ ═
180
+ 2023-08-03 13:43:40,336 INFO ___FILE_ONLY___ ═
181
+ 2023-08-03 13:43:40,369 INFO ___FILE_ONLY___ ═
182
+ 2023-08-03 13:43:40,398 INFO ___FILE_ONLY___ ═
183
+ 2023-08-03 13:43:40,424 INFO ___FILE_ONLY___ ═
184
+ 2023-08-03 13:43:40,447 INFO ___FILE_ONLY___ ═
185
+ 2023-08-03 13:43:40,470 INFO ___FILE_ONLY___ ═
186
+ 2023-08-03 13:43:40,499 INFO ___FILE_ONLY___ ═
187
+ 2023-08-03 13:43:40,566 INFO ___FILE_ONLY___ ═
188
+ 2023-08-03 13:43:40,625 INFO ___FILE_ONLY___ ═
189
+ 2023-08-03 13:43:40,695 INFO ___FILE_ONLY___ ═
190
+ 2023-08-03 13:43:40,746 INFO ___FILE_ONLY___ ═
191
+ 2023-08-03 13:43:40,798 INFO ___FILE_ONLY___ ═
192
+ 2023-08-03 13:43:40,844 INFO ___FILE_ONLY___ ═
193
+ 2023-08-03 13:43:40,895 INFO ___FILE_ONLY___ ═
194
+ 2023-08-03 13:43:40,946 INFO ___FILE_ONLY___ ═
195
+ 2023-08-03 13:43:40,996 INFO ___FILE_ONLY___ ═
196
+ 2023-08-03 13:43:41,057 INFO ___FILE_ONLY___ ═
197
+ 2023-08-03 13:43:41,116 INFO ___FILE_ONLY___ ═
198
+ 2023-08-03 13:43:41,172 INFO ___FILE_ONLY___ ═
199
+ 2023-08-03 13:43:41,222 INFO ___FILE_ONLY___ ═
200
+ 2023-08-03 13:43:41,268 INFO ___FILE_ONLY___ ═
201
+ 2023-08-03 13:43:41,325 INFO ___FILE_ONLY___ ═
202
+ 2023-08-03 13:43:41,366 INFO ___FILE_ONLY___ ═
203
+ 2023-08-03 13:43:41,415 INFO ___FILE_ONLY___ ═
204
+ 2023-08-03 13:43:41,415 INFO ___FILE_ONLY___ ╝
205
+
206
+ 2023-08-03 13:43:41,574 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
207
+
208
+ 2023-08-03 13:43:41,574 INFO ___FILE_ONLY___ ╠═ Installing: BigQuery Command Line Tool ═╣
209
+
210
+ 2023-08-03 13:43:41,574 INFO ___FILE_ONLY___ ╚
211
+ 2023-08-03 13:43:41,578 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
212
+ 2023-08-03 13:43:41,662 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-bq-20230728162818.tar.gz HTTP/1.1" 200 1703996
213
+ 2023-08-03 13:43:41,673 INFO ___FILE_ONLY___ ═
214
+ 2023-08-03 13:43:41,673 INFO ___FILE_ONLY___ ═
215
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
216
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
217
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
218
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
219
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
220
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
221
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
222
+ 2023-08-03 13:43:41,674 INFO ___FILE_ONLY___ ═
223
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
224
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
225
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
226
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
227
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
228
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
229
+ 2023-08-03 13:43:41,675 INFO ___FILE_ONLY___ ═
230
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
231
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
232
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
233
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
234
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
235
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
236
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
237
+ 2023-08-03 13:43:41,676 INFO ___FILE_ONLY___ ═
238
+ 2023-08-03 13:43:41,677 INFO ___FILE_ONLY___ ═
239
+ 2023-08-03 13:43:41,677 INFO ___FILE_ONLY___ ═
240
+ 2023-08-03 13:43:41,677 INFO ___FILE_ONLY___ ═
241
+ 2023-08-03 13:43:41,677 INFO ___FILE_ONLY___ ═
242
+ 2023-08-03 13:43:41,677 INFO ___FILE_ONLY___ ═
243
+ 2023-08-03 13:43:41,795 INFO ___FILE_ONLY___ ═
244
+ 2023-08-03 13:43:41,799 INFO ___FILE_ONLY___ ═
245
+ 2023-08-03 13:43:41,803 INFO ___FILE_ONLY___ ═
246
+ 2023-08-03 13:43:41,807 INFO ___FILE_ONLY___ ═
247
+ 2023-08-03 13:43:41,810 INFO ___FILE_ONLY___ ═
248
+ 2023-08-03 13:43:41,814 INFO ___FILE_ONLY___ ═
249
+ 2023-08-03 13:43:41,819 INFO ___FILE_ONLY___ ═
250
+ 2023-08-03 13:43:41,823 INFO ___FILE_ONLY___ ═
251
+ 2023-08-03 13:43:41,827 INFO ___FILE_ONLY___ ═
252
+ 2023-08-03 13:43:41,830 INFO ___FILE_ONLY___ ═
253
+ 2023-08-03 13:43:41,834 INFO ___FILE_ONLY___ ═
254
+ 2023-08-03 13:43:41,837 INFO ___FILE_ONLY___ ═
255
+ 2023-08-03 13:43:41,843 INFO ___FILE_ONLY___ ═
256
+ 2023-08-03 13:43:41,846 INFO ___FILE_ONLY___ ═
257
+ 2023-08-03 13:43:41,850 INFO ___FILE_ONLY___ ═
258
+ 2023-08-03 13:43:41,854 INFO ___FILE_ONLY___ ═
259
+ 2023-08-03 13:43:41,858 INFO ___FILE_ONLY___ ═
260
+ 2023-08-03 13:43:41,862 INFO ___FILE_ONLY___ ═
261
+ 2023-08-03 13:43:41,867 INFO ___FILE_ONLY___ ═
262
+ 2023-08-03 13:43:41,872 INFO ___FILE_ONLY___ ═
263
+ 2023-08-03 13:43:41,875 INFO ___FILE_ONLY___ ═
264
+ 2023-08-03 13:43:41,882 INFO ___FILE_ONLY___ ═
265
+ 2023-08-03 13:43:41,888 INFO ___FILE_ONLY___ ═
266
+ 2023-08-03 13:43:41,892 INFO ___FILE_ONLY___ ═
267
+ 2023-08-03 13:43:41,895 INFO ___FILE_ONLY___ ═
268
+ 2023-08-03 13:43:41,900 INFO ___FILE_ONLY___ ═
269
+ 2023-08-03 13:43:41,903 INFO ___FILE_ONLY___ ═
270
+ 2023-08-03 13:43:41,907 INFO ___FILE_ONLY___ ═
271
+ 2023-08-03 13:43:41,911 INFO ___FILE_ONLY___ ═
272
+ 2023-08-03 13:43:41,914 INFO ___FILE_ONLY___ ═
273
+ 2023-08-03 13:43:41,914 INFO ___FILE_ONLY___ ╝
274
+
275
+ 2023-08-03 13:43:41,929 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
276
+
277
+ 2023-08-03 13:43:41,929 INFO ___FILE_ONLY___ ╠═ Installing: BigQuery Command Line Tool (Platform Spec... ═╣
278
+
279
+ 2023-08-03 13:43:41,929 INFO ___FILE_ONLY___ ╚
280
+ 2023-08-03 13:43:41,933 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
281
+ 2023-08-03 13:43:42,025 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-bq-nix-20220920185015.tar.gz HTTP/1.1" 200 1837
282
+ 2023-08-03 13:43:42,026 INFO ___FILE_ONLY___ ══════════════════════════════
283
+ 2023-08-03 13:43:42,027 INFO ___FILE_ONLY___ ══════════════════════════════
284
+ 2023-08-03 13:43:42,027 INFO ___FILE_ONLY___ ╝
285
+
286
+ 2023-08-03 13:43:42,035 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
287
+
288
+ 2023-08-03 13:43:42,035 INFO ___FILE_ONLY___ ╠═ Installing: Bundled Python 3.9 ═╣
289
+
290
+ 2023-08-03 13:43:42,035 INFO ___FILE_ONLY___ ╚
291
+ 2023-08-03 13:43:42,039 INFO ___FILE_ONLY___ ════════════════════════════════════════════════════════════
292
+ 2023-08-03 13:43:42,039 INFO ___FILE_ONLY___ ╝
293
+
294
+ 2023-08-03 13:43:42,041 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
295
+
296
+ 2023-08-03 13:43:42,041 INFO ___FILE_ONLY___ ╠═ Installing: Bundled Python 3.9 ═╣
297
+
298
+ 2023-08-03 13:43:42,042 INFO ___FILE_ONLY___ ╚
299
+ 2023-08-03 13:43:42,045 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
300
+ 2023-08-03 13:43:42,136 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-bundled-python3-unix-linux-x86_64-20230707144938.tar.gz HTTP/1.1" 200 66719069
301
+ 2023-08-03 13:43:42,983 INFO ___FILE_ONLY___ ═
302
+ 2023-08-03 13:43:42,986 INFO ___FILE_ONLY___ ═
303
+ 2023-08-03 13:43:42,988 INFO ___FILE_ONLY___ ═
304
+ 2023-08-03 13:43:42,991 INFO ___FILE_ONLY___ ═
305
+ 2023-08-03 13:43:42,993 INFO ___FILE_ONLY___ ═
306
+ 2023-08-03 13:43:42,996 INFO ___FILE_ONLY___ ═
307
+ 2023-08-03 13:43:42,999 INFO ___FILE_ONLY___ ═
308
+ 2023-08-03 13:43:43,001 INFO ___FILE_ONLY___ ═
309
+ 2023-08-03 13:43:43,004 INFO ___FILE_ONLY___ ═
310
+ 2023-08-03 13:43:43,006 INFO ___FILE_ONLY___ ═
311
+ 2023-08-03 13:43:43,008 INFO ___FILE_ONLY___ ═
312
+ 2023-08-03 13:43:43,011 INFO ___FILE_ONLY___ ═
313
+ 2023-08-03 13:43:43,013 INFO ___FILE_ONLY___ ═
314
+ 2023-08-03 13:43:43,015 INFO ___FILE_ONLY___ ═
315
+ 2023-08-03 13:43:43,018 INFO ___FILE_ONLY___ ═
316
+ 2023-08-03 13:43:43,020 INFO ___FILE_ONLY___ ═
317
+ 2023-08-03 13:43:43,023 INFO ___FILE_ONLY___ ═
318
+ 2023-08-03 13:43:43,025 INFO ___FILE_ONLY___ ═
319
+ 2023-08-03 13:43:43,027 INFO ___FILE_ONLY___ ═
320
+ 2023-08-03 13:43:43,030 INFO ___FILE_ONLY___ ═
321
+ 2023-08-03 13:43:43,032 INFO ___FILE_ONLY___ ═
322
+ 2023-08-03 13:43:43,034 INFO ___FILE_ONLY___ ═
323
+ 2023-08-03 13:43:43,037 INFO ___FILE_ONLY___ ═
324
+ 2023-08-03 13:43:43,039 INFO ___FILE_ONLY___ ═
325
+ 2023-08-03 13:43:43,041 INFO ___FILE_ONLY___ ═
326
+ 2023-08-03 13:43:43,044 INFO ___FILE_ONLY___ ═
327
+ 2023-08-03 13:43:43,046 INFO ___FILE_ONLY___ ═
328
+ 2023-08-03 13:43:43,048 INFO ___FILE_ONLY___ ═
329
+ 2023-08-03 13:43:43,051 INFO ___FILE_ONLY___ ═
330
+ 2023-08-03 13:43:43,053 INFO ___FILE_ONLY___ ═
331
+ 2023-08-03 13:43:44,944 INFO ___FILE_ONLY___ ═
332
+ 2023-08-03 13:43:44,956 INFO ___FILE_ONLY___ ═
333
+ 2023-08-03 13:43:44,970 INFO ___FILE_ONLY___ ═
334
+ 2023-08-03 13:43:44,983 INFO ___FILE_ONLY___ ═
335
+ 2023-08-03 13:43:44,996 INFO ___FILE_ONLY___ ═
336
+ 2023-08-03 13:43:45,013 INFO ___FILE_ONLY___ ═
337
+ 2023-08-03 13:43:45,030 INFO ___FILE_ONLY___ ═
338
+ 2023-08-03 13:43:45,050 INFO ___FILE_ONLY___ ═
339
+ 2023-08-03 13:43:45,067 INFO ___FILE_ONLY___ ═
340
+ 2023-08-03 13:43:45,080 INFO ___FILE_ONLY___ ═
341
+ 2023-08-03 13:43:45,098 INFO ___FILE_ONLY___ ═
342
+ 2023-08-03 13:43:45,118 INFO ___FILE_ONLY___ ═
343
+ 2023-08-03 13:43:45,132 INFO ___FILE_ONLY___ ═
344
+ 2023-08-03 13:43:45,253 INFO ___FILE_ONLY___ ═
345
+ 2023-08-03 13:43:45,267 INFO ___FILE_ONLY___ ═
346
+ 2023-08-03 13:43:45,360 INFO ___FILE_ONLY___ ═
347
+ 2023-08-03 13:43:45,382 INFO ___FILE_ONLY___ ═
348
+ 2023-08-03 13:43:45,402 INFO ___FILE_ONLY___ ═
349
+ 2023-08-03 13:43:45,420 INFO ___FILE_ONLY___ ═
350
+ 2023-08-03 13:43:45,455 INFO ___FILE_ONLY___ ═
351
+ 2023-08-03 13:43:45,469 INFO ___FILE_ONLY___ ═
352
+ 2023-08-03 13:43:45,482 INFO ___FILE_ONLY___ ═
353
+ 2023-08-03 13:43:45,497 INFO ___FILE_ONLY___ ═
354
+ 2023-08-03 13:43:45,514 INFO ___FILE_ONLY___ ═
355
+ 2023-08-03 13:43:45,532 INFO ___FILE_ONLY___ ═
356
+ 2023-08-03 13:43:45,550 INFO ___FILE_ONLY___ ═
357
+ 2023-08-03 13:43:46,165 INFO ___FILE_ONLY___ ═
358
+ 2023-08-03 13:43:46,459 INFO ___FILE_ONLY___ ═
359
+ 2023-08-03 13:43:46,470 INFO ___FILE_ONLY___ ═
360
+ 2023-08-03 13:43:46,481 INFO ___FILE_ONLY___ ═
361
+ 2023-08-03 13:43:46,481 INFO ___FILE_ONLY___ ╝
362
+
363
+ 2023-08-03 13:43:46,527 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
364
+
365
+ 2023-08-03 13:43:46,528 INFO ___FILE_ONLY___ ╠═ Installing: Cloud Storage Command Line Tool ═╣
366
+
367
+ 2023-08-03 13:43:46,528 INFO ___FILE_ONLY___ ╚
368
+ 2023-08-03 13:43:46,531 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
369
+ 2023-08-03 13:43:46,627 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gsutil-20230707144938.tar.gz HTTP/1.1" 200 11823782
370
+ 2023-08-03 13:43:46,720 INFO ___FILE_ONLY___ ═
371
+ 2023-08-03 13:43:46,721 INFO ___FILE_ONLY___ ═
372
+ 2023-08-03 13:43:46,721 INFO ___FILE_ONLY___ ═
373
+ 2023-08-03 13:43:46,722 INFO ___FILE_ONLY___ ═
374
+ 2023-08-03 13:43:46,722 INFO ___FILE_ONLY___ ═
375
+ 2023-08-03 13:43:46,723 INFO ___FILE_ONLY___ ═
376
+ 2023-08-03 13:43:46,723 INFO ___FILE_ONLY___ ═
377
+ 2023-08-03 13:43:46,724 INFO ___FILE_ONLY___ ═
378
+ 2023-08-03 13:43:46,724 INFO ___FILE_ONLY___ ═
379
+ 2023-08-03 13:43:46,725 INFO ___FILE_ONLY___ ═
380
+ 2023-08-03 13:43:46,725 INFO ___FILE_ONLY___ ═
381
+ 2023-08-03 13:43:46,726 INFO ___FILE_ONLY___ ═
382
+ 2023-08-03 13:43:46,726 INFO ___FILE_ONLY___ ═
383
+ 2023-08-03 13:43:46,727 INFO ___FILE_ONLY___ ═
384
+ 2023-08-03 13:43:46,727 INFO ___FILE_ONLY___ ═
385
+ 2023-08-03 13:43:46,728 INFO ___FILE_ONLY___ ═
386
+ 2023-08-03 13:43:46,728 INFO ___FILE_ONLY___ ═
387
+ 2023-08-03 13:43:46,729 INFO ___FILE_ONLY___ ═
388
+ 2023-08-03 13:43:46,729 INFO ___FILE_ONLY___ ═
389
+ 2023-08-03 13:43:46,730 INFO ___FILE_ONLY___ ═
390
+ 2023-08-03 13:43:46,730 INFO ___FILE_ONLY___ ═
391
+ 2023-08-03 13:43:46,731 INFO ___FILE_ONLY___ ═
392
+ 2023-08-03 13:43:46,731 INFO ___FILE_ONLY___ ═
393
+ 2023-08-03 13:43:46,732 INFO ___FILE_ONLY___ ═
394
+ 2023-08-03 13:43:46,732 INFO ___FILE_ONLY___ ═
395
+ 2023-08-03 13:43:46,733 INFO ___FILE_ONLY___ ═
396
+ 2023-08-03 13:43:46,733 INFO ___FILE_ONLY___ ═
397
+ 2023-08-03 13:43:46,734 INFO ___FILE_ONLY___ ═
398
+ 2023-08-03 13:43:46,734 INFO ___FILE_ONLY___ ═
399
+ 2023-08-03 13:43:46,735 INFO ___FILE_ONLY___ ═
400
+ 2023-08-03 13:43:47,411 INFO ___FILE_ONLY___ ═
401
+ 2023-08-03 13:43:47,439 INFO ___FILE_ONLY___ ═
402
+ 2023-08-03 13:43:47,463 INFO ___FILE_ONLY___ ═
403
+ 2023-08-03 13:43:47,490 INFO ___FILE_ONLY___ ═
404
+ 2023-08-03 13:43:47,508 INFO ___FILE_ONLY___ ═
405
+ 2023-08-03 13:43:47,527 INFO ___FILE_ONLY___ ═
406
+ 2023-08-03 13:43:47,547 INFO ___FILE_ONLY___ ═
407
+ 2023-08-03 13:43:47,569 INFO ___FILE_ONLY___ ═
408
+ 2023-08-03 13:43:47,592 INFO ___FILE_ONLY___ ═
409
+ 2023-08-03 13:43:47,628 INFO ___FILE_ONLY___ ═
410
+ 2023-08-03 13:43:47,658 INFO ___FILE_ONLY___ ═
411
+ 2023-08-03 13:43:47,682 INFO ___FILE_ONLY___ ═
412
+ 2023-08-03 13:43:47,718 INFO ___FILE_ONLY___ ═
413
+ 2023-08-03 13:43:47,749 INFO ___FILE_ONLY___ ═
414
+ 2023-08-03 13:43:47,778 INFO ___FILE_ONLY___ ═
415
+ 2023-08-03 13:43:47,800 INFO ___FILE_ONLY___ ═
416
+ 2023-08-03 13:43:47,818 INFO ___FILE_ONLY___ ═
417
+ 2023-08-03 13:43:47,839 INFO ___FILE_ONLY___ ═
418
+ 2023-08-03 13:43:47,862 INFO ___FILE_ONLY___ ═
419
+ 2023-08-03 13:43:47,888 INFO ___FILE_ONLY___ ═
420
+ 2023-08-03 13:43:47,916 INFO ___FILE_ONLY___ ═
421
+ 2023-08-03 13:43:47,941 INFO ___FILE_ONLY___ ═
422
+ 2023-08-03 13:43:47,964 INFO ___FILE_ONLY___ ═
423
+ 2023-08-03 13:43:48,010 INFO ___FILE_ONLY___ ═
424
+ 2023-08-03 13:43:48,035 INFO ___FILE_ONLY___ ═
425
+ 2023-08-03 13:43:48,062 INFO ___FILE_ONLY___ ═
426
+ 2023-08-03 13:43:48,080 INFO ___FILE_ONLY___ ═
427
+ 2023-08-03 13:43:48,099 INFO ___FILE_ONLY___ ═
428
+ 2023-08-03 13:43:48,121 INFO ___FILE_ONLY___ ═
429
+ 2023-08-03 13:43:48,142 INFO ___FILE_ONLY___ ═
430
+ 2023-08-03 13:43:48,142 INFO ___FILE_ONLY___ ╝
431
+
432
+ 2023-08-03 13:43:48,195 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
433
+
434
+ 2023-08-03 13:43:48,195 INFO ___FILE_ONLY___ ╠═ Installing: Cloud Storage Command Line Tool (Platform... ═╣
435
+
436
+ 2023-08-03 13:43:48,195 INFO ___FILE_ONLY___ ╚
437
+ 2023-08-03 13:43:48,199 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
438
+ 2023-08-03 13:43:48,285 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gsutil-nix-20220920185015.tar.gz HTTP/1.1" 200 1851
439
+ 2023-08-03 13:43:48,286 INFO ___FILE_ONLY___ ══════════════════════════════
440
+ 2023-08-03 13:43:48,287 INFO ___FILE_ONLY___ ══════════════════════════════
441
+ 2023-08-03 13:43:48,287 INFO ___FILE_ONLY___ ╝
442
+
443
+ 2023-08-03 13:43:48,295 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
444
+
445
+ 2023-08-03 13:43:48,295 INFO ___FILE_ONLY___ ╠═ Installing: Default set of gcloud commands ═╣
446
+
447
+ 2023-08-03 13:43:48,295 INFO ___FILE_ONLY___ ╚
448
+ 2023-08-03 13:43:48,299 INFO ___FILE_ONLY___ ════════════════════════════════════════════════════════════
449
+ 2023-08-03 13:43:48,299 INFO ___FILE_ONLY___ ╝
450
+
451
+ 2023-08-03 13:43:48,301 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
452
+
453
+ 2023-08-03 13:43:48,301 INFO ___FILE_ONLY___ ╠═ Installing: Google Cloud CLI Core Libraries (Platform... ═╣
454
+
455
+ 2023-08-03 13:43:48,301 INFO ___FILE_ONLY___ ╚
456
+ 2023-08-03 13:43:48,305 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
457
+ 2023-08-03 13:43:48,389 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-core-nix-20220920185015.tar.gz HTTP/1.1" 200 2221
458
+ 2023-08-03 13:43:48,389 INFO ___FILE_ONLY___ ══════════════════════════════
459
+ 2023-08-03 13:43:48,391 INFO ___FILE_ONLY___ ═══════════════
460
+ 2023-08-03 13:43:48,391 INFO ___FILE_ONLY___ ═══════════════
461
+ 2023-08-03 13:43:48,391 INFO ___FILE_ONLY___ ╝
462
+
463
+ 2023-08-03 13:43:48,430 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
464
+
465
+ 2023-08-03 13:43:48,430 INFO ___FILE_ONLY___ ╠═ Installing: Google Cloud CRC32C Hash Tool ═╣
466
+
467
+ 2023-08-03 13:43:48,430 INFO ___FILE_ONLY___ ╚
468
+ 2023-08-03 13:43:48,434 INFO ___FILE_ONLY___ ════════════════════════════════════════════════════════════
469
+ 2023-08-03 13:43:48,435 INFO ___FILE_ONLY___ ╝
470
+
471
+ 2023-08-03 13:43:48,436 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
472
+
473
+ 2023-08-03 13:43:48,437 INFO ___FILE_ONLY___ ╠═ Installing: Google Cloud CRC32C Hash Tool ═╣
474
+
475
+ 2023-08-03 13:43:48,437 INFO ___FILE_ONLY___ ╚
476
+ 2023-08-03 13:43:48,440 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
477
+ 2023-08-03 13:43:48,531 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gcloud-crc32c-linux-x86_64-20230728162818.tar.gz HTTP/1.1" 200 1272375
478
+ 2023-08-03 13:43:48,539 INFO ___FILE_ONLY___ ═
479
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
480
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
481
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
482
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
483
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
484
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
485
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
486
+ 2023-08-03 13:43:48,540 INFO ___FILE_ONLY___ ═
487
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
488
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
489
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
490
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
491
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
492
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
493
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
494
+ 2023-08-03 13:43:48,541 INFO ___FILE_ONLY___ ═
495
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
496
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
497
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
498
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
499
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
500
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
501
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
502
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
503
+ 2023-08-03 13:43:48,542 INFO ___FILE_ONLY___ ═
504
+ 2023-08-03 13:43:48,543 INFO ___FILE_ONLY___ ═
505
+ 2023-08-03 13:43:48,543 INFO ___FILE_ONLY___ ═
506
+ 2023-08-03 13:43:48,543 INFO ___FILE_ONLY___ ═
507
+ 2023-08-03 13:43:48,543 INFO ___FILE_ONLY___ ═
508
+ 2023-08-03 13:43:48,577 INFO ___FILE_ONLY___ ═══════════════
509
+ 2023-08-03 13:43:48,577 INFO ___FILE_ONLY___ ═══════════════
510
+ 2023-08-03 13:43:48,577 INFO ___FILE_ONLY___ ╝
511
+
512
+ 2023-08-03 13:43:48,586 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
513
+
514
+ 2023-08-03 13:43:48,586 INFO ___FILE_ONLY___ ╠═ Installing: anthoscli ═╣
515
+
516
+ 2023-08-03 13:43:48,586 INFO ___FILE_ONLY___ ╚
517
+ 2023-08-03 13:43:48,590 INFO ___FILE_ONLY___ ════════════════════════════════════════════════════════════
518
+ 2023-08-03 13:43:48,590 INFO ___FILE_ONLY___ ╝
519
+
520
+ 2023-08-03 13:43:48,592 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
521
+
522
+ 2023-08-03 13:43:48,592 INFO ___FILE_ONLY___ ╠═ Installing: anthoscli ═╣
523
+
524
+ 2023-08-03 13:43:48,592 INFO ___FILE_ONLY___ ╚
525
+ 2023-08-03 13:43:48,596 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
526
+ 2023-08-03 13:43:48,692 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-anthoscli-linux-x86_64-20230728162818.tar.gz HTTP/1.1" 200 71750856
527
+ 2023-08-03 13:43:49,319 INFO ___FILE_ONLY___ ═
528
+ 2023-08-03 13:43:49,321 INFO ___FILE_ONLY___ ═
529
+ 2023-08-03 13:43:49,324 INFO ___FILE_ONLY___ ═
530
+ 2023-08-03 13:43:49,327 INFO ___FILE_ONLY___ ═
531
+ 2023-08-03 13:43:49,329 INFO ___FILE_ONLY___ ═
532
+ 2023-08-03 13:43:49,332 INFO ___FILE_ONLY___ ═
533
+ 2023-08-03 13:43:49,334 INFO ___FILE_ONLY___ ═
534
+ 2023-08-03 13:43:49,337 INFO ___FILE_ONLY___ ═
535
+ 2023-08-03 13:43:49,339 INFO ___FILE_ONLY___ ═
536
+ 2023-08-03 13:43:49,342 INFO ___FILE_ONLY___ ═
537
+ 2023-08-03 13:43:49,345 INFO ___FILE_ONLY___ ═
538
+ 2023-08-03 13:43:49,347 INFO ___FILE_ONLY___ ═
539
+ 2023-08-03 13:43:49,350 INFO ___FILE_ONLY___ ═
540
+ 2023-08-03 13:43:49,352 INFO ___FILE_ONLY___ ═
541
+ 2023-08-03 13:43:49,355 INFO ___FILE_ONLY___ ═
542
+ 2023-08-03 13:43:49,357 INFO ___FILE_ONLY___ ═
543
+ 2023-08-03 13:43:49,360 INFO ___FILE_ONLY___ ═
544
+ 2023-08-03 13:43:49,362 INFO ___FILE_ONLY___ ═
545
+ 2023-08-03 13:43:49,365 INFO ___FILE_ONLY___ ═
546
+ 2023-08-03 13:43:49,368 INFO ___FILE_ONLY___ ═
547
+ 2023-08-03 13:43:49,370 INFO ___FILE_ONLY___ ═
548
+ 2023-08-03 13:43:49,373 INFO ___FILE_ONLY___ ═
549
+ 2023-08-03 13:43:49,375 INFO ___FILE_ONLY___ ═
550
+ 2023-08-03 13:43:49,378 INFO ___FILE_ONLY___ ═
551
+ 2023-08-03 13:43:49,380 INFO ___FILE_ONLY___ ═
552
+ 2023-08-03 13:43:49,383 INFO ___FILE_ONLY___ ═
553
+ 2023-08-03 13:43:49,385 INFO ___FILE_ONLY___ ═
554
+ 2023-08-03 13:43:49,389 INFO ___FILE_ONLY___ ═
555
+ 2023-08-03 13:43:49,393 INFO ___FILE_ONLY___ ═
556
+ 2023-08-03 13:43:49,396 INFO ___FILE_ONLY___ ═
557
+ 2023-08-03 13:43:51,598 INFO ___FILE_ONLY___ ══════════
558
+ 2023-08-03 13:43:51,603 INFO ___FILE_ONLY___ ═════════
559
+ 2023-08-03 13:43:51,629 INFO ___FILE_ONLY___ ═══════════
560
+ 2023-08-03 13:43:51,629 INFO ___FILE_ONLY___ ╝
561
+
562
+ 2023-08-03 13:43:51,649 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
563
+
564
+ 2023-08-03 13:43:51,649 INFO ___FILE_ONLY___ ╠═ Installing: gcloud cli dependencies ═╣
565
+
566
+ 2023-08-03 13:43:51,649 INFO ___FILE_ONLY___ ╚
567
+ 2023-08-03 13:43:51,653 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
568
+ 2023-08-03 13:43:51,738 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gcloud-deps-linux-x86_64-20210416153011.tar.gz HTTP/1.1" 200 104
569
+ 2023-08-03 13:43:51,739 INFO ___FILE_ONLY___ ══════════════════════════════
570
+ 2023-08-03 13:43:51,739 INFO ___FILE_ONLY___ ══════════════════════════════
571
+ 2023-08-03 13:43:51,739 INFO ___FILE_ONLY___ ╝
572
+
573
+ 2023-08-03 13:43:51,747 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
574
+
575
+ 2023-08-03 13:43:51,747 INFO ___FILE_ONLY___ ╠═ Creating backup and activating new installation ═╣
576
+
577
+ 2023-08-03 13:43:51,747 INFO ___FILE_ONLY___ ╚
578
+ 2023-08-03 13:43:51,748 DEBUG root Attempting to move directory [/tools/google-cloud-sdk] to [/tools/google-cloud-sdk.staging/.install/.backup]
579
+ 2023-08-03 13:43:51,748 INFO ___FILE_ONLY___ ══════════════════════════════
580
+ 2023-08-03 13:43:51,748 DEBUG root Attempting to move directory [/tools/google-cloud-sdk.staging] to [/tools/google-cloud-sdk]
581
+ 2023-08-03 13:43:51,748 INFO ___FILE_ONLY___ ══════════════════════════════
582
+ 2023-08-03 13:43:51,748 INFO ___FILE_ONLY___ ╝
583
+
584
+ 2023-08-03 13:43:51,751 DEBUG root Updating notification cache...
585
+ 2023-08-03 13:43:51,752 INFO ___FILE_ONLY___
586
+
587
+ 2023-08-03 13:43:51,754 INFO ___FILE_ONLY___ Performing post processing steps...
588
+ 2023-08-03 13:43:51,754 DEBUG root Executing command: ['python3', '-S', '/tools/google-cloud-sdk/lib/gcloud.py', 'components', 'post-process']
589
+ 2023-08-03 13:44:15,195 DEBUG ___FILE_ONLY___
590
+ 2023-08-03 13:44:15,195 DEBUG ___FILE_ONLY___
591
+ 2023-08-03 13:44:15,289 INFO ___FILE_ONLY___
592
+ Update done!
593
+
594
+
595
+ 2023-08-03 13:44:15,293 DEBUG root Chosen display Format:none
596
+ 2023-08-03 13:44:15,293 INFO root Display format: "none"
.config/logs/2023.08.03/13.43.52.311313.log ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 2023-08-03 13:43:52,312 DEBUG root Loaded Command Group: ['gcloud', 'components']
2
+ 2023-08-03 13:43:52,314 DEBUG root Loaded Command Group: ['gcloud', 'components', 'post_process']
3
+ 2023-08-03 13:43:52,316 DEBUG root Running [gcloud.components.post-process] with arguments: []
4
+ 2023-08-03 13:44:15,073 DEBUG root Chosen display Format:none
5
+ 2023-08-03 13:44:15,074 INFO root Display format: "none"
.config/logs/2023.08.03/13.44.15.972512.log ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2023-08-03 13:44:15,973 DEBUG root Loaded Command Group: ['gcloud', 'components']
2
+ 2023-08-03 13:44:15,976 DEBUG root Loaded Command Group: ['gcloud', 'components', 'update']
3
+ 2023-08-03 13:44:15,978 DEBUG root Running [gcloud.components.update] with arguments: [--quiet: "True", COMPONENT-IDS:8: "['gcloud', 'core', 'bq', 'gsutil', 'compute', 'preview', 'alpha', 'beta']"]
4
+ 2023-08-03 13:44:15,979 INFO ___FILE_ONLY___ Beginning update. This process may take several minutes.
5
+
6
+ 2023-08-03 13:44:15,984 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
7
+ 2023-08-03 13:44:16,068 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components-2.json HTTP/1.1" 200 208274
8
+ 2023-08-03 13:44:16,084 WARNING root Component [compute] no longer exists.
9
+ 2023-08-03 13:44:16,084 WARNING root Component [preview] no longer exists.
10
+ 2023-08-03 13:44:16,085 INFO ___FILE_ONLY___
11
+
12
+ 2023-08-03 13:44:16,085 INFO ___FILE_ONLY___
13
+ Your current Google Cloud CLI version is: 441.0.0
14
+
15
+ 2023-08-03 13:44:16,086 INFO ___FILE_ONLY___ Installing components from version: 441.0.0
16
+
17
+ 2023-08-03 13:44:16,086 INFO ___FILE_ONLY___
18
+
19
+ 2023-08-03 13:44:16,086 DEBUG root Chosen display Format:table[box,title="These components will be removed."](details.display_name:label=Name:align=left,version.version_string:label=Version:align=right,data.size.size(zero="",min=1048576):label=Size:align=right)
20
+ 2023-08-03 13:44:16,087 DEBUG root Chosen display Format:table[box,title="These components will be updated."](details.display_name:label=Name:align=left,version.version_string:label=Version:align=right,data.size.size(zero="",min=1048576):label=Size:align=right)
21
+ 2023-08-03 13:44:16,087 DEBUG root Chosen display Format:table[box,title="These components will be installed."](details.display_name:label=Name:align=left,version.version_string:label=Version:align=right,data.size.size(zero="",min=1048576):label=Size:align=right)
22
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___ ┌──────────────────────────────────────────────┐
23
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___
24
+
25
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___ │ These components will be installed. │
26
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___
27
+
28
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___ ├───────────────────────┬────────────┬─────────┤
29
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___
30
+
31
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___ │ Name │ Version │ Size │
32
+ 2023-08-03 13:44:16,089 INFO ___FILE_ONLY___
33
+
34
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ ├───────────────────────┼────────────┼─────────┤
35
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___
36
+
37
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ │
38
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ gcloud Alpha Commands
39
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___
40
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ │
41
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ 2023.07.28
42
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___
43
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ │
44
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ < 1 MiB
45
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___
46
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ │
47
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___
48
+
49
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ │
50
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___ gcloud Beta Commands
51
+ 2023-08-03 13:44:16,090 INFO ___FILE_ONLY___
52
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___ │
53
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___ 2023.07.28
54
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___
55
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___ │
56
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___ < 1 MiB
57
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___
58
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___ │
59
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___
60
+
61
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___ └───────────────────────┴────────────┴─────────┘
62
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___
63
+
64
+ 2023-08-03 13:44:16,091 INFO ___FILE_ONLY___
65
+
66
+ 2023-08-03 13:44:16,095 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
67
+ 2023-08-03 13:44:16,179 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/RELEASE_NOTES HTTP/1.1" 200 1050956
68
+ 2023-08-03 13:44:16,207 INFO ___FILE_ONLY___ For the latest full release notes, please visit:
69
+ https://cloud.google.com/sdk/release_notes
70
+
71
+
72
+ 2023-08-03 13:44:16,209 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
73
+
74
+ 2023-08-03 13:44:16,210 INFO ___FILE_ONLY___ ╠═ Creating update staging area ═╣
75
+
76
+ 2023-08-03 13:44:16,210 INFO ___FILE_ONLY___ ╚
77
+ 2023-08-03 13:44:16,210 INFO ___FILE_ONLY___ ══════
78
+ 2023-08-03 13:44:16,780 INFO ___FILE_ONLY___ ══════
79
+ 2023-08-03 13:44:16,780 INFO ___FILE_ONLY___ ══════
80
+ 2023-08-03 13:44:16,988 INFO ___FILE_ONLY___ ═
81
+ 2023-08-03 13:44:17,039 INFO ___FILE_ONLY___ ═
82
+ 2023-08-03 13:44:17,099 INFO ___FILE_ONLY___ ═
83
+ 2023-08-03 13:44:17,144 INFO ___FILE_ONLY___ ═
84
+ 2023-08-03 13:44:17,188 INFO ___FILE_ONLY___ ═
85
+ 2023-08-03 13:44:17,230 INFO ___FILE_ONLY___ ═
86
+ 2023-08-03 13:44:17,290 INFO ___FILE_ONLY___ ═
87
+ 2023-08-03 13:44:17,349 INFO ___FILE_ONLY___ ═
88
+ 2023-08-03 13:44:17,407 INFO ___FILE_ONLY___ ═
89
+ 2023-08-03 13:44:17,452 INFO ___FILE_ONLY___ ═
90
+ 2023-08-03 13:44:17,502 INFO ___FILE_ONLY___ ═
91
+ 2023-08-03 13:44:17,554 INFO ___FILE_ONLY___ ═
92
+ 2023-08-03 13:44:17,607 INFO ___FILE_ONLY___ ═
93
+ 2023-08-03 13:44:17,657 INFO ___FILE_ONLY___ ═
94
+ 2023-08-03 13:44:17,729 INFO ___FILE_ONLY___ ═
95
+ 2023-08-03 13:44:17,777 INFO ___FILE_ONLY___ ═
96
+ 2023-08-03 13:44:17,827 INFO ___FILE_ONLY___ ═
97
+ 2023-08-03 13:44:17,876 INFO ___FILE_ONLY___ ═
98
+ 2023-08-03 13:44:17,934 INFO ___FILE_ONLY___ ═
99
+ 2023-08-03 13:44:18,011 INFO ___FILE_ONLY___ ═
100
+ 2023-08-03 13:44:18,063 INFO ___FILE_ONLY___ ═
101
+ 2023-08-03 13:44:18,172 INFO ___FILE_ONLY___ ═
102
+ 2023-08-03 13:44:18,227 INFO ___FILE_ONLY___ ═
103
+ 2023-08-03 13:44:18,282 INFO ___FILE_ONLY___ ═
104
+ 2023-08-03 13:44:18,331 INFO ___FILE_ONLY___ ═
105
+ 2023-08-03 13:44:18,614 INFO ___FILE_ONLY___ ═
106
+ 2023-08-03 13:44:18,801 INFO ___FILE_ONLY___ ═
107
+ 2023-08-03 13:44:18,875 INFO ___FILE_ONLY___ ═
108
+ 2023-08-03 13:44:18,910 INFO ___FILE_ONLY___ ═
109
+ 2023-08-03 13:44:18,945 INFO ___FILE_ONLY___ ═
110
+ 2023-08-03 13:44:18,975 INFO ___FILE_ONLY___ ═
111
+ 2023-08-03 13:44:19,005 INFO ___FILE_ONLY___ ═
112
+ 2023-08-03 13:44:19,050 INFO ___FILE_ONLY___ ═
113
+ 2023-08-03 13:44:19,134 INFO ___FILE_ONLY___ ═
114
+ 2023-08-03 13:44:19,201 INFO ___FILE_ONLY___ ═
115
+ 2023-08-03 13:44:19,284 INFO ___FILE_ONLY___ ═
116
+ 2023-08-03 13:44:19,359 INFO ___FILE_ONLY___ ═
117
+ 2023-08-03 13:44:19,415 INFO ___FILE_ONLY___ ═
118
+ 2023-08-03 13:44:19,468 INFO ___FILE_ONLY___ ═
119
+ 2023-08-03 13:44:19,519 INFO ___FILE_ONLY___ ═
120
+ 2023-08-03 13:44:19,576 INFO ___FILE_ONLY___ ═
121
+ 2023-08-03 13:44:19,625 INFO ___FILE_ONLY___ ═
122
+ 2023-08-03 13:44:19,625 INFO ___FILE_ONLY___ ╝
123
+
124
+ 2023-08-03 13:44:22,301 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
125
+
126
+ 2023-08-03 13:44:22,302 INFO ___FILE_ONLY___ ╠═ Installing: gcloud Alpha Commands ═╣
127
+
128
+ 2023-08-03 13:44:22,302 INFO ___FILE_ONLY___ ╚
129
+ 2023-08-03 13:44:22,305 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
130
+ 2023-08-03 13:44:22,390 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-alpha-20230728162818.tar.gz HTTP/1.1" 200 800
131
+ 2023-08-03 13:44:22,391 INFO ___FILE_ONLY___ ══════════════════════════════
132
+ 2023-08-03 13:44:22,392 INFO ___FILE_ONLY___ ══════════════════════════════
133
+ 2023-08-03 13:44:22,392 INFO ___FILE_ONLY___ ╝
134
+
135
+ 2023-08-03 13:44:22,399 INFO ___FILE_ONLY___ ╔════════════════════════════════════════════════════════════╗
136
+
137
+ 2023-08-03 13:44:22,399 INFO ___FILE_ONLY___ ╠═ Installing: gcloud Beta Commands ═╣
138
+
139
+ 2023-08-03 13:44:22,400 INFO ___FILE_ONLY___ ╚
140
+ 2023-08-03 13:44:22,403 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): dl.google.com:443
141
+ 2023-08-03 13:44:22,484 DEBUG urllib3.connectionpool https://dl.google.com:443 "GET /dl/cloudsdk/channels/rapid/components/google-cloud-sdk-beta-20230728162818.tar.gz HTTP/1.1" 200 797
142
+ 2023-08-03 13:44:22,484 INFO ___FILE_ONLY___ ══════════════════════════════
143
+ 2023-08-03 13:44:22,485 INFO ___FILE_ONLY___ ══════════════════════════════
144
+ 2023-08-03 13:44:22,486 INFO ___FILE_ONLY___ ╝
145
+
146
+ 2023-08-03 13:44:22,494 INFO ___FILE_ONLY___ ��════════════════════════════════════════════════════════════╗
147
+
148
+ 2023-08-03 13:44:22,495 INFO ___FILE_ONLY___ ╠═ Creating backup and activating new installation ═╣
149
+
150
+ 2023-08-03 13:44:22,495 INFO ___FILE_ONLY___ ╚
151
+ 2023-08-03 13:44:22,495 DEBUG root Attempting to move directory [/tools/google-cloud-sdk] to [/tools/google-cloud-sdk.staging/.install/.backup]
152
+ 2023-08-03 13:44:22,495 INFO ___FILE_ONLY___ ══════════════════════════════
153
+ 2023-08-03 13:44:22,495 DEBUG root Attempting to move directory [/tools/google-cloud-sdk.staging] to [/tools/google-cloud-sdk]
154
+ 2023-08-03 13:44:22,495 INFO ___FILE_ONLY___ ══════════════════════════════
155
+ 2023-08-03 13:44:22,495 INFO ___FILE_ONLY___ ╝
156
+
157
+ 2023-08-03 13:44:22,499 DEBUG root Updating notification cache...
158
+ 2023-08-03 13:44:22,499 INFO ___FILE_ONLY___
159
+
160
+ 2023-08-03 13:44:22,501 INFO ___FILE_ONLY___ Performing post processing steps...
161
+ 2023-08-03 13:44:22,502 DEBUG root Executing command: ['python3', '-S', '/tools/google-cloud-sdk/lib/gcloud.py', 'components', 'post-process']
162
+ 2023-08-03 13:44:46,602 DEBUG ___FILE_ONLY___
163
+ 2023-08-03 13:44:46,602 DEBUG ___FILE_ONLY___
164
+ 2023-08-03 13:44:46,787 INFO ___FILE_ONLY___
165
+ Update done!
166
+
167
+
168
+ 2023-08-03 13:44:46,790 DEBUG root Chosen display Format:none
169
+ 2023-08-03 13:44:46,791 INFO root Display format: "none"
.config/logs/2023.08.03/13.44.23.058287.log ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 2023-08-03 13:44:23,059 DEBUG root Loaded Command Group: ['gcloud', 'components']
2
+ 2023-08-03 13:44:23,061 DEBUG root Loaded Command Group: ['gcloud', 'components', 'post_process']
3
+ 2023-08-03 13:44:23,063 DEBUG root Running [gcloud.components.post-process] with arguments: []
4
+ 2023-08-03 13:44:46,489 DEBUG root Chosen display Format:none
5
+ 2023-08-03 13:44:46,490 INFO root Display format: "none"
.config/logs/2023.08.03/13.44.47.473323.log ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ 2023-08-03 13:44:47,475 DEBUG root Loaded Command Group: ['gcloud', 'config']
2
+ 2023-08-03 13:44:47,504 DEBUG root Loaded Command Group: ['gcloud', 'config', 'set']
3
+ 2023-08-03 13:44:47,506 DEBUG root Running [gcloud.config.set] with arguments: [SECTION/PROPERTY: "component_manager/disable_update_check", VALUE: "true"]
4
+ 2023-08-03 13:44:47,507 INFO ___FILE_ONLY___ Updated property [component_manager/disable_update_check].
5
+
6
+ 2023-08-03 13:44:47,508 DEBUG root Chosen display Format:default
7
+ 2023-08-03 13:44:47,509 INFO root Display format: "default"
8
+ 2023-08-03 13:44:47,509 DEBUG root SDK update checks are disabled.
.config/logs/2023.08.03/13.44.48.234496.log ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ 2023-08-03 13:44:48,236 DEBUG root Loaded Command Group: ['gcloud', 'config']
2
+ 2023-08-03 13:44:48,265 DEBUG root Loaded Command Group: ['gcloud', 'config', 'set']
3
+ 2023-08-03 13:44:48,268 DEBUG root Running [gcloud.config.set] with arguments: [SECTION/PROPERTY: "compute/gce_metadata_read_timeout_sec", VALUE: "0"]
4
+ 2023-08-03 13:44:48,269 INFO ___FILE_ONLY___ Updated property [compute/gce_metadata_read_timeout_sec].
5
+
6
+ 2023-08-03 13:44:48,269 DEBUG root Chosen display Format:default
7
+ 2023-08-03 13:44:48,270 INFO root Display format: "default"
8
+ 2023-08-03 13:44:48,271 DEBUG root SDK update checks are disabled.
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ sample_data/mnist_test.csv filter=lfs diff=lfs merge=lfs -text
37
+ sample_data/mnist_train_small.csv filter=lfs diff=lfs merge=lfs -text
.github/workflows/update_space.yml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Run Python script
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v2
18
+ with:
19
+ python-version: '3.9'
20
+
21
+ - name: Install Gradio
22
+ run: python -m pip install gradio
23
+
24
+ - name: Log in to Hugging Face
25
+ run: python -c 'import huggingface_hub; huggingface_hub.login(token="${{ secrets.hf_token }}")'
26
+
27
+ - name: Deploy to Spaces
28
+ run: gradio deploy
README.md CHANGED
@@ -1,12 +1,6 @@
1
  ---
2
- title: Music
3
- emoji: 🦀
4
- colorFrom: gray
5
- colorTo: yellow
6
  sdk: gradio
7
  sdk_version: 3.39.0
8
- app_file: app.py
9
- pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: music
3
+ app_file: audiocraft/app.py
 
 
4
  sdk: gradio
5
  sdk_version: 3.39.0
 
 
6
  ---
 
 
audiocraft/.github/actions/audiocraft_build/action.yml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: audiocraft_build
2
+ description: 'Build audiocraft env.'
3
+ runs:
4
+ using: "composite"
5
+ steps:
6
+ - uses: actions/setup-python@v2
7
+ with:
8
+ python-version: 3.8
9
+ - uses: actions/cache@v2
10
+ id: cache
11
+ with:
12
+ path: env
13
+ key: audiocraft_env-${{ hashFiles('**/requirements.txt') }}
14
+
15
+ - if: ${{ steps.cache.outputs.cache-hit != 'true' }}
16
+ name: Install dependencies
17
+ shell: bash
18
+ run: |
19
+ sudo apt-get update
20
+ sudo apt-get install libsndfile1-dev ffmpeg
21
+ python3 -m venv env
22
+ . env/bin/activate
23
+ python -m pip install --upgrade pip
24
+ pip install -e '.[dev]'
25
+ - name: System Dependencies
26
+ shell: bash
27
+ run: |
28
+ sudo apt-get update
29
+ sudo apt-get install libsndfile1-dev ffmpeg
audiocraft/.github/workflows/audiocraft_docs.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: audiocraft_docs
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+
6
+ jobs:
7
+ run_docs:
8
+ name: Run docs
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: ./.github/actions/audiocraft_build
13
+ - name: Config git
14
+ run: |
15
+ git config --global user.email "[email protected]"
16
+ git config --global user.name "Alexandre Défossez (autodoc)"
17
+
18
+ - name: Reset branch
19
+ run: |
20
+ git branch -f gh-docs main
21
+ git checkout gh-docs
22
+
23
+ - name: Make docs
24
+ run: |
25
+ . env/bin/activate
26
+ make docs
27
+ git add -f docs
28
+ git commit -m docs
29
+
30
+ - name: Push branch
31
+ run: |
32
+ git push -f -u origin gh-docs
audiocraft/.github/workflows/audiocraft_linter.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: audiocraft_linter
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ pull_request:
6
+ branches: [ main ]
7
+
8
+ jobs:
9
+ run_linter:
10
+ name: Run linter
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ./.github/actions/audiocraft_build
15
+ - run: |
16
+ . env/bin/activate
17
+ make linter
audiocraft/.github/workflows/audiocraft_tests.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: audiocraft_tests
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ pull_request:
6
+ branches: [ main ]
7
+
8
+ jobs:
9
+ run_tests:
10
+ name: Run tests
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ./.github/actions/audiocraft_build
15
+ - run: |
16
+ . env/bin/activate
17
+ make tests
audiocraft/.gitignore ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ /docs
39
+
40
+ # dotenv
41
+ .env
42
+ .envrc
43
+
44
+ # virtualenv
45
+ .venv
46
+ venv/
47
+ ENV/
48
+
49
+ # personal notebooks & scripts
50
+ */local_scripts
51
+ */notes
52
+ .vscode/
53
+ /notebooks
54
+ /local_scripts
55
+ /notes
audiocraft/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+
7
+ ## [0.0.2a] - TBD
8
+
9
+ Improved demo, fixed top p (thanks @jnordberg).
10
+
11
+ Compressor tanh on output to avoid clipping with some style (especially piano).
12
+ Now repeating the conditioning periodically if it is too short.
13
+
14
+ More options when launching Gradio app locally (thanks @ashleykleynhans).
15
+
16
+ Testing out PyTorch 2.0 memory efficient attention.
17
+
18
+ Added extended generation (infinite length) by slowly moving the windows.
19
+ Note that other implementations exist: https://github.com/camenduru/MusicGen-colab.
20
+
21
+ ## [0.0.1] - 2023-06-09
22
+
23
+ Initial release, with model evaluation only.
audiocraft/CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to make participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all project spaces, and it also applies when
49
+ an individual is representing the project or its community in public spaces.
50
+ Examples of representing a project or community include using an official
51
+ project e-mail address, posting via an official social media account, or acting
52
+ as an appointed representative at an online or offline event. Representation of
53
+ a project may be further defined and clarified by project maintainers.
54
+
55
+ This Code of Conduct also applies outside the project spaces when there is a
56
+ reasonable belief that an individual's behavior may have a negative impact on
57
+ the project or its community.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported by contacting the project team at <[email protected]>. All
63
+ complaints will be reviewed and investigated and will result in a response that
64
+ is deemed necessary and appropriate to the circumstances. The project team is
65
+ obligated to maintain confidentiality with regard to the reporter of an incident.
66
+ Further details of specific enforcement policies may be posted separately.
67
+
68
+ Project maintainers who do not follow or enforce the Code of Conduct in good
69
+ faith may face temporary or permanent repercussions as determined by other
70
+ members of the project's leadership.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
75
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
76
+
77
+ [homepage]: https://www.contributor-covenant.org
78
+
79
+ For answers to common questions about this code of conduct, see
80
+ https://www.contributor-covenant.org/faq
audiocraft/CONTRIBUTING.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to Audiocraft
2
+
3
+ We want to make contributing to this project as easy and transparent as
4
+ possible.
5
+
6
+ ## Pull Requests
7
+
8
+ Audiocraft is the implementation of a research paper.
9
+ Therefore, we do not plan on accepting many pull requests for new features.
10
+ We certainly welcome them for bug fixes.
11
+
12
+ 1. Fork the repo and create your branch from `main`.
13
+ 2. If you've added code that should be tested, add tests.
14
+ 3. If you've changed APIs, update the documentation.
15
+ 4. Ensure the test suite passes.
16
+ 5. Make sure your code lints.
17
+ 6. If you haven't already, complete the Contributor License Agreement ("CLA").
18
+
19
+ ## Contributor License Agreement ("CLA")
20
+ In order to accept your pull request, we need you to submit a CLA. You only need
21
+ to do this once to work on any of Meta's open source projects.
22
+
23
+ Complete your CLA here: <https://code.facebook.com/cla>
24
+
25
+ ## Issues
26
+ We use GitHub issues to track public bugs. Please ensure your description is
27
+ clear and has sufficient instructions to be able to reproduce the issue.
28
+
29
+ Meta has a [bounty program](https://www.facebook.com/whitehat/) for the safe
30
+ disclosure of security bugs. In those cases, please go through the process
31
+ outlined on that page and do not file a public issue.
32
+
33
+ ## License
34
+ By contributing to encodec, you agree that your contributions will be licensed
35
+ under the LICENSE file in the root directory of this source tree.
audiocraft/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) Meta Platforms, Inc. and affiliates.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
audiocraft/LICENSE_weights ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Attribution-NonCommercial-NoDerivatives 4.0 International
2
+
3
+ > *Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.*
4
+ >
5
+ > ### Using Creative Commons Public Licenses
6
+ >
7
+ > Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
8
+ >
9
+ > * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
10
+ >
11
+ > * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
12
+
13
+ ## Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License
14
+
15
+ By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
16
+
17
+ ### Section 1 – Definitions.
18
+
19
+ a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
20
+
21
+ b. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
22
+
23
+ e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
24
+
25
+ f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
26
+
27
+ h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
28
+
29
+ i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
30
+
31
+ h. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
32
+
33
+ i. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
34
+
35
+ j. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
36
+
37
+ k. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
38
+
39
+ l. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
40
+
41
+ ### Section 2 – Scope.
42
+
43
+ a. ___License grant.___
44
+
45
+ 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
46
+
47
+ A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
48
+
49
+ B. produce and reproduce, but not Share, Adapted Material for NonCommercial purposes only.
50
+
51
+ 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
52
+
53
+ 3. __Term.__ The term of this Public License is specified in Section 6(a).
54
+
55
+ 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
56
+
57
+ 5. __Downstream recipients.__
58
+
59
+ A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
60
+
61
+ B. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
62
+
63
+ 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
64
+
65
+ b. ___Other rights.___
66
+
67
+ 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
68
+
69
+ 2. Patent and trademark rights are not licensed under this Public License.
70
+
71
+ 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
72
+
73
+ ### Section 3 – License Conditions.
74
+
75
+ Your exercise of the Licensed Rights is expressly made subject to the following conditions.
76
+
77
+ a. ___Attribution.___
78
+
79
+ 1. If You Share the Licensed Material, You must:
80
+
81
+ A. retain the following if it is supplied by the Licensor with the Licensed Material:
82
+
83
+ i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
84
+
85
+ ii. a copyright notice;
86
+
87
+ iii. a notice that refers to this Public License;
88
+
89
+ iv. a notice that refers to the disclaimer of warranties;
90
+
91
+ v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
92
+
93
+ B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
94
+
95
+ C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
96
+
97
+ For the avoidance of doubt, You do not have permission under this Public License to Share Adapted Material.
98
+
99
+ 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
100
+
101
+ 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
102
+
103
+ ### Section 4 – Sui Generis Database Rights.
104
+
105
+ Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
106
+
107
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only and provided You do not Share Adapted Material;
108
+
109
+ b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
110
+
111
+ c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
112
+
113
+ For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
114
+
115
+ ### Section 5 – Disclaimer of Warranties and Limitation of Liability.
116
+
117
+ a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
118
+
119
+ b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
120
+
121
+ c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
122
+
123
+ ### Section 6 – Term and Termination.
124
+
125
+ a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
126
+
127
+ b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
128
+
129
+ 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
130
+
131
+ 2. upon express reinstatement by the Licensor.
132
+
133
+ For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
134
+
135
+ c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
136
+
137
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
138
+
139
+ ### Section 7 – Other Terms and Conditions.
140
+
141
+ a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
142
+
143
+ b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
144
+
145
+ ### Section 8 – Interpretation.
146
+
147
+ a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
148
+
149
+ b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
150
+
151
+ c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
152
+
153
+ d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
154
+
155
+ > Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
156
+ >
157
+ > Creative Commons may be contacted at [creativecommons.org](http://creativecommons.org).
audiocraft/MANIFEST.in ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
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
audiocraft/MODEL_CARD.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MusicGen Model Card
2
+
3
+ ## Model details
4
+
5
+ **Organization developing the model:** The FAIR team of Meta AI.
6
+
7
+ **Model date:** MusicGen was trained between April 2023 and May 2023.
8
+
9
+ **Model version:** This is the version 1 of the model.
10
+
11
+ **Model type:** MusicGen consists of an EnCodec model for audio tokenization, an auto-regressive language model based on the transformer architecture for music modeling. The model comes in different sizes: 300M, 1.5B and 3.3B parameters ; and two variants: a model trained for text-to-music generation task and a model trained for melody-guided music generation.
12
+
13
+ **Paper or resources for more information:** More information can be found in the paper [Simple and Controllable Music Generation][arxiv].
14
+
15
+ **Citation details** See [our paper][arxiv]
16
+
17
+ **License** Code is released under MIT, model weights are released under CC-BY-NC 4.0.
18
+
19
+ **Where to send questions or comments about the model:** Questions and comments about MusicGen can be sent via the [Github repository](https://github.com/facebookresearch/audiocraft) of the project, or by opening an issue.
20
+
21
+ ## Intended use
22
+ **Primary intended use:** The primary use of MusicGen is research on AI-based music generation, including:
23
+
24
+ - Research efforts, such as probing and better understanding the limitations of generative models to further improve the state of science
25
+ - Generation of music guided by text or melody to understand current abilities of generative AI models by machine learning amateurs
26
+
27
+ **Primary intended users:** The primary intended users of the model are researchers in audio, machine learning and artificial intelligence, as well as amateur seeking to better understand those models.
28
+
29
+ **Out-of-scope use cases** The model should not be used on downstream applications without further risk evaluation and mitigation. The model should not be used to intentionally create or disseminate music pieces that create hostile or alienating environments for people. This includes generating music that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.
30
+
31
+ ## Metrics
32
+
33
+ **Models performance measures:** We used the following objective measure to evaluate the model on a standard music benchmark:
34
+
35
+ - Frechet Audio Distance computed on features extracted from a pre-trained audio classifier (VGGish)
36
+ - Kullback-Leibler Divergence on label distributions extracted from a pre-trained audio classifier (PaSST)
37
+ - CLAP Score between audio embedding and text embedding extracted from a pre-trained CLAP model
38
+
39
+ Additionally, we run qualitative studies with human participants, evaluating the performance of the model with the following axes:
40
+
41
+ - Overall quality of the music samples;
42
+ - Text relevance to the provided text input;
43
+ - Adherence to the melody for melody-guided music generation.
44
+
45
+ More details on performance measures and human studies can be found in the paper.
46
+
47
+ **Decision thresholds:** Not applicable.
48
+
49
+ ## Evaluation datasets
50
+
51
+ The model was evaluated on the [MusicCaps benchmark](https://www.kaggle.com/datasets/googleai/musiccaps) and on an in-domain held-out evaluation set, with no artist overlap with the training set.
52
+
53
+ ## Training datasets
54
+
55
+ The model was trained on licensed data using the following sources: the [Meta Music Initiative Sound Collection](https://www.fb.com/sound), [Shutterstock music collection](https://www.shutterstock.com/music) and the [Pond5 music collection](https://www.pond5.com/). See the paper for more details about the training set and corresponding preprocessing.
56
+
57
+ ## Quantitative analysis
58
+
59
+ More information can be found in the paper [Simple and Controllable Music Generation][arxiv], in the Experimental Setup section.
60
+
61
+ ## Limitations and biases
62
+
63
+ **Data:** The data sources used to train the model are created by music professionals and covered by legal agreements with the right holders. The model is trained on 20K hours of data, we believe that scaling the model on larger datasets can further improve the performance of the model.
64
+
65
+ **Mitigations:** Vocals have been removed from the data source using corresponding tags, and then using using a state-of-the-art music source separation method, namely using the open source [Hybrid Transformer for Music Source Separation](https://github.com/facebookresearch/demucs) (HT-Demucs).
66
+
67
+ **Limitations:**
68
+
69
+ - The model is not able to generate realistic vocals.
70
+ - The model has been trained with English descriptions and will not perform as well in other languages.
71
+ - The model does not perform equally well for all music styles and cultures.
72
+ - The model sometimes generates end of songs, collapsing to silence.
73
+ - It is sometimes difficult to assess what types of text descriptions provide the best generations. Prompt engineering may be required to obtain satisfying results.
74
+
75
+ **Biases:** The source of data is potentially lacking diversity and all music cultures are not equally represented in the dataset. The model may not perform equally well on the wide variety of music genres that exists. The generated samples from the model will reflect the biases from the training data. Further work on this model should include methods for balanced and just representations of cultures, for example, by scaling the training data to be both diverse and inclusive.
76
+
77
+ **Risks and harms:** Biases and limitations of the model may lead to generation of samples that may be considered as biased, inappropriate or offensive. We believe that providing the code to reproduce the research and train new models will allow to broaden the application to new and more representative data.
78
+
79
+ **Use cases:** Users must be aware of the biases, limitations and risks of the model. MusicGen is a model developed for artificial intelligence research on controllable music generation. As such, it should not be used for downstream applications without further investigation and mitigation of risks.
80
+
81
+ [arxiv]: https://arxiv.org/abs/2306.05284
audiocraft/Makefile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default: linter tests
2
+
3
+ install:
4
+ pip install -U pip
5
+ pip install -U -e '.[dev]'
6
+
7
+ linter:
8
+ flake8 audiocraft && mypy audiocraft
9
+ flake8 tests && mypy tests
10
+
11
+ tests:
12
+ coverage run -m pytest tests
13
+ coverage report --include 'audiocraft/*'
14
+
15
+ docs:
16
+ pdoc3 --html -o docs -f audiocraft
17
+
18
+ dist:
19
+ python setup.py sdist
20
+
21
+ .PHONY: linter tests docs dist
audiocraft/Qma6mgf0vpW1.mp4 ADDED
Binary file (174 kB). View file
 
audiocraft/README.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Audiocraft
2
+ ![docs badge](https://github.com/facebookresearch/audiocraft/workflows/audiocraft_docs/badge.svg)
3
+ ![linter badge](https://github.com/facebookresearch/audiocraft/workflows/audiocraft_linter/badge.svg)
4
+ ![tests badge](https://github.com/facebookresearch/audiocraft/workflows/audiocraft_tests/badge.svg)
5
+
6
+ Audiocraft is a PyTorch library for deep learning research on audio generation. At the moment, it contains the code for MusicGen, a state-of-the-art controllable text-to-music model.
7
+
8
+ ## MusicGen
9
+
10
+ Audiocraft provides the code and models for MusicGen, [a simple and controllable model for music generation][arxiv]. MusicGen is a single stage auto-regressive
11
+ Transformer model trained over a 32kHz <a href="https://github.com/facebookresearch/encodec">EnCodec tokenizer</a> with 4 codebooks sampled at 50 Hz. Unlike existing methods like [MusicLM](https://arxiv.org/abs/2301.11325), MusicGen doesn't require a self-supervised semantic representation, and it generates
12
+ all 4 codebooks in one pass. By introducing a small delay between the codebooks, we show we can predict
13
+ them in parallel, thus having only 50 auto-regressive steps per second of audio.
14
+ Check out our [sample page][musicgen_samples] or test the available demo!
15
+
16
+ <a target="_blank" href="https://colab.research.google.com/drive/1-Xe9NCdIs2sCUbiSmwHXozK6AAhMm7_i?usp=sharing">
17
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
18
+ </a>
19
+ <a target="_blank" href="https://huggingface.co/spaces/facebook/MusicGen">
20
+ <img src="https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg" alt="Open in HugginFace"/>
21
+ </a>
22
+ <br>
23
+
24
+ We use 20K hours of licensed music to train MusicGen. Specifically, we rely on an internal dataset of 10K high-quality music tracks, and on the ShutterStock and Pond5 music data.
25
+
26
+ ## Installation
27
+ Audiocraft requires Python 3.9, PyTorch 2.0.0, and a GPU with at least 16 GB of memory (for the medium-sized model). To install Audiocraft, you can run the following:
28
+
29
+ ```shell
30
+ # Best to make sure you have torch installed first, in particular before installing xformers.
31
+ # Don't run this if you already have PyTorch installed.
32
+ pip install 'torch>=2.0'
33
+ # Then proceed to one of the following
34
+ pip install -U audiocraft # stable release
35
+ pip install -U git+https://[email protected]/facebookresearch/audiocraft#egg=audiocraft # bleeding edge
36
+ pip install -e . # or if you cloned the repo locally
37
+ ```
38
+
39
+ ## Usage
40
+ We offer a number of way to interact with MusicGen:
41
+ 1. A demo is also available on the [`facebook/MusicGen` HuggingFace Space](https://huggingface.co/spaces/facebook/MusicGen) (huge thanks to all the HF team for their support).
42
+ 2. You can run the extended demo on a Colab: [colab notebook](https://colab.research.google.com/drive/1fxGqfg96RBUvGxZ1XXN07s3DthrKUl4-?usp=sharing).
43
+ 3. You can use the gradio demo locally by running `python app.py`.
44
+ 4. You can play with MusicGen by running the jupyter notebook at [`demo.ipynb`](./demo.ipynb) locally (if you have a GPU).
45
+ 5. Finally, checkout [@camenduru Colab page](https://github.com/camenduru/MusicGen-colab) which is regularly
46
+ updated with contributions from @camenduru and the community.
47
+
48
+ ## API
49
+
50
+ We provide a simple API and 4 pre-trained models. The pre trained models are:
51
+ - `small`: 300M model, text to music only - [🤗 Hub](https://huggingface.co/facebook/musicgen-small)
52
+ - `medium`: 1.5B model, text to music only - [🤗 Hub](https://huggingface.co/facebook/musicgen-medium)
53
+ - `melody`: 1.5B model, text to music and text+melody to music - [🤗 Hub](https://huggingface.co/facebook/musicgen-melody)
54
+ - `large`: 3.3B model, text to music only - [🤗 Hub](https://huggingface.co/facebook/musicgen-large)
55
+
56
+ We observe the best trade-off between quality and compute with the `medium` or `melody` model.
57
+ In order to use MusicGen locally **you must have a GPU**. We recommend 16GB of memory, but smaller
58
+ GPUs will be able to generate short sequences, or longer sequences with the `small` model.
59
+
60
+ **Note**: Please make sure to have [ffmpeg](https://ffmpeg.org/download.html) installed when using newer version of `torchaudio`.
61
+ You can install it with:
62
+ ```
63
+ apt-get install ffmpeg
64
+ ```
65
+
66
+ See after a quick example for using the API.
67
+
68
+ ```python
69
+ import torchaudio
70
+ from audiocraft.models import MusicGen
71
+ from audiocraft.data.audio import audio_write
72
+
73
+ model = MusicGen.get_pretrained('melody')
74
+ model.set_generation_params(duration=8) # generate 8 seconds.
75
+ wav = model.generate_unconditional(4) # generates 4 unconditional audio samples
76
+ descriptions = ['happy rock', 'energetic EDM', 'sad jazz']
77
+ wav = model.generate(descriptions) # generates 3 samples.
78
+
79
+ melody, sr = torchaudio.load('./assets/bach.mp3')
80
+ # generates using the melody from the given audio and the provided descriptions.
81
+ wav = model.generate_with_chroma(descriptions, melody[None].expand(3, -1, -1), sr)
82
+
83
+ for idx, one_wav in enumerate(wav):
84
+ # Will save under {idx}.wav, with loudness normalization at -14 db LUFS.
85
+ audio_write(f'{idx}', one_wav.cpu(), model.sample_rate, strategy="loudness", loudness_compressor=True)
86
+ ```
87
+
88
+
89
+ ## Model Card
90
+
91
+ See [the model card page](./MODEL_CARD.md).
92
+
93
+ ## FAQ
94
+
95
+ #### Will the training code be released?
96
+
97
+ Yes. We will soon release the training code for MusicGen and EnCodec.
98
+
99
+
100
+ #### I need help on Windows
101
+
102
+ @FurkanGozukara made a complete tutorial for [Audiocraft/MusicGen on Windows](https://youtu.be/v-YpvPkhdO4)
103
+
104
+ #### I need help for running the demo on Colab
105
+
106
+ Check [@camenduru tutorial on Youtube](https://www.youtube.com/watch?v=EGfxuTy9Eeo).
107
+
108
+
109
+ ## Citation
110
+ ```
111
+ @article{copet2023simple,
112
+ title={Simple and Controllable Music Generation},
113
+ author={Jade Copet and Felix Kreuk and Itai Gat and Tal Remez and David Kant and Gabriel Synnaeve and Yossi Adi and Alexandre Défossez},
114
+ year={2023},
115
+ journal={arXiv preprint arXiv:2306.05284},
116
+ }
117
+ ```
118
+
119
+ ## License
120
+ * The code in this repository is released under the MIT license as found in the [LICENSE file](LICENSE).
121
+ * The weights in this repository are released under the CC-BY-NC 4.0 license as found in the [LICENSE_weights file](LICENSE_weights).
122
+
123
+ [arxiv]: https://arxiv.org/abs/2306.05284
124
+ [musicgen_samples]: https://ai.honu.io/papers/musicgen/
audiocraft/app.py ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Updated to account for UI changes from https://github.com/rkfg/audiocraft/blob/long/app.py
8
+ # also released under the MIT license.
9
+
10
+ import argparse
11
+ from concurrent.futures import ProcessPoolExecutor
12
+ import os
13
+ import subprocess as sp
14
+ from tempfile import NamedTemporaryFile
15
+ import time
16
+ import warnings
17
+
18
+ import torch
19
+ import gradio as gr
20
+
21
+ from audiocraft.data.audio_utils import convert_audio
22
+ from audiocraft.data.audio import audio_write
23
+ from audiocraft.models import MusicGen
24
+ import subprocess, random, string
25
+
26
+
27
+ MODEL = None # Last used model
28
+ IS_BATCHED = "facebook/MusicGen" in os.environ.get('SPACE_ID', '')
29
+ MAX_BATCH_SIZE = 12
30
+ BATCHED_DURATION = 15
31
+ INTERRUPTING = False
32
+ # We have to wrap subprocess call to clean a bit the log when using gr.make_waveform
33
+ _old_call = sp.call
34
+
35
+ def generate_random_string(length):
36
+ characters = string.ascii_letters + string.digits
37
+ return ''.join(random.choice(characters) for _ in range(length))
38
+
39
+ def resize_video(input_path, output_path, target_width, target_height):
40
+ ffmpeg_cmd = [
41
+ 'ffmpeg',
42
+ '-y',
43
+ '-i', input_path,
44
+ '-vf', f'scale={target_width}:{target_height}',
45
+ '-c:a', 'copy',
46
+ output_path
47
+ ]
48
+ subprocess.run(ffmpeg_cmd)
49
+
50
+ def _call_nostderr(*args, **kwargs):
51
+ # Avoid ffmpeg vomitting on the logs.
52
+ kwargs['stderr'] = sp.DEVNULL
53
+ kwargs['stdout'] = sp.DEVNULL
54
+ _old_call(*args, **kwargs)
55
+
56
+
57
+ sp.call = _call_nostderr
58
+ # Preallocating the pool of processes.
59
+ pool = ProcessPoolExecutor(4)
60
+ pool.__enter__()
61
+
62
+
63
+ def interrupt():
64
+ global INTERRUPTING
65
+ INTERRUPTING = True
66
+
67
+
68
+ def make_waveform(*args, **kwargs):
69
+ # Further remove some warnings.
70
+ be = time.time()
71
+ with warnings.catch_warnings():
72
+ warnings.simplefilter('ignore')
73
+ waveform_video = gr.make_waveform(*args, **kwargs)
74
+ out = f"{generate_random_string(12)}.mp4"
75
+ resize_video(waveform_video, out, 900, 300)
76
+ print("Make a video took", time.time() - be)
77
+ return out
78
+
79
+
80
+ def load_model(version='melody'):
81
+ global MODEL
82
+ print("Loading model", version)
83
+ if MODEL is None or MODEL.name != version:
84
+ MODEL = MusicGen.get_pretrained(version)
85
+
86
+
87
+ def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
88
+ MODEL.set_generation_params(duration=duration, **gen_kwargs)
89
+ print("new batch", len(texts), texts, [None if m is None else (m[0], m[1].shape) for m in melodies])
90
+ be = time.time()
91
+ processed_melodies = []
92
+ target_sr = 32000
93
+ target_ac = 1
94
+ for melody in melodies:
95
+ if melody is None:
96
+ processed_melodies.append(None)
97
+ else:
98
+ sr, melody = melody[0], torch.from_numpy(melody[1]).to(MODEL.device).float().t()
99
+ if melody.dim() == 1:
100
+ melody = melody[None]
101
+ melody = melody[..., :int(sr * duration)]
102
+ melody = convert_audio(melody, sr, target_sr, target_ac)
103
+ processed_melodies.append(melody)
104
+
105
+ if any(m is not None for m in processed_melodies):
106
+ outputs = MODEL.generate_with_chroma(
107
+ descriptions=texts,
108
+ melody_wavs=processed_melodies,
109
+ melody_sample_rate=target_sr,
110
+ progress=progress,
111
+ )
112
+ else:
113
+ outputs = MODEL.generate(texts, progress=progress)
114
+
115
+ outputs = outputs.detach().cpu().float()
116
+ out_files = []
117
+ for output in outputs:
118
+ with NamedTemporaryFile("wb", suffix=".wav", delete=False) as file:
119
+ audio_write(
120
+ file.name, output, MODEL.sample_rate, strategy="loudness",
121
+ loudness_headroom_db=16, loudness_compressor=True, add_suffix=False)
122
+ out_files.append(pool.submit(make_waveform, file.name, bg_color="#21b0fe" , bars_color=('#fe218b', '#fed700'), fg_alpha=1.0, bar_count=75))
123
+ res = [out_file.result() for out_file in out_files]
124
+ print("batch finished", len(texts), time.time() - be)
125
+ return res
126
+
127
+
128
+ def predict_batched(texts, melodies):
129
+ max_text_length = 512
130
+ texts = [text[:max_text_length] for text in texts]
131
+ load_model('melody')
132
+ res = _do_predictions(texts, melodies, BATCHED_DURATION)
133
+ return [res]
134
+
135
+
136
+ def predict_full(model, text, melody, duration, topk, topp, temperature, cfg_coef, progress=gr.Progress()):
137
+ global INTERRUPTING
138
+ INTERRUPTING = False
139
+ if temperature < 0:
140
+ raise gr.Error("Temperature must be >= 0.")
141
+ if topk < 0:
142
+ raise gr.Error("Topk must be non-negative.")
143
+ if topp < 0:
144
+ raise gr.Error("Topp must be non-negative.")
145
+
146
+ topk = int(topk)
147
+ load_model(model)
148
+
149
+ def _progress(generated, to_generate):
150
+ progress((generated, to_generate))
151
+ if INTERRUPTING:
152
+ raise gr.Error("Interrupted.")
153
+ MODEL.set_custom_progress_callback(_progress)
154
+
155
+ outs = _do_predictions(
156
+ [text], [melody], duration, progress=True,
157
+ top_k=topk, top_p=topp, temperature=temperature, cfg_coef=cfg_coef)
158
+ return outs[0]
159
+
160
+
161
+ def ui_full(launch_kwargs):
162
+ with gr.Blocks() as interface:
163
+ gr.Markdown(
164
+ """
165
+ # MusicGen
166
+ This is your private demo for [MusicGen](https://github.com/facebookresearch/audiocraft), a simple and controllable model for music generation
167
+ presented at: ["Simple and Controllable Music Generation"](https://arxiv.org/abs/2306.05284)
168
+ """
169
+ )
170
+ with gr.Row():
171
+ with gr.Column():
172
+ with gr.Row():
173
+ text = gr.Text(label="Input Text", interactive=True)
174
+ melody = gr.Audio(source="upload", type="numpy", label="Melody Condition (optional)", interactive=True)
175
+ with gr.Row():
176
+ submit = gr.Button("Submit")
177
+ # Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
178
+ _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
179
+ with gr.Row():
180
+ model = gr.Radio(["melody", "medium", "small", "large"], label="Model", value="melody", interactive=True)
181
+ with gr.Row():
182
+ duration = gr.Slider(minimum=1, maximum=120, value=10, label="Duration", interactive=True)
183
+ with gr.Row():
184
+ topk = gr.Number(label="Top-k", value=250, interactive=True)
185
+ topp = gr.Number(label="Top-p", value=0, interactive=True)
186
+ temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
187
+ cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
188
+ with gr.Column():
189
+ output = gr.Video(label="Generated Music")
190
+ submit.click(predict_full, inputs=[model, text, melody, duration, topk, topp, temperature, cfg_coef], outputs=[output])
191
+ gr.Examples(
192
+ fn=predict_full,
193
+ examples=[
194
+ [
195
+ "An 80s driving pop song with heavy drums and synth pads in the background",
196
+ "./assets/bach.mp3",
197
+ "melody"
198
+ ],
199
+ [
200
+ "A cheerful country song with acoustic guitars",
201
+ "./assets/bolero_ravel.mp3",
202
+ "melody"
203
+ ],
204
+ [
205
+ "90s rock song with electric guitar and heavy drums",
206
+ None,
207
+ "medium"
208
+ ],
209
+ [
210
+ "a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions",
211
+ "./assets/bach.mp3",
212
+ "melody"
213
+ ],
214
+ [
215
+ "lofi slow bpm electro chill with organic samples",
216
+ None,
217
+ "medium",
218
+ ],
219
+ ],
220
+ inputs=[text, melody, model],
221
+ outputs=[output]
222
+ )
223
+ gr.Markdown(
224
+ """
225
+ ### More details
226
+
227
+ The model will generate a short music extract based on the description you provided.
228
+ The model can generate up to 30 seconds of audio in one pass. It is now possible
229
+ to extend the generation by feeding back the end of the previous chunk of audio.
230
+ This can take a long time, and the model might lose consistency. The model might also
231
+ decide at arbitrary positions that the song ends.
232
+
233
+ **WARNING:** Choosing long durations will take a long time to generate (2min might take ~10min). An overlap of 12 seconds
234
+ is kept with the previously generated chunk, and 18 "new" seconds are generated each time.
235
+
236
+ We present 4 model variations:
237
+ 1. Melody -- a music generation model capable of generating music condition on text and melody inputs. **Note**, you can also use text only.
238
+ 2. Small -- a 300M transformer decoder conditioned on text only.
239
+ 3. Medium -- a 1.5B transformer decoder conditioned on text only.
240
+ 4. Large -- a 3.3B transformer decoder conditioned on text only (might OOM for the longest sequences.)
241
+
242
+ When using `melody`, ou can optionaly provide a reference audio from
243
+ which a broad melody will be extracted. The model will then try to follow both the description and melody provided.
244
+
245
+ You can also use your own GPU or a Google Colab by following the instructions on our repo.
246
+ See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)
247
+ for more details.
248
+ """
249
+ )
250
+
251
+ interface.queue().launch(**launch_kwargs)
252
+
253
+
254
+ def ui_batched(launch_kwargs):
255
+ with gr.Blocks() as demo:
256
+ gr.Markdown(
257
+ """
258
+ # MusicGen
259
+
260
+ This is the demo for [MusicGen](https://github.com/facebookresearch/audiocraft), a simple and controllable model for music generation
261
+ presented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284).
262
+ <br/>
263
+ <a href="https://huggingface.co/spaces/facebook/MusicGen?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
264
+ <img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
265
+ for longer sequences, more control and no queue.</p>
266
+ """
267
+ )
268
+ with gr.Row():
269
+ with gr.Column():
270
+ with gr.Row():
271
+ text = gr.Text(label="Describe your music", lines=2, interactive=True)
272
+ melody = gr.Audio(source="upload", type="numpy", label="Condition on a melody (optional)", interactive=True)
273
+ with gr.Row():
274
+ submit = gr.Button("Generate")
275
+ with gr.Column():
276
+ output = gr.Video(label="Generated Music")
277
+ submit.click(predict_batched, inputs=[text, melody], outputs=[output], batch=True, max_batch_size=MAX_BATCH_SIZE)
278
+ gr.Examples(
279
+ fn=predict_batched,
280
+ examples=[
281
+ [
282
+ "An 80s driving pop song with heavy drums and synth pads in the background",
283
+ "./assets/bach.mp3",
284
+ ],
285
+ [
286
+ "A cheerful country song with acoustic guitars",
287
+ "./assets/bolero_ravel.mp3",
288
+ ],
289
+ [
290
+ "90s rock song with electric guitar and heavy drums",
291
+ None,
292
+ ],
293
+ [
294
+ "a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions bpm: 130",
295
+ "./assets/bach.mp3",
296
+ ],
297
+ [
298
+ "lofi slow bpm electro chill with organic samples",
299
+ None,
300
+ ],
301
+ ],
302
+ inputs=[text, melody],
303
+ outputs=[output]
304
+ )
305
+ gr.Markdown("""
306
+ ### More details
307
+
308
+ The model will generate 12 seconds of audio based on the description you provided.
309
+ You can optionaly provide a reference audio from which a broad melody will be extracted.
310
+ The model will then try to follow both the description and melody provided.
311
+ All samples are generated with the `melody` model.
312
+
313
+ You can also use your own GPU or a Google Colab by following the instructions on our repo.
314
+
315
+ See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)
316
+ for more details.
317
+ """)
318
+
319
+ demo.queue(max_size=8 * 4).launch(**launch_kwargs)
320
+
321
+
322
+ if __name__ == "__main__":
323
+ parser = argparse.ArgumentParser()
324
+ parser.add_argument(
325
+ '--listen',
326
+ type=str,
327
+ default='0.0.0.0' if 'SPACE_ID' in os.environ else '127.0.0.1',
328
+ help='IP to listen on for connections to Gradio',
329
+ )
330
+ parser.add_argument(
331
+ '--username', type=str, default='', help='Username for authentication'
332
+ )
333
+ parser.add_argument(
334
+ '--password', type=str, default='', help='Password for authentication'
335
+ )
336
+ parser.add_argument(
337
+ '--server_port',
338
+ type=int,
339
+ default=0,
340
+ help='Port to run the server listener on',
341
+ )
342
+ parser.add_argument(
343
+ '--inbrowser', action='store_true', help='Open in browser'
344
+ )
345
+ parser.add_argument(
346
+ '--share', action='store_true', help='Share the gradio UI'
347
+ )
348
+
349
+ args = parser.parse_args()
350
+
351
+ launch_kwargs = {}
352
+ launch_kwargs['server_name'] = args.listen
353
+
354
+ if args.username and args.password:
355
+ launch_kwargs['auth'] = (args.username, args.password)
356
+ if args.server_port:
357
+ launch_kwargs['server_port'] = args.server_port
358
+ if args.inbrowser:
359
+ launch_kwargs['inbrowser'] = args.inbrowser
360
+ if args.share:
361
+ launch_kwargs['share'] = args.share
362
+
363
+ # Show the interface
364
+ if IS_BATCHED:
365
+ ui_batched(launch_kwargs)
366
+ else:
367
+ ui_full(launch_kwargs)
audiocraft/assets/bach.mp3 ADDED
Binary file (160 kB). View file
 
audiocraft/assets/bolero_ravel.mp3 ADDED
Binary file (161 kB). View file
 
audiocraft/audiocraft/__init__.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
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
+ # flake8: noqa
8
+ from . import data, modules, models
9
+
10
+ __version__ = '0.0.2a2'
audiocraft/audiocraft/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (227 Bytes). View file
 
audiocraft/audiocraft/data/__init__.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
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
+ # flake8: noqa
8
+ from . import audio, audio_dataset
audiocraft/audiocraft/data/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (194 Bytes). View file
 
audiocraft/audiocraft/data/__pycache__/audio.cpython-310.pyc ADDED
Binary file (7.53 kB). View file
 
audiocraft/audiocraft/data/__pycache__/audio_dataset.cpython-310.pyc ADDED
Binary file (19.1 kB). View file
 
audiocraft/audiocraft/data/__pycache__/audio_utils.cpython-310.pyc ADDED
Binary file (6.23 kB). View file
 
audiocraft/audiocraft/data/__pycache__/zip.cpython-310.pyc ADDED
Binary file (2.54 kB). View file
 
audiocraft/audiocraft/data/audio.py ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """
8
+ Audio IO methods are defined in this module (info, read, write),
9
+ We rely on av library for faster read when possible, otherwise on torchaudio.
10
+ """
11
+
12
+ from dataclasses import dataclass
13
+ from pathlib import Path
14
+ import logging
15
+ import typing as tp
16
+
17
+ import numpy as np
18
+ import soundfile
19
+ import torch
20
+ from torch.nn import functional as F
21
+ import torchaudio as ta
22
+
23
+ import av
24
+
25
+ from .audio_utils import f32_pcm, i16_pcm, normalize_audio
26
+
27
+
28
+ _av_initialized = False
29
+
30
+
31
+ def _init_av():
32
+ global _av_initialized
33
+ if _av_initialized:
34
+ return
35
+ logger = logging.getLogger('libav.mp3')
36
+ logger.setLevel(logging.ERROR)
37
+ _av_initialized = True
38
+
39
+
40
+ @dataclass(frozen=True)
41
+ class AudioFileInfo:
42
+ sample_rate: int
43
+ duration: float
44
+ channels: int
45
+
46
+
47
+ def _av_info(filepath: tp.Union[str, Path]) -> AudioFileInfo:
48
+ _init_av()
49
+ with av.open(str(filepath)) as af:
50
+ stream = af.streams.audio[0]
51
+ sample_rate = stream.codec_context.sample_rate
52
+ duration = float(stream.duration * stream.time_base)
53
+ channels = stream.channels
54
+ return AudioFileInfo(sample_rate, duration, channels)
55
+
56
+
57
+ def _soundfile_info(filepath: tp.Union[str, Path]) -> AudioFileInfo:
58
+ info = soundfile.info(filepath)
59
+ return AudioFileInfo(info.samplerate, info.duration, info.channels)
60
+
61
+
62
+ def audio_info(filepath: tp.Union[str, Path]) -> AudioFileInfo:
63
+ # torchaudio no longer returns useful duration informations for some formats like mp3s.
64
+ filepath = Path(filepath)
65
+ if filepath.suffix in ['.flac', '.ogg']: # TODO: Validate .ogg can be safely read with av_info
66
+ # ffmpeg has some weird issue with flac.
67
+ return _soundfile_info(filepath)
68
+ else:
69
+ return _av_info(filepath)
70
+
71
+
72
+ def _av_read(filepath: tp.Union[str, Path], seek_time: float = 0, duration: float = -1.) -> tp.Tuple[torch.Tensor, int]:
73
+ """FFMPEG-based audio file reading using PyAV bindings.
74
+ Soundfile cannot read mp3 and av_read is more efficient than torchaudio.
75
+
76
+ Args:
77
+ filepath (str or Path): Path to audio file to read.
78
+ seek_time (float): Time at which to start reading in the file.
79
+ duration (float): Duration to read from the file. If set to -1, the whole file is read.
80
+ Returns:
81
+ Tuple[torch.Tensor, int]: Tuple containing audio data and sample rate
82
+ """
83
+ _init_av()
84
+ with av.open(str(filepath)) as af:
85
+ stream = af.streams.audio[0]
86
+ sr = stream.codec_context.sample_rate
87
+ num_frames = int(sr * duration) if duration >= 0 else -1
88
+ frame_offset = int(sr * seek_time)
89
+ # we need a small negative offset otherwise we get some edge artifact
90
+ # from the mp3 decoder.
91
+ af.seek(int(max(0, (seek_time - 0.1)) / stream.time_base), stream=stream)
92
+ frames = []
93
+ length = 0
94
+ for frame in af.decode(streams=stream.index):
95
+ current_offset = int(frame.rate * frame.pts * frame.time_base)
96
+ strip = max(0, frame_offset - current_offset)
97
+ buf = torch.from_numpy(frame.to_ndarray())
98
+ if buf.shape[0] != stream.channels:
99
+ buf = buf.view(-1, stream.channels).t()
100
+ buf = buf[:, strip:]
101
+ frames.append(buf)
102
+ length += buf.shape[1]
103
+ if num_frames > 0 and length >= num_frames:
104
+ break
105
+ assert frames
106
+ # If the above assert fails, it is likely because we seeked past the end of file point,
107
+ # in which case ffmpeg returns a single frame with only zeros, and a weird timestamp.
108
+ # This will need proper debugging, in due time.
109
+ wav = torch.cat(frames, dim=1)
110
+ assert wav.shape[0] == stream.channels
111
+ if num_frames > 0:
112
+ wav = wav[:, :num_frames]
113
+ return f32_pcm(wav), sr
114
+
115
+
116
+ def audio_read(filepath: tp.Union[str, Path], seek_time: float = 0.,
117
+ duration: float = -1., pad: bool = False) -> tp.Tuple[torch.Tensor, int]:
118
+ """Read audio by picking the most appropriate backend tool based on the audio format.
119
+
120
+ Args:
121
+ filepath (str or Path): Path to audio file to read.
122
+ seek_time (float): Time at which to start reading in the file.
123
+ duration (float): Duration to read from the file. If set to -1, the whole file is read.
124
+ pad (bool): Pad output audio if not reaching expected duration.
125
+ Returns:
126
+ Tuple[torch.Tensor, int]: Tuple containing audio data and sample rate.
127
+ """
128
+ fp = Path(filepath)
129
+ if fp.suffix in ['.flac', '.ogg']: # TODO: check if we can safely use av_read for .ogg
130
+ # There is some bug with ffmpeg and reading flac
131
+ info = _soundfile_info(filepath)
132
+ frames = -1 if duration <= 0 else int(duration * info.sample_rate)
133
+ frame_offset = int(seek_time * info.sample_rate)
134
+ wav, sr = soundfile.read(filepath, start=frame_offset, frames=frames, dtype=np.float32)
135
+ assert info.sample_rate == sr, f"Mismatch of sample rates {info.sample_rate} {sr}"
136
+ wav = torch.from_numpy(wav).t().contiguous()
137
+ if len(wav.shape) == 1:
138
+ wav = torch.unsqueeze(wav, 0)
139
+ elif (
140
+ fp.suffix in ['.wav', '.mp3'] and fp.suffix[1:] in ta.utils.sox_utils.list_read_formats()
141
+ and duration <= 0 and seek_time == 0
142
+ ):
143
+ # Torchaudio is faster if we load an entire file at once.
144
+ wav, sr = ta.load(fp)
145
+ else:
146
+ wav, sr = _av_read(filepath, seek_time, duration)
147
+ if pad and duration > 0:
148
+ expected_frames = int(duration * sr)
149
+ wav = F.pad(wav, (0, expected_frames - wav.shape[-1]))
150
+ return wav, sr
151
+
152
+
153
+ def audio_write(stem_name: tp.Union[str, Path],
154
+ wav: torch.Tensor, sample_rate: int,
155
+ format: str = 'wav', mp3_rate: int = 320, normalize: bool = True,
156
+ strategy: str = 'peak', peak_clip_headroom_db: float = 1,
157
+ rms_headroom_db: float = 18, loudness_headroom_db: float = 14,
158
+ loudness_compressor: bool = False,
159
+ log_clipping: bool = True, make_parent_dir: bool = True,
160
+ add_suffix: bool = True) -> Path:
161
+ """Convenience function for saving audio to disk. Returns the filename the audio was written to.
162
+
163
+ Args:
164
+ stem_name (str or Path): Filename without extension which will be added automatically.
165
+ format (str): Either "wav" or "mp3".
166
+ mp3_rate (int): kbps when using mp3s.
167
+ normalize (bool): if `True` (default), normalizes according to the prescribed
168
+ strategy (see after). If `False`, the strategy is only used in case clipping
169
+ would happen.
170
+ strategy (str): Can be either 'clip', 'peak', or 'rms'. Default is 'peak',
171
+ i.e. audio is normalized by its largest value. RMS normalizes by root-mean-square
172
+ with extra headroom to avoid clipping. 'clip' just clips.
173
+ peak_clip_headroom_db (float): Headroom in dB when doing 'peak' or 'clip' strategy.
174
+ rms_headroom_db (float): Headroom in dB when doing 'rms' strategy. This must be much larger
175
+ than the `peak_clip` one to avoid further clipping.
176
+ loudness_headroom_db (float): Target loudness for loudness normalization.
177
+ loudness_compressor (bool): Uses tanh for soft clipping when strategy is 'loudness'.
178
+ when strategy is 'loudness'log_clipping (bool): If True, basic logging on stderr when clipping still
179
+ occurs despite strategy (only for 'rms').
180
+ make_parent_dir (bool): Make parent directory if it doesn't exist.
181
+ Returns:
182
+ Path: Path of the saved audio.
183
+ """
184
+ assert wav.dtype.is_floating_point, "wav is not floating point"
185
+ if wav.dim() == 1:
186
+ wav = wav[None]
187
+ elif wav.dim() > 2:
188
+ raise ValueError("Input wav should be at most 2 dimension.")
189
+ assert wav.isfinite().all()
190
+ wav = normalize_audio(wav, normalize, strategy, peak_clip_headroom_db,
191
+ rms_headroom_db, loudness_headroom_db, log_clipping=log_clipping,
192
+ sample_rate=sample_rate, stem_name=str(stem_name))
193
+ kwargs: dict = {}
194
+ if format == 'mp3':
195
+ suffix = '.mp3'
196
+ kwargs.update({"compression": mp3_rate})
197
+ elif format == 'wav':
198
+ wav = i16_pcm(wav)
199
+ suffix = '.wav'
200
+ kwargs.update({"encoding": "PCM_S", "bits_per_sample": 16})
201
+ else:
202
+ raise RuntimeError(f"Invalid format {format}. Only wav or mp3 are supported.")
203
+ if not add_suffix:
204
+ suffix = ''
205
+ path = Path(str(stem_name) + suffix)
206
+ if make_parent_dir:
207
+ path.parent.mkdir(exist_ok=True, parents=True)
208
+ try:
209
+ ta.save(path, wav, sample_rate, **kwargs)
210
+ except Exception:
211
+ if path.exists():
212
+ # we do not want to leave half written files around.
213
+ path.unlink()
214
+ raise
215
+ return path
audiocraft/audiocraft/data/audio_dataset.py ADDED
@@ -0,0 +1,525 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import argparse
8
+ import copy
9
+ from concurrent.futures import ThreadPoolExecutor, Future
10
+ from dataclasses import dataclass, fields
11
+ from contextlib import ExitStack
12
+ import gzip
13
+ import json
14
+ import logging
15
+ import os
16
+ from pathlib import Path
17
+ import random
18
+ import sys
19
+ import typing as tp
20
+
21
+ import torch
22
+ import torch.nn.functional as F
23
+
24
+ from .audio import audio_read, audio_info
25
+ from .audio_utils import convert_audio
26
+ from .zip import PathInZip
27
+
28
+ try:
29
+ import dora
30
+ except ImportError:
31
+ dora = None # type: ignore
32
+
33
+
34
+ @dataclass(order=True)
35
+ class BaseInfo:
36
+
37
+ @classmethod
38
+ def _dict2fields(cls, dictionary: dict):
39
+ return {
40
+ field.name: dictionary[field.name]
41
+ for field in fields(cls) if field.name in dictionary
42
+ }
43
+
44
+ @classmethod
45
+ def from_dict(cls, dictionary: dict):
46
+ _dictionary = cls._dict2fields(dictionary)
47
+ return cls(**_dictionary)
48
+
49
+ def to_dict(self):
50
+ return {
51
+ field.name: self.__getattribute__(field.name)
52
+ for field in fields(self)
53
+ }
54
+
55
+
56
+ @dataclass(order=True)
57
+ class AudioMeta(BaseInfo):
58
+ path: str
59
+ duration: float
60
+ sample_rate: int
61
+ amplitude: tp.Optional[float] = None
62
+ weight: tp.Optional[float] = None
63
+ # info_path is used to load additional information about the audio file that is stored in zip files.
64
+ info_path: tp.Optional[PathInZip] = None
65
+
66
+ @classmethod
67
+ def from_dict(cls, dictionary: dict):
68
+ base = cls._dict2fields(dictionary)
69
+ if 'info_path' in base and base['info_path'] is not None:
70
+ base['info_path'] = PathInZip(base['info_path'])
71
+ return cls(**base)
72
+
73
+ def to_dict(self):
74
+ d = super().to_dict()
75
+ if d['info_path'] is not None:
76
+ d['info_path'] = str(d['info_path'])
77
+ return d
78
+
79
+
80
+ @dataclass(order=True)
81
+ class SegmentInfo(BaseInfo):
82
+ meta: AudioMeta
83
+ seek_time: float
84
+ n_frames: int # actual number of frames without padding
85
+ total_frames: int # total number of frames, padding included
86
+ sample_rate: int # actual sample rate
87
+
88
+
89
+ DEFAULT_EXTS = ['.wav', '.mp3', '.flac', '.ogg', '.m4a']
90
+
91
+ logger = logging.getLogger(__name__)
92
+
93
+
94
+ def _get_audio_meta(file_path: str, minimal: bool = True) -> AudioMeta:
95
+ """AudioMeta from a path to an audio file.
96
+
97
+ Args:
98
+ file_path (str): Resolved path of valid audio file.
99
+ minimal (bool): Whether to only load the minimal set of metadata (takes longer if not).
100
+ Returns:
101
+ AudioMeta: Audio file path and its metadata.
102
+ """
103
+ info = audio_info(file_path)
104
+ amplitude: tp.Optional[float] = None
105
+ if not minimal:
106
+ wav, sr = audio_read(file_path)
107
+ amplitude = wav.abs().max().item()
108
+ return AudioMeta(file_path, info.duration, info.sample_rate, amplitude)
109
+
110
+
111
+ def _resolve_audio_meta(m: AudioMeta, fast: bool = True) -> AudioMeta:
112
+ """If Dora is available as a dependency, try to resolve potential relative paths
113
+ in list of AudioMeta. This method is expected to be used when loading meta from file.
114
+
115
+ Args:
116
+ m (AudioMeta): Audio meta to resolve.
117
+ fast (bool): If True, uses a really fast check for determining if a file is already absolute or not.
118
+ Only valid on Linux/Mac.
119
+ Returns:
120
+ AudioMeta: Audio meta with resolved path.
121
+ """
122
+ def is_abs(m):
123
+ if fast:
124
+ return str(m)[0] == '/'
125
+ else:
126
+ os.path.isabs(str(m))
127
+
128
+ if not dora:
129
+ return m
130
+
131
+ if not is_abs(m.path):
132
+ m.path = dora.git_save.to_absolute_path(m.path)
133
+ if m.info_path is not None and not is_abs(m.info_path.zip_path):
134
+ m.info_path.zip_path = dora.git_save.to_absolute_path(m.path)
135
+ return m
136
+
137
+
138
+ def find_audio_files(path: tp.Union[Path, str],
139
+ exts: tp.List[str] = DEFAULT_EXTS,
140
+ resolve: bool = True,
141
+ minimal: bool = True,
142
+ progress: bool = False,
143
+ workers: int = 0) -> tp.List[AudioMeta]:
144
+ """Build a list of AudioMeta from a given path,
145
+ collecting relevant audio files and fetching meta info.
146
+
147
+ Args:
148
+ path (str or Path): Path to folder containing audio files.
149
+ exts (list of str): List of file extensions to consider for audio files.
150
+ minimal (bool): Whether to only load the minimal set of metadata (takes longer if not).
151
+ progress (bool): Whether to log progress on audio files collection.
152
+ workers (int): number of parallel workers, if 0, use only the current thread.
153
+ Returns:
154
+ List[AudioMeta]: List of audio file path and its metadata.
155
+ """
156
+ audio_files = []
157
+ futures: tp.List[Future] = []
158
+ pool: tp.Optional[ThreadPoolExecutor] = None
159
+ with ExitStack() as stack:
160
+ if workers > 0:
161
+ pool = ThreadPoolExecutor(workers)
162
+ stack.enter_context(pool)
163
+
164
+ if progress:
165
+ print("Finding audio files...")
166
+ for root, folders, files in os.walk(path, followlinks=True):
167
+ for file in files:
168
+ full_path = Path(root) / file
169
+ if full_path.suffix.lower() in exts:
170
+ audio_files.append(full_path)
171
+ if pool is not None:
172
+ futures.append(pool.submit(_get_audio_meta, str(audio_files[-1]), minimal))
173
+ if progress:
174
+ print(format(len(audio_files), " 8d"), end='\r', file=sys.stderr)
175
+
176
+ if progress:
177
+ print("Getting audio metadata...")
178
+ meta: tp.List[AudioMeta] = []
179
+ for idx, file_path in enumerate(audio_files):
180
+ try:
181
+ if pool is None:
182
+ m = _get_audio_meta(str(file_path), minimal)
183
+ else:
184
+ m = futures[idx].result()
185
+ if resolve:
186
+ m = _resolve_audio_meta(m)
187
+ except Exception as err:
188
+ print("Error with", str(file_path), err, file=sys.stderr)
189
+ continue
190
+ meta.append(m)
191
+ if progress:
192
+ print(format((1 + idx) / len(audio_files), " 3.1%"), end='\r', file=sys.stderr)
193
+ meta.sort()
194
+ return meta
195
+
196
+
197
+ def load_audio_meta(path: tp.Union[str, Path],
198
+ resolve: bool = True, fast: bool = True) -> tp.List[AudioMeta]:
199
+ """Load list of AudioMeta from an optionally compressed json file.
200
+
201
+ Args:
202
+ path (str or Path): Path to JSON file.
203
+ resolve (bool): Whether to resolve the path from AudioMeta (default=True).
204
+ fast (bool): activates some tricks to make things faster.
205
+ Returns:
206
+ List[AudioMeta]: List of audio file path and its total duration.
207
+ """
208
+ open_fn = gzip.open if str(path).lower().endswith('.gz') else open
209
+ with open_fn(path, 'rb') as fp: # type: ignore
210
+ lines = fp.readlines()
211
+ meta = []
212
+ for line in lines:
213
+ d = json.loads(line)
214
+ m = AudioMeta.from_dict(d)
215
+ if resolve:
216
+ m = _resolve_audio_meta(m, fast=fast)
217
+ meta.append(m)
218
+ return meta
219
+
220
+
221
+ def save_audio_meta(path: tp.Union[str, Path], meta: tp.List[AudioMeta]):
222
+ """Save the audio metadata to the file pointer as json.
223
+
224
+ Args:
225
+ path (str or Path): Path to JSON file.
226
+ metadata (list of BaseAudioMeta): List of audio meta to save.
227
+ """
228
+ Path(path).parent.mkdir(exist_ok=True, parents=True)
229
+ open_fn = gzip.open if str(path).lower().endswith('.gz') else open
230
+ with open_fn(path, 'wb') as fp: # type: ignore
231
+ for m in meta:
232
+ json_str = json.dumps(m.to_dict()) + '\n'
233
+ json_bytes = json_str.encode('utf-8')
234
+ fp.write(json_bytes)
235
+
236
+
237
+ class AudioDataset:
238
+ """Base audio dataset.
239
+
240
+ The dataset takes a list of AudioMeta and create a dataset composed of segments of audio
241
+ and potentially additional information, by creating random segments from the list of audio
242
+ files referenced in the metadata and applying minimal data pre-processing such as resampling,
243
+ mixing of channels, padding, etc.
244
+
245
+ If no segment_duration value is provided, the AudioDataset will return the full wav for each
246
+ audio file. Otherwise, it will randomly sample audio files and create a segment of the specified
247
+ duration, applying padding if required.
248
+
249
+ By default, only the torch Tensor corresponding to the waveform is returned. Setting return_info=True
250
+ allows to return a tuple containing the torch Tensor and additional metadata on the segment and the
251
+ original audio meta.
252
+
253
+ Args:
254
+ meta (tp.List[AudioMeta]): List of audio files metadata.
255
+ segment_duration (float): Optional segment duration of audio to load.
256
+ If not specified, the dataset will load the full audio segment from the file.
257
+ shuffle (bool): Set to `True` to have the data reshuffled at every epoch.
258
+ sample_rate (int): Target sample rate of the loaded audio samples.
259
+ channels (int): Target number of channels of the loaded audio samples.
260
+ sample_on_duration (bool): Set to `True` to sample segments with probability
261
+ dependent on audio file duration. This is only used if `segment_duration` is provided.
262
+ sample_on_weight (bool): Set to `True` to sample segments using the `weight` entry of
263
+ `AudioMeta`. If `sample_on_duration` is also True, the actual weight will be the product
264
+ of the file duration and file weight. This is only used if `segment_duration` is provided.
265
+ min_segment_ratio (float): Minimum segment ratio to use when the audio file
266
+ is shorter than the desired segment.
267
+ max_read_retry (int): Maximum number of retries to sample an audio segment from the dataset.
268
+ return_info (bool): Whether to return the wav only or return wav along with segment info and metadata.
269
+ min_audio_duration (tp.Optional[float], optional): Minimum audio file duration, in seconds, if provided
270
+ audio shorter than this will be filtered out.
271
+ max_audio_duration (tp.Optional[float], optional): Maximal audio file duration in seconds, if provided
272
+ audio longer than this will be filtered out.
273
+ """
274
+ def __init__(self,
275
+ meta: tp.List[AudioMeta],
276
+ segment_duration: tp.Optional[float] = None,
277
+ shuffle: bool = True,
278
+ num_samples: int = 10_000,
279
+ sample_rate: int = 48_000,
280
+ channels: int = 2,
281
+ pad: bool = True,
282
+ sample_on_duration: bool = True,
283
+ sample_on_weight: bool = True,
284
+ min_segment_ratio: float = 0.5,
285
+ max_read_retry: int = 10,
286
+ return_info: bool = False,
287
+ min_audio_duration: tp.Optional[float] = None,
288
+ max_audio_duration: tp.Optional[float] = None
289
+ ):
290
+ assert len(meta) > 0, 'No audio meta provided to AudioDataset. Please check loading of audio meta.'
291
+ assert segment_duration is None or segment_duration > 0
292
+ assert segment_duration is None or min_segment_ratio >= 0
293
+ logging.debug(f'sample_on_duration: {sample_on_duration}')
294
+ logging.debug(f'sample_on_weight: {sample_on_weight}')
295
+ logging.debug(f'pad: {pad}')
296
+ logging.debug(f'min_segment_ratio: {min_segment_ratio}')
297
+
298
+ self.segment_duration = segment_duration
299
+ self.min_segment_ratio = min_segment_ratio
300
+ self.max_audio_duration = max_audio_duration
301
+ self.min_audio_duration = min_audio_duration
302
+ if self.min_audio_duration is not None and self.max_audio_duration is not None:
303
+ assert self.min_audio_duration <= self.max_audio_duration
304
+ self.meta: tp.List[AudioMeta] = self._filter_duration(meta)
305
+ assert len(self.meta) # Fail fast if all data has been filtered.
306
+ self.total_duration = sum(d.duration for d in self.meta)
307
+
308
+ if segment_duration is None:
309
+ num_samples = len(self.meta)
310
+ self.num_samples = num_samples
311
+ self.shuffle = shuffle
312
+ self.sample_rate = sample_rate
313
+ self.channels = channels
314
+ self.pad = pad
315
+ self.sample_on_weight = sample_on_weight
316
+ self.sample_on_duration = sample_on_duration
317
+ self.sampling_probabilities = self._get_sampling_probabilities()
318
+ self.max_read_retry = max_read_retry
319
+ self.return_info = return_info
320
+
321
+ def __len__(self):
322
+ return self.num_samples
323
+
324
+ def _get_sampling_probabilities(self, normalized: bool = True):
325
+ """Return the sampling probabilities for each file inside `self.meta`.
326
+ """
327
+ scores: tp.List[float] = []
328
+ for file_meta in self.meta:
329
+ score = 1.
330
+ if self.sample_on_weight and file_meta.weight is not None:
331
+ score *= file_meta.weight
332
+ if self.sample_on_duration:
333
+ score *= file_meta.duration
334
+ scores.append(score)
335
+ probabilities = torch.tensor(scores)
336
+ if normalized:
337
+ probabilities /= probabilities.sum()
338
+ return probabilities
339
+
340
+ def sample_file(self, rng: torch.Generator) -> AudioMeta:
341
+ """Sample a given file from `self.meta`. Can be overriden in subclasses.
342
+ This is only called if `segment_duration` is not None.
343
+
344
+ You must use the provided random number generator `rng` for reproducibility.
345
+ """
346
+ if not self.sample_on_weight and not self.sample_on_duration:
347
+ file_index = int(torch.randint(len(self.sampling_probabilities), (1,), generator=rng).item())
348
+ else:
349
+ file_index = int(torch.multinomial(self.sampling_probabilities, 1, generator=rng).item())
350
+
351
+ return self.meta[file_index]
352
+
353
+ def __getitem__(self, index: int) -> tp.Union[torch.Tensor, tp.Tuple[torch.Tensor, SegmentInfo]]:
354
+ if self.segment_duration is None:
355
+ file_meta = self.meta[index]
356
+ out, sr = audio_read(file_meta.path)
357
+ out = convert_audio(out, sr, self.sample_rate, self.channels)
358
+ n_frames = out.shape[-1]
359
+ segment_info = SegmentInfo(file_meta, seek_time=0., n_frames=n_frames, total_frames=n_frames,
360
+ sample_rate=self.sample_rate)
361
+ else:
362
+ rng = torch.Generator()
363
+ if self.shuffle:
364
+ # We use index, plus extra randomness
365
+ rng.manual_seed(index + self.num_samples * random.randint(0, 2**24))
366
+ else:
367
+ # We only use index
368
+ rng.manual_seed(index)
369
+
370
+ for retry in range(self.max_read_retry):
371
+ file_meta = self.sample_file(rng)
372
+ # We add some variance in the file position even if audio file is smaller than segment
373
+ # without ending up with empty segments
374
+ max_seek = max(0, file_meta.duration - self.segment_duration * self.min_segment_ratio)
375
+ seek_time = torch.rand(1, generator=rng).item() * max_seek
376
+ try:
377
+ out, sr = audio_read(file_meta.path, seek_time, self.segment_duration, pad=False)
378
+ out = convert_audio(out, sr, self.sample_rate, self.channels)
379
+ n_frames = out.shape[-1]
380
+ target_frames = int(self.segment_duration * self.sample_rate)
381
+ if self.pad:
382
+ out = F.pad(out, (0, target_frames - n_frames))
383
+ segment_info = SegmentInfo(file_meta, seek_time, n_frames=n_frames, total_frames=target_frames,
384
+ sample_rate=self.sample_rate)
385
+ except Exception as exc:
386
+ logger.warning("Error opening file %s: %r", file_meta.path, exc)
387
+ if retry == self.max_read_retry - 1:
388
+ raise
389
+ else:
390
+ break
391
+
392
+ if self.return_info:
393
+ # Returns the wav and additional information on the wave segment
394
+ return out, segment_info
395
+ else:
396
+ return out
397
+
398
+ def collater(self, samples):
399
+ """The collater function has to be provided to the dataloader
400
+ if AudioDataset has return_info=True in order to properly collate
401
+ the samples of a batch.
402
+ """
403
+ if self.segment_duration is None and len(samples) > 1:
404
+ assert self.pad, "Must allow padding when batching examples of different durations."
405
+
406
+ # In this case the audio reaching the collater is of variable length as segment_duration=None.
407
+ to_pad = self.segment_duration is None and self.pad
408
+ if to_pad:
409
+ max_len = max([wav.shape[-1] for wav, _ in samples])
410
+
411
+ def _pad_wav(wav):
412
+ return F.pad(wav, (0, max_len - wav.shape[-1]))
413
+
414
+ if self.return_info:
415
+ if len(samples) > 0:
416
+ assert len(samples[0]) == 2
417
+ assert isinstance(samples[0][0], torch.Tensor)
418
+ assert isinstance(samples[0][1], SegmentInfo)
419
+
420
+ wavs = [wav for wav, _ in samples]
421
+ segment_infos = [copy.deepcopy(info) for _, info in samples]
422
+
423
+ if to_pad:
424
+ # Each wav could be of a different duration as they are not segmented.
425
+ for i in range(len(samples)):
426
+ # Determines the total legth of the signal with padding, so we update here as we pad.
427
+ segment_infos[i].total_frames = max_len
428
+ wavs[i] = _pad_wav(wavs[i])
429
+
430
+ wav = torch.stack(wavs)
431
+ return wav, segment_infos
432
+ else:
433
+ assert isinstance(samples[0], torch.Tensor)
434
+ if to_pad:
435
+ samples = [_pad_wav(s) for s in samples]
436
+ return torch.stack(samples)
437
+
438
+ def _filter_duration(self, meta: tp.List[AudioMeta]) -> tp.List[AudioMeta]:
439
+ """Filters out audio files with short durations.
440
+ Removes from meta files that have durations that will not allow to samples examples from them.
441
+ """
442
+ orig_len = len(meta)
443
+
444
+ # Filter data that is too short.
445
+ if self.min_audio_duration is not None:
446
+ meta = [m for m in meta if m.duration >= self.min_audio_duration]
447
+
448
+ # Filter data that is too long.
449
+ if self.max_audio_duration is not None:
450
+ meta = [m for m in meta if m.duration <= self.max_audio_duration]
451
+
452
+ filtered_len = len(meta)
453
+ removed_percentage = 100*(1-float(filtered_len)/orig_len)
454
+ msg = 'Removed %.2f percent of the data because it was too short or too long.' % removed_percentage
455
+ if removed_percentage < 10:
456
+ logging.debug(msg)
457
+ else:
458
+ logging.warning(msg)
459
+ return meta
460
+
461
+ @classmethod
462
+ def from_meta(cls, root: tp.Union[str, Path], **kwargs):
463
+ """Instantiate AudioDataset from a path to a directory containing a manifest as a jsonl file.
464
+
465
+ Args:
466
+ root (str or Path): Path to root folder containing audio files.
467
+ kwargs: Additional keyword arguments for the AudioDataset.
468
+ """
469
+ root = Path(root)
470
+ if root.is_dir():
471
+ if (root / 'data.jsonl').exists():
472
+ root = root / 'data.jsonl'
473
+ elif (root / 'data.jsonl.gz').exists():
474
+ root = root / 'data.jsonl.gz'
475
+ else:
476
+ raise ValueError("Don't know where to read metadata from in the dir. "
477
+ "Expecting either a data.jsonl or data.jsonl.gz file but none found.")
478
+ meta = load_audio_meta(root)
479
+ return cls(meta, **kwargs)
480
+
481
+ @classmethod
482
+ def from_path(cls, root: tp.Union[str, Path], minimal_meta: bool = True,
483
+ exts: tp.List[str] = DEFAULT_EXTS, **kwargs):
484
+ """Instantiate AudioDataset from a path containing (possibly nested) audio files.
485
+
486
+ Args:
487
+ root (str or Path): Path to root folder containing audio files.
488
+ minimal_meta (bool): Whether to only load minimal metadata or not.
489
+ exts (list of str): Extensions for audio files.
490
+ kwargs: Additional keyword arguments for the AudioDataset.
491
+ """
492
+ root = Path(root)
493
+ if root.is_file():
494
+ meta = load_audio_meta(root, resolve=True)
495
+ else:
496
+ meta = find_audio_files(root, exts, minimal=minimal_meta, resolve=True)
497
+ return cls(meta, **kwargs)
498
+
499
+
500
+ def main():
501
+ logging.basicConfig(stream=sys.stderr, level=logging.INFO)
502
+ parser = argparse.ArgumentParser(
503
+ prog='audio_dataset',
504
+ description='Generate .jsonl files by scanning a folder.')
505
+ parser.add_argument('root', help='Root folder with all the audio files')
506
+ parser.add_argument('output_meta_file',
507
+ help='Output file to store the metadata, ')
508
+ parser.add_argument('--complete',
509
+ action='store_false', dest='minimal', default=True,
510
+ help='Retrieve all metadata, even the one that are expansive '
511
+ 'to compute (e.g. normalization).')
512
+ parser.add_argument('--resolve',
513
+ action='store_true', default=False,
514
+ help='Resolve the paths to be absolute and with no symlinks.')
515
+ parser.add_argument('--workers',
516
+ default=10, type=int,
517
+ help='Number of workers.')
518
+ args = parser.parse_args()
519
+ meta = find_audio_files(args.root, DEFAULT_EXTS, progress=True,
520
+ resolve=args.resolve, minimal=args.minimal, workers=args.workers)
521
+ save_audio_meta(args.output_meta_file, meta)
522
+
523
+
524
+ if __name__ == '__main__':
525
+ main()
audiocraft/audiocraft/data/audio_utils.py ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import sys
8
+ import typing as tp
9
+
10
+ import julius
11
+ import torch
12
+ import torchaudio
13
+
14
+
15
+ def convert_audio_channels(wav: torch.Tensor, channels: int = 2) -> torch.Tensor:
16
+ """Convert audio to the given number of channels.
17
+
18
+ Args:
19
+ wav (torch.Tensor): Audio wave of shape [B, C, T].
20
+ channels (int): Expected number of channels as output.
21
+ Returns:
22
+ torch.Tensor: Downmixed or unchanged audio wave [B, C, T].
23
+ """
24
+ *shape, src_channels, length = wav.shape
25
+ if src_channels == channels:
26
+ pass
27
+ elif channels == 1:
28
+ # Case 1:
29
+ # The caller asked 1-channel audio, and the stream has multiple
30
+ # channels, downmix all channels.
31
+ wav = wav.mean(dim=-2, keepdim=True)
32
+ elif src_channels == 1:
33
+ # Case 2:
34
+ # The caller asked for multiple channels, but the input file has
35
+ # a single channel, replicate the audio over all channels.
36
+ wav = wav.expand(*shape, channels, length)
37
+ elif src_channels >= channels:
38
+ # Case 3:
39
+ # The caller asked for multiple channels, and the input file has
40
+ # more channels than requested. In that case return the first channels.
41
+ wav = wav[..., :channels, :]
42
+ else:
43
+ # Case 4: What is a reasonable choice here?
44
+ raise ValueError('The audio file has less channels than requested but is not mono.')
45
+ return wav
46
+
47
+
48
+ def convert_audio(wav: torch.Tensor, from_rate: float,
49
+ to_rate: float, to_channels: int) -> torch.Tensor:
50
+ """Convert audio to new sample rate and number of audio channels.
51
+ """
52
+ wav = julius.resample_frac(wav, int(from_rate), int(to_rate))
53
+ wav = convert_audio_channels(wav, to_channels)
54
+ return wav
55
+
56
+
57
+ def normalize_loudness(wav: torch.Tensor, sample_rate: int, loudness_headroom_db: float = 14,
58
+ loudness_compressor: bool = False, energy_floor: float = 2e-3):
59
+ """Normalize an input signal to a user loudness in dB LKFS.
60
+ Audio loudness is defined according to the ITU-R BS.1770-4 recommendation.
61
+
62
+ Args:
63
+ wav (torch.Tensor): Input multichannel audio data.
64
+ sample_rate (int): Sample rate.
65
+ loudness_headroom_db (float): Target loudness of the output in dB LUFS.
66
+ loudness_compressor (bool): Uses tanh for soft clipping.
67
+ energy_floor (float): anything below that RMS level will not be rescaled.
68
+ Returns:
69
+ output (torch.Tensor): Loudness normalized output data.
70
+ """
71
+ energy = wav.pow(2).mean().sqrt().item()
72
+ if energy < energy_floor:
73
+ return wav
74
+ transform = torchaudio.transforms.Loudness(sample_rate)
75
+ input_loudness_db = transform(wav).item()
76
+ # calculate the gain needed to scale to the desired loudness level
77
+ delta_loudness = -loudness_headroom_db - input_loudness_db
78
+ gain = 10.0 ** (delta_loudness / 20.0)
79
+ output = gain * wav
80
+ if loudness_compressor:
81
+ output = torch.tanh(output)
82
+ assert output.isfinite().all(), (input_loudness_db, wav.pow(2).mean().sqrt())
83
+ return output
84
+
85
+
86
+ def _clip_wav(wav: torch.Tensor, log_clipping: bool = False, stem_name: tp.Optional[str] = None) -> None:
87
+ """Utility function to clip the audio with logging if specified."""
88
+ max_scale = wav.abs().max()
89
+ if log_clipping and max_scale > 1:
90
+ clamp_prob = (wav.abs() > 1).float().mean().item()
91
+ print(f"CLIPPING {stem_name or ''} happening with proba (a bit of clipping is okay):",
92
+ clamp_prob, "maximum scale: ", max_scale.item(), file=sys.stderr)
93
+ wav.clamp_(-1, 1)
94
+
95
+
96
+ def normalize_audio(wav: torch.Tensor, normalize: bool = True,
97
+ strategy: str = 'peak', peak_clip_headroom_db: float = 1,
98
+ rms_headroom_db: float = 18, loudness_headroom_db: float = 14,
99
+ loudness_compressor: bool = False, log_clipping: bool = False,
100
+ sample_rate: tp.Optional[int] = None,
101
+ stem_name: tp.Optional[str] = None) -> torch.Tensor:
102
+ """Normalize the audio according to the prescribed strategy (see after).
103
+
104
+ Args:
105
+ wav (torch.Tensor): Audio data.
106
+ normalize (bool): if `True` (default), normalizes according to the prescribed
107
+ strategy (see after). If `False`, the strategy is only used in case clipping
108
+ would happen.
109
+ strategy (str): Can be either 'clip', 'peak', or 'rms'. Default is 'peak',
110
+ i.e. audio is normalized by its largest value. RMS normalizes by root-mean-square
111
+ with extra headroom to avoid clipping. 'clip' just clips.
112
+ peak_clip_headroom_db (float): Headroom in dB when doing 'peak' or 'clip' strategy.
113
+ rms_headroom_db (float): Headroom in dB when doing 'rms' strategy. This must be much larger
114
+ than the `peak_clip` one to avoid further clipping.
115
+ loudness_headroom_db (float): Target loudness for loudness normalization.
116
+ loudness_compressor (bool): If True, uses tanh based soft clipping.
117
+ log_clipping (bool): If True, basic logging on stderr when clipping still
118
+ occurs despite strategy (only for 'rms').
119
+ sample_rate (int): Sample rate for the audio data (required for loudness).
120
+ stem_name (Optional[str]): Stem name for clipping logging.
121
+ Returns:
122
+ torch.Tensor: Normalized audio.
123
+ """
124
+ scale_peak = 10 ** (-peak_clip_headroom_db / 20)
125
+ scale_rms = 10 ** (-rms_headroom_db / 20)
126
+ if strategy == 'peak':
127
+ rescaling = (scale_peak / wav.abs().max())
128
+ if normalize or rescaling < 1:
129
+ wav = wav * rescaling
130
+ elif strategy == 'clip':
131
+ wav = wav.clamp(-scale_peak, scale_peak)
132
+ elif strategy == 'rms':
133
+ mono = wav.mean(dim=0)
134
+ rescaling = scale_rms / mono.pow(2).mean().sqrt()
135
+ if normalize or rescaling < 1:
136
+ wav = wav * rescaling
137
+ _clip_wav(wav, log_clipping=log_clipping, stem_name=stem_name)
138
+ elif strategy == 'loudness':
139
+ assert sample_rate is not None, "Loudness normalization requires sample rate."
140
+ wav = normalize_loudness(wav, sample_rate, loudness_headroom_db, loudness_compressor)
141
+ _clip_wav(wav, log_clipping=log_clipping, stem_name=stem_name)
142
+ else:
143
+ assert wav.abs().max() < 1
144
+ assert strategy == '' or strategy == 'none', f"Unexpected strategy: '{strategy}'"
145
+ return wav
146
+
147
+
148
+ def f32_pcm(wav: torch.Tensor) -> torch.Tensor:
149
+ """Convert audio to float 32 bits PCM format.
150
+ """
151
+ if wav.dtype.is_floating_point:
152
+ return wav
153
+ else:
154
+ assert wav.dtype == torch.int16
155
+ return wav.float() / 2**15
156
+
157
+
158
+ def i16_pcm(wav: torch.Tensor) -> torch.Tensor:
159
+ """Convert audio to int 16 bits PCM format.
160
+
161
+ ..Warning:: There exist many formula for doing this convertion. None are perfect
162
+ due to the asymetry of the int16 range. One either have possible clipping, DC offset,
163
+ or inconsistancies with f32_pcm. If the given wav doesn't have enough headroom,
164
+ it is possible that `i16_pcm(f32_pcm)) != Identity`.
165
+ """
166
+ if wav.dtype.is_floating_point:
167
+ assert wav.abs().max() <= 1
168
+ candidate = (wav * 2 ** 15).round()
169
+ if candidate.max() >= 2 ** 15: # clipping would occur
170
+ candidate = (wav * (2 ** 15 - 1)).round()
171
+ return candidate.short()
172
+ else:
173
+ assert wav.dtype == torch.int16
174
+ return wav
audiocraft/audiocraft/data/zip.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import typing
8
+ import zipfile
9
+
10
+ from dataclasses import dataclass
11
+ from functools import lru_cache
12
+ from typing_extensions import Literal
13
+
14
+
15
+ DEFAULT_SIZE = 32
16
+ MODE = Literal['r', 'w', 'x', 'a']
17
+
18
+
19
+ @dataclass(order=True)
20
+ class PathInZip:
21
+ """Class for holding a path of file within a zip file.
22
+
23
+ Args:
24
+ path: The convention is <path_to_zip>:<relative_path_inside_zip>
25
+ Let's assume there is a zip file /some/location/foo.zip
26
+ and inside of it is a json file located at /data/file1.json,
27
+ Then we expect path = "/some/location/foo.zip:/data/file1.json"
28
+ """
29
+
30
+ INFO_PATH_SEP = ':'
31
+ zip_path: str
32
+ file_path: str
33
+
34
+ def __init__(self, path: str) -> None:
35
+ split_path = path.split(self.INFO_PATH_SEP)
36
+ assert len(split_path) == 2
37
+ self.zip_path, self.file_path = split_path
38
+
39
+ @classmethod
40
+ def from_paths(cls, zip_path: str, file_path: str):
41
+ return cls(zip_path + cls.INFO_PATH_SEP + file_path)
42
+
43
+ def __str__(self) -> str:
44
+ return self.zip_path + self.INFO_PATH_SEP + self.file_path
45
+
46
+
47
+ def _open_zip(path: str, mode: MODE = 'r'):
48
+ return zipfile.ZipFile(path, mode)
49
+
50
+
51
+ _cached_open_zip = lru_cache(DEFAULT_SIZE)(_open_zip)
52
+
53
+
54
+ def set_zip_cache_size(max_size: int):
55
+ """Sets the maximal LRU caching for zip file opening.
56
+
57
+ Args:
58
+ max_size: the maximal LRU cache.
59
+ """
60
+ global _cached_open_zip
61
+ _cached_open_zip = lru_cache(max_size)(_open_zip)
62
+
63
+
64
+ def open_file_in_zip(path_in_zip: PathInZip, mode: str = 'r') -> typing.IO:
65
+ """Opens a file stored inside a zip and returns a file-like object.
66
+
67
+ Args:
68
+ path_in_zip: A PathInZip object representing the file to return a file-like object of.
69
+ mode: The mode in which to open the file with.
70
+ Returns:
71
+ A file-like object for PathInZip.
72
+ """
73
+ zf = _cached_open_zip(path_in_zip.zip_path)
74
+ return zf.open(path_in_zip.file_path)
audiocraft/audiocraft/models/__init__.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
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
+ # flake8: noqa
8
+ from .musicgen import MusicGen
9
+ from .lm import LMModel
10
+ from .encodec import CompressionModel, EncodecModel
audiocraft/audiocraft/models/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (288 Bytes). View file
 
audiocraft/audiocraft/models/__pycache__/builders.cpython-310.pyc ADDED
Binary file (6.84 kB). View file