Spaces:
Sleeping
Sleeping
show prompt and target separately
Browse files
app.py
CHANGED
@@ -20,22 +20,32 @@ def main():
|
|
20 |
label="Record ID",
|
21 |
min_value=0,
|
22 |
max_value=len(dataset) - 1,
|
23 |
-
value=
|
24 |
)
|
25 |
|
26 |
record = dataset[record_idx]
|
27 |
piece = MidiPiece.from_huggingface(record)
|
|
|
28 |
|
29 |
piece_split = piano_task.prompt_target_split(piece.df)
|
30 |
|
31 |
source_piece = MidiPiece(df=piece_split.source_df)
|
32 |
target_piece = MidiPiece(df=piece_split.target_df)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
streamlit_pianoroll.from_fortepyan(
|
35 |
piece=source_piece,
|
36 |
secondary_piece=target_piece,
|
37 |
)
|
38 |
-
st.json(piece.source)
|
39 |
|
40 |
|
41 |
if __name__ == "__main__":
|
|
|
20 |
label="Record ID",
|
21 |
min_value=0,
|
22 |
max_value=len(dataset) - 1,
|
23 |
+
value=43,
|
24 |
)
|
25 |
|
26 |
record = dataset[record_idx]
|
27 |
piece = MidiPiece.from_huggingface(record)
|
28 |
+
st.json(piece.source)
|
29 |
|
30 |
piece_split = piano_task.prompt_target_split(piece.df)
|
31 |
|
32 |
source_piece = MidiPiece(df=piece_split.source_df)
|
33 |
target_piece = MidiPiece(df=piece_split.target_df)
|
34 |
|
35 |
+
cols = st.columns(2)
|
36 |
+
with cols[0]:
|
37 |
+
st.write("## Prompt")
|
38 |
+
streamlit_pianoroll.from_fortepyan(source_piece)
|
39 |
+
|
40 |
+
with cols[1]:
|
41 |
+
st.write("## Target")
|
42 |
+
streamlit_pianoroll.from_fortepyan(target_piece)
|
43 |
+
|
44 |
+
st.write("## Combined")
|
45 |
streamlit_pianoroll.from_fortepyan(
|
46 |
piece=source_piece,
|
47 |
secondary_piece=target_piece,
|
48 |
)
|
|
|
49 |
|
50 |
|
51 |
if __name__ == "__main__":
|