nakas commited on
Commit
9549644
1 Parent(s): 3f47174

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +5 -9
utils.py CHANGED
@@ -10,7 +10,7 @@ import tensorflow as tf
10
  from tensorflow.python.framework import random_seed
11
  import gradio as gr
12
  from scipy.io.wavfile import write as write_wav
13
- import soundfile as sf
14
 
15
  class Utils_functions:
16
  def __init__(self, args):
@@ -620,17 +620,13 @@ class Utils_functions:
620
  ),
621
  -2,
622
  )
623
- ##encode a wav file using scipy
624
- # wav, sr = librosa.load("test.wav", sr=self.args.sr)
625
- filepath = "tmp/newwav.wav"
626
- sf.write(filepath, np.int16(abwvc * 32767.0, self.args.sr)
627
-
628
  return (
629
  np.clip(spec, -1.0, 1.0),
630
- filepath,
631
  )
632
 
633
- def render_gradio(self, models_ls_1, models_ls_2, models_ls_3, train=True):
634
  article_text = "Original work by Marco Pasini ([Twitter](https://twitter.com/marco_ppasini)) at the Institute of Computational Perception, JKU Linz. Supervised by Jan Schlüter."
635
 
636
  def gradio_func(genre, x, y):
@@ -668,7 +664,7 @@ class Utils_functions:
668
  ],
669
  outputs=[
670
  gr.Image(label="Log-MelSpectrogram of Generated Audio (first 23 s)"),
671
- gr.Audio(type="filepath", label="Generated Audio"),
672
  ],
673
  title="musika!",
674
  description="Blazingly Fast 44.1 kHz Stereo Waveform Music Generation of Arbitrary Length. Be patient and enjoy the weirdness!",
 
10
  from tensorflow.python.framework import random_seed
11
  import gradio as gr
12
  from scipy.io.wavfile import write as write_wav
13
+
14
 
15
  class Utils_functions:
16
  def __init__(self, args):
 
620
  ),
621
  -2,
622
  )
623
+
 
 
 
 
624
  return (
625
  np.clip(spec, -1.0, 1.0),
626
+ (self.args.sr, np.int16(abwvc * 32767.0)),
627
  )
628
 
629
+ def render_gradio(self, models_ls_1, models_ls_2, models_ls_3, train=True):
630
  article_text = "Original work by Marco Pasini ([Twitter](https://twitter.com/marco_ppasini)) at the Institute of Computational Perception, JKU Linz. Supervised by Jan Schlüter."
631
 
632
  def gradio_func(genre, x, y):
 
664
  ],
665
  outputs=[
666
  gr.Image(label="Log-MelSpectrogram of Generated Audio (first 23 s)"),
667
+ gr.Audio(type="numpy", label="Generated Audio"),
668
  ],
669
  title="musika!",
670
  description="Blazingly Fast 44.1 kHz Stereo Waveform Music Generation of Arbitrary Length. Be patient and enjoy the weirdness!",