Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Custom wakeword not working, spokestack word still used. #96

Closed
bogdancrisu opened this issue Apr 20, 2021 · 16 comments · Fixed by #98
Closed

Custom wakeword not working, spokestack word still used. #96

bogdancrisu opened this issue Apr 20, 2021 · 16 comments · Fixed by #98

Comments

@bogdancrisu
Copy link

bogdancrisu commented Apr 20, 2021

Spokestack.initialize(
clientId,
clientSecret,
{
vadMode: 'quality',
wakeword: {
filter: require('./model/filter.tflite'),
detect: require('./model/detect.tflite'),
encode: require('./model/encode.tflite'),
},
nlu: {
model: require('./nlu/nlu.tflite'),
vocab: require('./nlu/vocab.txt'),
metadata: require('./nlu/metadata.sjson'),
},
},
)

@timmywil
Copy link
Member

Thanks for opening an issue. Unfortunately, this isn't a lot of info to go on. That said, I'm going to test a custom wakeword model once I fix the compilation issues with RN 0.64.

In the future, avoid posting your API key on GitHub (or committing that directly to a public repo) in order to keep it secure. I went ahead and edited this issue, but to be completely safe you could rotate the key to a new one.

@timmywil
Copy link
Member

timmywil commented Apr 20, 2021

If you've replaced the files but they have the same names, you could try changing the file names or clearing the react native bundler cache with npx react-native start --reset-cache

@bogdancrisu
Copy link
Author

Hi, tried both options but with no luck ...

@bogdancrisu
Copy link
Author

I tried also with the CDN files, same result.

@timmywil
Copy link
Member

timmywil commented Apr 20, 2021

Oh, also try setting refreshModels to true in Spokestack.initialize(). This will clear the model cache.

@timmywil
Copy link
Member

That should work, and if so, I think perhaps we should set that to true in development by default.

@bogdancrisu
Copy link
Author

Spokestack.initialize(
clientId,
clientSecret,
{
refreshModels: true,
vadMode: 'quality',
wakeword: {
filter: require('./model/filtertwo.tflite'),
detect: require('./model/detecttamarintwo.tflite'),
encode: require('./model/encodetamarintwo.tflite'),
},
nlu: {
model: require('./nlu/nlu.tflite'),
vocab: require('./nlu/vocab.txt'),
metadata: require('./nlu/metadata.sjson'),
},
},
)

Same result...

@timmywil
Copy link
Member

Are you saying that it recognizes when you say "Spokestack" or that you've verified it's using the Spokestack model files included in the example instead of yours? What happens if you uninstall and reinstall the app?

@bogdancrisu
Copy link
Author

It recognizes Spokestack only, I had a look in react-native-spokestack/src/index.tsx "initialize = (" and it receives my custom models. After I run the app in the simulator with npx react-native run-ios, Spokestack only recognizes the Spokstack wake word.

@timmywil
Copy link
Member

timmywil commented Apr 20, 2021

Good news! I was able to reproduce your issue. I'm working on a fix and will have something for you soon.

@timmywil
Copy link
Member

This does only seem to affect iOS. Android seems to work fine.

@bogdancrisu
Copy link
Author

Yep, Android works perfectly.

@timmywil
Copy link
Member

It's getting late here, but we'll keep working on this tomorrow. Thanks for your patience.

@timmywil
Copy link
Member

We figured out the issue and will have a release of both spokestack-ios and react-native-spokestack by tomorrow.

@timmywil
Copy link
Member

A fix has been released! Please try version 6.0.0.

@bogdancrisu
Copy link
Author

Thanks, works like a charm :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants