Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ genres = ["Pop", "Rock", "Jazz", "Electronic", "Hip-Hop", "Classical", "Lofi", "
|
|
17 |
|
18 |
@st.cache_resource()
|
19 |
def load_model():
|
20 |
-
model = MusicGen.get_pretrained('facebook/musicgen-
|
21 |
return model
|
22 |
|
23 |
def generate_music_tensors(descriptions, duration: int):
|
@@ -68,7 +68,7 @@ st.set_page_config(
|
|
68 |
)
|
69 |
|
70 |
def main():
|
71 |
-
st.title("π§ AI Composer
|
72 |
|
73 |
st.subheader("Craft your perfect melody!")
|
74 |
bpm = st.number_input("Enter Speed in BPM", min_value=60)
|
@@ -88,14 +88,15 @@ def main():
|
|
88 |
if st.button('Let\'s Generate πΆ'):
|
89 |
st.text('\n\n')
|
90 |
st.subheader("Generated Music")
|
|
|
91 |
|
92 |
# Generate audio
|
93 |
-
description = text_area # Initialize description with text_area
|
94 |
-
if selected_genre:
|
95 |
-
|
96 |
-
|
97 |
-
if bpm:
|
98 |
-
|
99 |
# if mood:
|
100 |
# description += f" {mood}"
|
101 |
# st.empty() # Hide the mood selectbox after selecting one option
|
|
|
17 |
|
18 |
@st.cache_resource()
|
19 |
def load_model():
|
20 |
+
model = MusicGen.get_pretrained('facebook/musicgen-small')
|
21 |
return model
|
22 |
|
23 |
def generate_music_tensors(descriptions, duration: int):
|
|
|
68 |
)
|
69 |
|
70 |
def main():
|
71 |
+
st.title("π§ AI Composer Small-Model π§")
|
72 |
|
73 |
st.subheader("Craft your perfect melody!")
|
74 |
bpm = st.number_input("Enter Speed in BPM", min_value=60)
|
|
|
88 |
if st.button('Let\'s Generate πΆ'):
|
89 |
st.text('\n\n')
|
90 |
st.subheader("Generated Music")
|
91 |
+
descriptions = [f"{text_area} {selected_genre} {bpm} BPM" for _ in range(1)] # Change the batch size to 1
|
92 |
|
93 |
# Generate audio
|
94 |
+
# description = text_area # Initialize description with text_area
|
95 |
+
# if selected_genre:
|
96 |
+
# description += f" {selected_genre}"
|
97 |
+
# st.empty() # Hide the selected_genre selectbox after selecting one option
|
98 |
+
# if bpm:
|
99 |
+
# description += f" {bpm} BPM"
|
100 |
# if mood:
|
101 |
# description += f" {mood}"
|
102 |
# st.empty() # Hide the mood selectbox after selecting one option
|