Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,6 @@ import os.path
|
|
5 |
import PIL
|
6 |
import PIL.ImageColor
|
7 |
import gradio as gr
|
8 |
-
import gradio_client.utils as gr_processing_utils
|
9 |
import numpy as np
|
10 |
import onnxruntime as rt
|
11 |
import tqdm
|
@@ -17,18 +16,6 @@ from midi_tokenizer import MIDITokenizer
|
|
17 |
|
18 |
in_space = os.getenv("SYSTEM") == "spaces"
|
19 |
|
20 |
-
audio_postprocess_ori = gr.Audio.postprocess
|
21 |
-
|
22 |
-
|
23 |
-
def audio_postprocess(self, y):
|
24 |
-
data = audio_postprocess_ori(self, y)
|
25 |
-
if data is None:
|
26 |
-
return None
|
27 |
-
return gr_processing_utils.encode_url_or_file_to_base64(data["name"])
|
28 |
-
|
29 |
-
|
30 |
-
gr.Audio.postprocess = audio_postprocess
|
31 |
-
|
32 |
|
33 |
def softmax(x, axis):
|
34 |
x_max = np.amax(x, axis=axis, keepdims=True)
|
|
|
5 |
import PIL
|
6 |
import PIL.ImageColor
|
7 |
import gradio as gr
|
|
|
8 |
import numpy as np
|
9 |
import onnxruntime as rt
|
10 |
import tqdm
|
|
|
16 |
|
17 |
in_space = os.getenv("SYSTEM") == "spaces"
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
def softmax(x, axis):
|
21 |
x_max = np.amax(x, axis=axis, keepdims=True)
|