Spaces:
Sleeping
Sleeping
Commit
·
a53a38a
1
Parent(s):
4530f58
Init!
Browse files
app.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
from pathlib import Path
|
14 |
+
import subprocess as sp
|
15 |
+
from tempfile import NamedTemporaryFile
|
16 |
+
import time
|
17 |
+
import warnings
|
18 |
+
import glob
|
19 |
+
import re
|
20 |
+
from PIL import Image
|
21 |
+
from pydub import AudioSegment
|
22 |
+
from datetime import datetime
|
23 |
+
|
24 |
+
import json
|
25 |
+
import shutil
|
26 |
+
import taglib
|
27 |
+
import torch
|
28 |
+
import torchaudio
|
29 |
+
import gradio as gr
|
30 |
+
import numpy as np
|
31 |
+
import typing as tp
|
32 |
+
|
33 |
+
from audiocraft.data.audio_utils import convert_audio
|
34 |
+
from audiocraft.data.audio import audio_write
|
35 |
+
from audiocraft.models import AudioGen, MusicGen, MultiBandDiffusion
|
36 |
+
from audiocraft.utils import ui
|
37 |
+
import random, string
|
38 |
+
|
39 |
+
version = "2.0.0a"
|
40 |
+
|
41 |
+
theme = gr.themes.Glass(
|
42 |
+
primary_hue="stone",
|
43 |
+
secondary_hue="teal",
|
44 |
+
neutral_hue="stone",
|