Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
Topic: audio_to_audio
  • Loading branch information
hmartiro committed Jan 6, 2023
1 parent b58982d commit 7325bfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 10 additions & 6 deletions riffusion/streamlit/pages/audio_to_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ def increment_counter():
)

with st.expander("Clip Times"):
st.dataframe({
"Start Time [s]": clip_start_times,
"End Time [s]": clip_start_times + clip_duration_s,
"Duration [s]": clip_duration_s,
})
st.dataframe(
{
"Start Time [s]": clip_start_times,
"End Time [s]": clip_start_times + clip_duration_s,
"Duration [s]": clip_duration_s,
}
)

with st.form("Conversion Params"):

Expand Down Expand Up @@ -221,7 +223,9 @@ def increment_counter():
right.audio(audio_bytes)

if show_clip_details and show_difference:
diff_np = np.maximum(0, np.asarray(init_image).astype(np.float32) - np.asarray(image).astype(np.float32))
diff_np = np.maximum(
0, np.asarray(init_image).astype(np.float32) - np.asarray(image).astype(np.float32)
)
diff_image = Image.fromarray(255 - diff_np.astype(np.uint8))
diff_segment = streamlit_util.audio_segment_from_spectrogram_image(
image=diff_image,
Expand Down
6 changes: 4 additions & 2 deletions riffusion/streamlit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ def select_device(container: T.Any = st.sidebar) -> str:

device_options = ["cuda", "cpu", "mps"]
device = st.sidebar.selectbox(
"Device", options=device_options, index=device_options.index(default_device),
help="Which compute device to use. CUDA is recommended."
"Device",
options=device_options,
index=device_options.index(default_device),
help="Which compute device to use. CUDA is recommended.",
)
assert device is not None

Expand Down

0 comments on commit 7325bfa

Please sign in to comment.