Surn commited on
Commit
346c62e
·
1 Parent(s): 1ec1e0f
Files changed (3) hide show
  1. app.py +7 -1
  2. assets/background.png +3 -0
  3. assets/screenshot.png +3 -0
app.py CHANGED
@@ -253,7 +253,7 @@ def predict(model, text, melody_filepath, duration, dimension, topk, topp, tempe
253
  topp (float): Top-p sampling value.
254
  temperature (float): Sampling temperature.
255
  cfg_coef (float): Classifier-free guidance coefficient.
256
- background (str): Path to background image.
257
  title (str): Song title.
258
  settings_font (str): Path to font file.
259
  settings_font_color (str): Font color for settings text.
@@ -279,6 +279,12 @@ def predict(model, text, melody_filepath, duration, dimension, topk, topp, tempe
279
  melody_name = "Not Used"
280
  melody_extension = "Not Used"
281
  melody = None
 
 
 
 
 
 
282
  if melody_filepath:
283
  melody_name, melody_extension = get_filename_from_filepath(melody_filepath)
284
  melody = get_melody(melody_filepath)
 
253
  topp (float): Top-p sampling value.
254
  temperature (float): Sampling temperature.
255
  cfg_coef (float): Classifier-free guidance coefficient.
256
+ background (str): Path to background image. default to "./assets/background.png".
257
  title (str): Song title.
258
  settings_font (str): Path to font file.
259
  settings_font_color (str): Font color for settings text.
 
279
  melody_name = "Not Used"
280
  melody_extension = "Not Used"
281
  melody = None
282
+ if melody_filepath in ["None", ""]:
283
+ melody_filepath = None
284
+
285
+ if background in ["None", ""]:
286
+ background = "./assets/background.png"
287
+
288
  if melody_filepath:
289
  melody_name, melody_extension = get_filename_from_filepath(melody_filepath)
290
  melody = get_melody(melody_filepath)
assets/background.png ADDED

Git LFS Details

  • SHA256: 57bd81e3205bb7fe42a721b12c16ba064e8d122b96e7c5c46b310595f67fea2c
  • Pointer size: 130 Bytes
  • Size of remote file: 71.7 kB
assets/screenshot.png ADDED

Git LFS Details

  • SHA256: 89abfaffefc18124ffe8f0775eb4dcdbc589bb97befc76dd3f3fc48992991e2e
  • Pointer size: 131 Bytes
  • Size of remote file: 388 kB