-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Kaldi STT #878
Kaldi STT #878
Conversation
mycroft/stt/__init__.py
Outdated
| def execute(self, audio, language=None): | ||
| language = language or self.lang | ||
| config = ConfigurationManager.get().get("stt", {}) | ||
| response = requests.post(self.config.get("uri"), data=audio.get_wav_data()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you split this line, is more than 80 columns it brokes pep8, thank you
|
I'm currently building Kaldi to give this a try. but it seems to take forever! If someone with an existing install would like to test this my struggling CPU would be happy =) |
mycroft/stt/__init__.py
Outdated
| def execute(self, audio, language=None): | ||
| language = language or self.lang | ||
| config = ConfigurationManager.get().get("stt", {}) | ||
| response = requests.post(self.config.get("uri"), data=audio.get_wav_data()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also: the module requests need to be imported at the top of the file and I think you want to use the config variable you created above instead of self.config.
You can do
from requests import postAnd then shorten this line by just making it
response = post(config.get("uri"), data=audio.get_wav_data())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, yup and yup.
|
@forslund mine just finished to compile, I'm downloading the models to run, but yeah, takes a lot of time |
mycroft/stt/__init__.py
Outdated
| language = language or self.lang | ||
| config = ConfigurationManager.get().get("stt", {}) | ||
| response = requests.post(self.config.get("uri"), data=audio.get_wav_data()) | ||
| return get_response(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be
return self.get_response(response)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context switching between python for some side projects and Java for work - my bad. addressed.
mycroft/stt/__init__.py
Outdated
| response = requests.post(self.config.get("uri"), data=audio.get_wav_data()) | ||
| return get_response(response) | ||
|
|
||
| def get_response(response): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be
def get_response(self, response):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed.
forslund
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A big thank you for contributing this. There are a couple of minor issues, but over all the code looks solid. Looking forward to getting this merged =)
|
Sorry about that - wrote it real quick and didn't have a mycroft instance to test it against, in the middle of rebuilding some servers at home. Please check the latest commit |
|
Great, it works for me with my kaldi setup! May I suggest altering the comments in
to something like |
|
Looking at the base class the config should really be something like "stt": {
"module": "kaldi",
"kaldi": {
"uri": "http://localhost"
}
}using this setup, This is the format used by the other STT backends that need extra parameters. |
|
@forslund addressed. You're right, I should have looked at the base class more carefully |
|
Nice! Thank you! |
|
I checked out again, and still works nicely on my desktop. |
|
Can we get this merged up? |
|
@Teagan42 thank you!!! |
Finish #440
Can someone with Kaldi please verify - I had to wipe my server the other day and haven't stood kaldi back up.