Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Score #134

Open
josep112 opened this issue Feb 23, 2017 · 8 comments
Open

VS Score #134

josep112 opened this issue Feb 23, 2017 · 8 comments

Comments

@josep112
Copy link

I tried to create a template withhttps://snowboy.kitt.ai/api/v1/improve/ it because it has vs score but it gives error, someone already got it?

@xuchen
Copy link
Collaborator

xuchen commented Feb 28, 2017

what errors did you get?

@josep112
Copy link
Author

josep112 commented Mar 1, 2017

python demo.py testetrain2.pmdl
ERROR (ReadToken():snowboy-io.cc:131) Fail to read token in ReadToken(), position -1
terminate called after throwing an instance of 'std::runtime_error'
what(): ERROR (ReadToken():snowboy-io.cc:131) Fail to read token in ReadToken(), position -1

[stack trace: ]
/usr/src/snowboy/_snowboydetect.so(_ZN7snowboy13GetStackTraceEv+0x34) [0xb6874ad4]
/usr/src/snowboy/_snowboydetect.so(_ZN7snowboy13SnowboyLogMsgD1Ev+0x4b8) [0xb6875114]
/usr/src/snowboy/_snowboydetect.so(_ZN7snowboy9ReadTokenEbPSsPSi+0x12c) [0xb686779c]
/usr/src/snowboy/_snowboydetect.so(ZN7snowboy14PipelineDetect14ClassifyModelsERKSsPSsS3+0x20c) [0xb6859a14]
/usr/src/snowboy/_snowboydetect.so(_ZN7snowboy14PipelineDetect8SetModelERKSs+0x48) [0xb6859df4]
/usr/src/snowboy/_snowboydetect.so(ZN7snowboy13SnowboyDetectC1ERKSsS2+0x94) [0xb68502f0]
/usr/src/snowboy/_snowboydetect.so(+0x18aa8) [0xb684eaa8]

Aborted

@chenguoguo
Copy link
Collaborator

Seems like testetrain2.pmdl has been corrupted. It might be helpful If you post the model somewhere so that we can take a closer look. It's possible that something went wrong when you generate the hotword through API (e.g., the authentication token was not set correctly), in that case, the error will be written to testetrain2.pmdl in text mode and you should be able to open it using text editor.

@josep112
Copy link
Author

josep112 commented Mar 1, 2017

Hi,
The template I use works fine at https://snowboy.kitt.ai/api/v1/train/ but it does not work at https://snowboy.kitt.ai/api/v1/improve/, I put the zipped template In the link:
http://54.94.130.25/Painel_1.0/model.zip

@chenguoguo
Copy link
Collaborator

@josep112 model.zip contains the audio files, which looks fine to me. Could you share the testetrain2.pmdl file that caused the above error?

@josep112
Copy link
Author

josep112 commented Mar 2, 2017

Hi Chenguoguo,

import sys
import base64
import requests

def get_wave(fname):
with open(fname) as infile:
return base64.b64encode(infile.read())

endpoint = "https://snowboy.kitt.ai/api/v1/improve/"

############# MODIFY THE FOLLOWING #############
token = "bce111c29213b6fdb4073a8eaa6d0eed089xxxxx"
hotword_name = "josep112"
language = "pt"
age_group = "40_49"
gender = "M"
microphone = "macbook microphone"
############### END OF MODIFY ##################

if name == "main":
try:
[_, wav1, wav2, wav3, out] = sys.argv
except ValueError:
print "Usage: %s wave_file1 wave_file2 wave_file3 out_model_name" % sys.argv[0]
sys.exit()

data = {
    "name": hotword_name,
    "language": language,
    "age_group": age_group,
    "gender": gender,
    "microphone": microphone,
    "token": token,
    "voice_samples": [
        {"wave": get_wave(wav1)},
        {"wave": get_wave(wav2)},
        {"wave": get_wave(wav3)}
    ]
}

response = requests.post(endpoint, json=data)
if response.ok:
    with open(out, "w") as outfile:
        outfile.write(response.content)
    print "Saved model to '%s'." % out
else:
    print "Request failed."
    print response.text

@chenguoguo
Copy link
Collaborator

@josep112 The improve API definition on our side is probably confusing... sorry about that. The improve API is not supposed to be used for model training. It only takes audio samples from users so in the future we can possibly train a universal model from those data. It will not improve your personal model.

@josep112
Copy link
Author

josep112 commented Mar 7, 2017

Hello friend, would it be nice if you had this possibility because many words exchanged have a forecast of this new implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants