Update main.py
Browse files
main.py
CHANGED
@@ -1,33 +1,18 @@
|
|
1 |
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
"
|
6 |
-
"
|
7 |
-
"
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"
|
16 |
-
"unidecode",
|
17 |
-
"pyloudnorm",
|
18 |
-
"pydub"]
|
19 |
-
|
20 |
-
import importlib
|
21 |
-
|
22 |
-
for m in mods:
|
23 |
-
try:
|
24 |
-
importlib.__import__(m.split('=')[0])
|
25 |
-
except Exception as e:
|
26 |
-
print(e)
|
27 |
-
subprocess.run(["uv", "pip", "install", m , "--system"])
|
28 |
-
importlib.__import__(m.split(r'(=|$)')[0])
|
29 |
-
continue
|
30 |
-
|
31 |
|
32 |
import gradio as gr
|
33 |
import torch
|
@@ -52,6 +37,8 @@ class AudioUpscaler:
|
|
52 |
Upscales audio using the AudioSR model.
|
53 |
"""
|
54 |
|
|
|
|
|
55 |
def __init__(self, model_name="basic", device="auto"):
|
56 |
"""
|
57 |
Initializes the AudioUpscaler.
|
@@ -394,8 +381,6 @@ class AudioUpscaler:
|
|
394 |
# return output_file
|
395 |
|
396 |
|
397 |
-
|
398 |
-
@spaces.GPU(duration=300)
|
399 |
def inference(audio_file, model_name, guidance_scale, ddim_steps, seed):
|
400 |
audiosr = build_model(model_name=model_name)
|
401 |
|
|
|
1 |
|
2 |
+
# mods = [
|
3 |
+
# "diffusers",
|
4 |
+
# "torch",
|
5 |
+
# "torchvision",
|
6 |
+
# "torchaudio",
|
7 |
+
# "transformers",
|
8 |
+
# "gradio",
|
9 |
+
# "soundfile",
|
10 |
+
# "progressbar",
|
11 |
+
# "librosa",
|
12 |
+
# "audiosr",
|
13 |
+
# "unidecode",
|
14 |
+
# "pyloudnorm",
|
15 |
+
# "pydub"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
import gradio as gr
|
18 |
import torch
|
|
|
37 |
Upscales audio using the AudioSR model.
|
38 |
"""
|
39 |
|
40 |
+
|
41 |
+
@spaces.GPU(duration=300)
|
42 |
def __init__(self, model_name="basic", device="auto"):
|
43 |
"""
|
44 |
Initializes the AudioUpscaler.
|
|
|
381 |
# return output_file
|
382 |
|
383 |
|
|
|
|
|
384 |
def inference(audio_file, model_name, guidance_scale, ddim_steps, seed):
|
385 |
audiosr = build_model(model_name=model_name)
|
386 |
|