Serhiy Stetskovych
commited on
Commit
·
ee15125
1
Parent(s):
e954330
fix model loading
Browse files- app.py +10 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -2,9 +2,18 @@ import gradio as gr
|
|
2 |
from audiosr import super_resolution, build_model
|
3 |
import spaces
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
@spaces.GPU
|
6 |
def inference(audio_file, model_name, guidance_scale, ddim_steps):
|
7 |
-
audiosr =
|
8 |
|
9 |
waveform = super_resolution(
|
10 |
audiosr,
|
|
|
2 |
from audiosr import super_resolution, build_model
|
3 |
import spaces
|
4 |
|
5 |
+
|
6 |
+
audiosr = build_model(model_name='basic')
|
7 |
+
audiosr_speech = build_model(model_name='speech')
|
8 |
+
|
9 |
+
models = {
|
10 |
+
'basic': audiosr,
|
11 |
+
'speech': audiosr_speech
|
12 |
+
}
|
13 |
+
|
14 |
@spaces.GPU
|
15 |
def inference(audio_file, model_name, guidance_scale, ddim_steps):
|
16 |
+
audiosr = models[model_name]
|
17 |
|
18 |
waveform = super_resolution(
|
19 |
audiosr,
|
requirements.txt
CHANGED
@@ -9,4 +9,5 @@ soundfile
|
|
9 |
progressbar
|
10 |
librosa
|
11 |
audiosr
|
12 |
-
unidecode
|
|
|
|
9 |
progressbar
|
10 |
librosa
|
11 |
audiosr
|
12 |
+
unidecode
|
13 |
+
matplotlib
|