SLAYEROFALL3050 commited on
Commit
611c15c
·
1 Parent(s): 4ed6c82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -51
app.py CHANGED
@@ -29,54 +29,37 @@ st.title("FIRE COML FALL 2022 Audio Generation Model")
29
 
30
  # --------------------------- MAIN
31
  # SELECT TYPE OF GENERATION
32
- option = st.selectbox("Select Generation type:", ("Sentence Based", "Tag Based"))
33
-
34
- # SENTENCE BASED
35
- if option == "Sentence Based":
36
- input_sentence = st.text_input("Enter a description for a song you want to hear:")
37
-
38
- # SUBMIT DESCRIPTION
39
- if st.button("Submit Description"):
40
- if input_sentence is not None and len(input_sentence) > 0:
41
- st.write("Here is the generated audio: ")
42
- st.write(input_sentence)
43
- else:
44
- st.write("Invalid Description")
45
-
46
- # TAG BASED
47
- else:
48
- st.write("Enter Genre(s), Mood/Theme(s), and Instrument(s)")
49
-
50
- instructions = "Press ENTER to add more"
51
-
52
- genre = st_tags(
53
- label = 'Enter Genre(s):',
54
- text = instructions,
55
- suggestions = GENRE_TAGS,
56
- maxtags = MAX_TAGS,
57
- key = '1'
58
- )
59
-
60
- mood = st_tags(
61
- label = 'Enter Mood/Theme(s):',
62
- text = instructions,
63
- suggestions = MOOD_TAGS,
64
- maxtags = MAX_TAGS,
65
- key = '2'
66
- )
67
-
68
- instrument = st_tags(
69
- label = 'Enter Instrument(s):',
70
- text = instructions,
71
- suggestions = INSTRUMENT_TAGS,
72
- maxtags = MAX_TAGS,
73
- key = '3'
74
- )
75
-
76
- # SUBMIT TAGS
77
- if st.button("Submit Tags"):
78
- st.write("Tags are:")
79
- inp = genre + mood + instrument
80
- st.write("Before: " + str(inp))
81
- input = get_nearest_tags(inp)
82
- st.write("After: " + str(input))
 
29
 
30
  # --------------------------- MAIN
31
  # SELECT TYPE OF GENERATION
32
+ st.write("Enter Genre(s), Mood/Theme(s), and Instrument(s)")
33
+ instructions = "Press ENTER to add more"
34
+
35
+ genre = st_tags(
36
+ label = 'Enter Genre(s):',
37
+ text = instructions,
38
+ suggestions = GENRE_TAGS,
39
+ maxtags = MAX_TAGS,
40
+ key = '1'
41
+ )
42
+
43
+ mood = st_tags(
44
+ label = 'Enter Mood/Theme(s):',
45
+ text = instructions,
46
+ suggestions = MOOD_TAGS,
47
+ maxtags = MAX_TAGS,
48
+ key = '2'
49
+ )
50
+
51
+ instrument = st_tags(
52
+ label = 'Enter Instrument(s):',
53
+ text = instructions,
54
+ suggestions = INSTRUMENT_TAGS,
55
+ maxtags = MAX_TAGS,
56
+ key = '3'
57
+ )
58
+
59
+ # SUBMIT TAGS
60
+ if st.button("Submit Tags"):
61
+ st.write("Tags are:")
62
+ inp = genre + mood + instrument
63
+ st.write("Before: " + str(inp))
64
+ input = get_nearest_tags(inp)
65
+ st.write("After: " + str(input))