Getting None in data
#9
by
ForEdu
- opened
Hello Bilal,
I'm getting None
as data while using the API. The following is the output I get:
[{'name': '/tmp/tmpskciyw7c/Audio_a5_zmev.wav', 'data': None, 'is_file': True}]
Can you help me on how to get the audio.
Sure.
You are getting the data. You just need to download it. Heres the code for it.
data[0]["name"]
='/tmp/tmpqgf93lui/Audiov8x7j621.wav
import urllib
url = "https://bilalsardar-voice-cloning.hf.space/file="+data[0]["name"]
save_as = "file.mp3"
data1 = urllib.request.urlopen(url)
f = open(save_as,'wb')
f.write(data1.read())
f.close()
Thank you, it's working fine!
(Had to wait for one message per day cooldown to reply here)
ForEdu
changed discussion status to
closed