9 with open(fname)
as infile:
10 return base64.b64encode(infile.read())
13 endpoint =
"https://snowboy.kitt.ai/api/v1/train/"
24 if __name__ ==
"__main__":
26 [_, wav1, wav2, wav3, out] = sys.argv
28 print "Usage: %s wave_file1 wave_file2 wave_file3 out_model_name" % sys.argv[0]
34 "age_group": age_group,
36 "microphone": microphone,
45 response = requests.post(endpoint, json=data)
47 with open(out,
"w")
as outfile:
48 outfile.write(response.content)
49 print "Saved model to '%s'." % out
51 print "Request failed."