ec98 commited on
Commit
52e8a76
1 Parent(s): 5642475

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -24
app.py CHANGED
@@ -146,16 +146,17 @@ def main():
146
  model=''
147
  pesos=''
148
 
149
- option = st.selectbox(
150
- "Elige con que modelo entrenar",
151
- ("Maestro", "Lakh"))
152
-
153
- option_musica = st.selectbox(
154
- "Elige instrumento a generar las melodias",
155
- ("Piano", "Chromatic Percussion", "Organ", "Guitar", "Bass", "Strings", "Ensemble", "Brass",
156
- "Reed", "Pipe", "Synth Lead", "Synth Pad", "Synth Effects", "Ethnic", "Percussive", "Sound Effects"))
157
-
158
- num_predictions = st.number_input("Ingrese el número de notas:", min_value=100, max_value=150, value=120, step=1)
 
159
 
160
  if uploaded_file and option is not None:
161
 
@@ -182,7 +183,9 @@ def main():
182
  st.write(f"La duración del archivo MIDI subido es: {int(minutos)}:{int(segundos):02d}")
183
 
184
  st.subheader("Modelo elegido:")
185
- st.write(option)
 
 
186
 
187
  # Cargar modelo y pesos
188
  with custom_object_scope({'mse_with_positive_pressure': mse_with_positive_pressure}):
@@ -260,19 +263,20 @@ def main():
260
  st.title("Generador de notas musicales")
261
 
262
  archivo_midi = open(out_file, 'rb').read()
263
-
264
- st.download_button(
265
- label="Descargar MIDI",
266
- data=archivo_midi,
267
- file_name=out_file, # Nombre del archivo que se descargará
268
- mime='audio/midi'
269
- )
270
-
271
- # Duracion del MIDI resultante
272
- duracion_f = calcular_duracion_midi(out_file)
273
- minutos_f, segundos_f = divmod(duracion_f, 60)
274
-
275
- st.write(f"La duración del archivo MIDI resultante es: {int(minutos_f)}:{int(segundos_f):02d}")
 
276
 
277
  if __name__ == "__main__":
278
  main()
 
146
  model=''
147
  pesos=''
148
 
149
+ with st.container(height = None, border = True):
150
+ option = st.selectbox(
151
+ "Elige con que modelo entrenar",
152
+ ("Maestro", "Lakh"))
153
+
154
+ option_musica = st.selectbox(
155
+ "Elige instrumento a generar las melodias",
156
+ ("Piano", "Chromatic Percussion", "Organ", "Guitar", "Bass", "Strings", "Ensemble", "Brass",
157
+ "Reed", "Pipe", "Synth Lead", "Synth Pad", "Synth Effects", "Ethnic", "Percussive", "Sound Effects"))
158
+
159
+ num_predictions = st.number_input("Ingrese el número de notas:", min_value=100, max_value=150, value=120, step=1)
160
 
161
  if uploaded_file and option is not None:
162
 
 
183
  st.write(f"La duración del archivo MIDI subido es: {int(minutos)}:{int(segundos):02d}")
184
 
185
  st.subheader("Modelo elegido:")
186
+
187
+ with st.container(height = None, border = True):
188
+ st.write(option, f" de tipo instrumental ", option_musica)
189
 
190
  # Cargar modelo y pesos
191
  with custom_object_scope({'mse_with_positive_pressure': mse_with_positive_pressure}):
 
263
  st.title("Generador de notas musicales")
264
 
265
  archivo_midi = open(out_file, 'rb').read()
266
+
267
+ with st.container(height = None, border = True):
268
+ st.download_button(
269
+ label="Descargar MIDI",
270
+ data=archivo_midi,
271
+ file_name=out_file, # Nombre del archivo que se descargará
272
+ mime='audio/midi'
273
+ )
274
+
275
+ # Duracion del MIDI resultante
276
+ duracion_f = calcular_duracion_midi(out_file)
277
+ minutos_f, segundos_f = divmod(duracion_f, 60)
278
+
279
+ st.write(f"La duración del archivo MIDI resultante es: {int(minutos_f)}:{int(segundos_f):02d}")
280
 
281
  if __name__ == "__main__":
282
  main()