Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
c524fd85
Commit
c524fd85
authored
Dec 05, 2022
by
Patrick von Platen
Browse files
correct librosa import
parent
62b497c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
src/diffusers/pipelines/audio_diffusion/mel.py
src/diffusers/pipelines/audio_diffusion/mel.py
+16
-1
No files found.
src/diffusers/pipelines/audio_diffusion/mel.py
View file @
c524fd85
...
@@ -23,7 +23,19 @@ warnings.filterwarnings("ignore")
...
@@ -23,7 +23,19 @@ warnings.filterwarnings("ignore")
import
numpy
as
np
# noqa: E402
import
numpy
as
np
# noqa: E402
import
librosa
# noqa: E402
try
:
import
librosa
# noqa: E402
_librosa_can_be_imported
=
True
_import_error
=
""
except
Exception
as
e
:
_librosa_can_be_imported
=
False
_import_error
=
(
f
"Cannot import librosa because
{
e
}
. Make sure to correctly install librosa to be able to install it."
)
from
PIL
import
Image
# noqa: E402
from
PIL
import
Image
# noqa: E402
...
@@ -60,6 +72,9 @@ class Mel(ConfigMixin, SchedulerMixin):
...
@@ -60,6 +72,9 @@ class Mel(ConfigMixin, SchedulerMixin):
self
.
set_resolution
(
x_res
,
y_res
)
self
.
set_resolution
(
x_res
,
y_res
)
self
.
audio
=
None
self
.
audio
=
None
if
not
_librosa_can_be_imported
:
raise
ValueError
(
_import_error
)
def
set_resolution
(
self
,
x_res
:
int
,
y_res
:
int
):
def
set_resolution
(
self
,
x_res
:
int
,
y_res
:
int
):
"""Set resolution.
"""Set resolution.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment