Spaces:
Running
Running
Update app.py
#2
by
XZZ123888
- opened
app.py
CHANGED
@@ -257,7 +257,7 @@ self._train_state.params, batch, jax.random.PRNGKey(seed))
|
|
257 |
"""从音频计算频谱图帧。"""
|
258 |
print(f"[{current_time()}] 运行:从音频计算频谱图帧")
|
259 |
frame_size = self.spectrogram_config.hop_width
|
260 |
-
padding = [0, frame_size
|
261 |
audio = np.pad(audio, padding, mode='constant')
|
262 |
frames = spectrograms.split_audio(audio, self.spectrogram_config)
|
263 |
num_frames = len(audio) // frame_size
|
@@ -324,13 +324,6 @@ examples=[['canon.flac'], ['download.wav']]
|
|
324 |
|
325 |
gr.Interface(
|
326 |
inference,
|
327 |
-
gr.
|
328 |
-
|
329 |
-
title=title,
|
330 |
-
description=description,
|
331 |
-
article=article,
|
332 |
-
examples=examples,
|
333 |
-
allow_flagging=False,
|
334 |
-
allow_screenshot=False,
|
335 |
-
enable_queue=True
|
336 |
).launch()
|
|
|
257 |
"""从音频计算频谱图帧。"""
|
258 |
print(f"[{current_time()}] 运行:从音频计算频谱图帧")
|
259 |
frame_size = self.spectrogram_config.hop_width
|
260 |
+
padding = [0, frame_size - len(audio) % frame_size]
|
261 |
audio = np.pad(audio, padding, mode='constant')
|
262 |
frames = spectrograms.split_audio(audio, self.spectrogram_config)
|
263 |
num_frames = len(audio) // frame_size
|
|
|
324 |
|
325 |
gr.Interface(
|
326 |
inference,
|
327 |
+
gr.Audio(type="filepath",label="输入"),
|
328 |
+
outputs="file",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
).launch()
|