fffiloni commited on
Commit
5d268f5
1 Parent(s): d7477e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -36,9 +36,7 @@ def get_track_by_tags(tags, pat, duration, maxit=20, loop=False):
36
  for i in range(maxit):
37
  r = httpx.get(trackurl)
38
  if r.status_code == 200:
39
- data = open(r, "r").read()
40
- encoded = base64.b64encode(data)
41
- return encoded
42
  time.sleep(1)
43
 
44
 
@@ -46,7 +44,9 @@ def generate_track_by_prompt(prompt):
46
  try:
47
  pat = get_pat("[email protected]")
48
  _, tags = get_tags_for_prompts(minilm, mubert_tags_embeddings, [prompt, ])[0]
49
- return get_track_by_tags(tags, pat, int(30), loop=False)
 
 
50
  except Exception as e:
51
  return str(e)
52
 
 
36
  for i in range(maxit):
37
  r = httpx.get(trackurl)
38
  if r.status_code == 200:
39
+ return trackurl
 
 
40
  time.sleep(1)
41
 
42
 
 
44
  try:
45
  pat = get_pat("[email protected]")
46
  _, tags = get_tags_for_prompts(minilm, mubert_tags_embeddings, [prompt, ])[0]
47
+ result = get_track_by_tags(tags, pat, int(30), loop=False)
48
+ print(result)
49
+ return result
50
  except Exception as e:
51
  return str(e)
52