-
Notifications
You must be signed in to change notification settings - Fork 1
/
my_app.py
41 lines (34 loc) · 1.39 KB
/
my_app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import time
from utils.utils import *
def main():
st.sidebar.title("What to do:")
app_mode = st.sidebar.radio("Go to", ["Introduction", "Data Analysis",
"Model Description", "Predictions"])
if app_mode == "Data Analysis":
st.title("Data Analysis of MIDI Files")
select_action = st.sidebar.selectbox("Select function", ["Choose", "Data Info",
"Raw MIDI", "Tokenized MIDI", "Play MIDI"])
data_functions(select_action)
elif app_mode == "Model Description":
phase = st.sidebar.selectbox("Choose Phase", ["Phase I", "Phase II"])
if phase == "Phase I":
st.title("Phase I")
print_phase1()
else:
st.title("Phase II")
print_phase2()
elif app_mode == "Predictions":
st.title("Music Generation Predictions")
st.info("This section will help you listen and visualize the predictions/inferences made by the \
trained model.")
which_play = st.sidebar.selectbox("Choose Music Model", ["Reddit Pop Model", "Lakh Midi Model"])
if which_play == "Lakh Midi Model":
play_pred("pred_lmd")
else:
play_pred("pred_reddit")
elif app_mode == "Introduction":
print_intro()
intro()
if __name__ == "__main__":
main()