deleteman commited on
Commit
62bb70d
1 Parent(s): 5708de0

removing empty lines from lyrics

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -159,6 +159,9 @@ def getPayload(index):
159
  }
160
 
161
 
 
 
 
162
 
163
  def greet(index, lyrics):
164
  url = API_HOST + "/v2/cloud/partners/ttsing"
@@ -167,7 +170,7 @@ def greet(index, lyrics):
167
  print("Calling api with "+ lyrics)
168
  print("URL: " + url)
169
 
170
- lines = lyrics.split("\n")
171
  #newLines = flattenLines(list(map(separate_syllables, lines)))
172
 
173
  payload = getPayload(index)
 
159
  }
160
 
161
 
162
+ def cleanUpLines(lines):
163
+ return list(filter(None, lines))
164
+
165
 
166
  def greet(index, lyrics):
167
  url = API_HOST + "/v2/cloud/partners/ttsing"
 
170
  print("Calling api with "+ lyrics)
171
  print("URL: " + url)
172
 
173
+ lines = cleanUpLines(lyrics.split("\n"))
174
  #newLines = flattenLines(list(map(separate_syllables, lines)))
175
 
176
  payload = getPayload(index)