Spaces:
Runtime error
Runtime error
spaceinvader
commited on
Commit
β’
aa6e3c5
1
Parent(s):
9b36524
disable safety checker
Browse files
app.py
CHANGED
@@ -19,6 +19,8 @@ pipe2 = pipe2.to(device)
|
|
19 |
|
20 |
spectro_from_wav = gr.Interface.load("spaces/fffiloni/audio-to-spectrogram")
|
21 |
|
|
|
|
|
22 |
def predict(prompt, negative_prompt, audio_input, duration):
|
23 |
# if audio_input == None :
|
24 |
return classic(prompt, negative_prompt, duration)
|
@@ -26,6 +28,7 @@ def predict(prompt, negative_prompt, audio_input, duration):
|
|
26 |
# return style_transfer(prompt, negative_prompt, audio_input)
|
27 |
|
28 |
def classic(prompt, negative_prompt, duration):
|
|
|
29 |
spec = pipe(prompt, negative_prompt=negative_prompt, height=512, width=512).images[0]
|
30 |
print(spec)
|
31 |
wav = wav_bytes_from_spectrogram_image(spec)
|
|
|
19 |
|
20 |
spectro_from_wav = gr.Interface.load("spaces/fffiloni/audio-to-spectrogram")
|
21 |
|
22 |
+
def dummy_checker(images, **kwargs): return images, False
|
23 |
+
|
24 |
def predict(prompt, negative_prompt, audio_input, duration):
|
25 |
# if audio_input == None :
|
26 |
return classic(prompt, negative_prompt, duration)
|
|
|
28 |
# return style_transfer(prompt, negative_prompt, audio_input)
|
29 |
|
30 |
def classic(prompt, negative_prompt, duration):
|
31 |
+
pipe.safety_checker = dummy_checker
|
32 |
spec = pipe(prompt, negative_prompt=negative_prompt, height=512, width=512).images[0]
|
33 |
print(spec)
|
34 |
wav = wav_bytes_from_spectrogram_image(spec)
|