-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Refactor TF and TFLite implementations into their own classes/files #2146
Conversation
Hm, looks like something is wrong with Taskcluster, it didn't pick up the PR. |
Retriggered them, it looks okay |
<< "file with the same size as the one used for training." | ||
<< std::endl; | ||
return DS_ERR_INVALID_ALPHABET; | ||
} |
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.
nit: maybe this kind of check should be factorized on ModelState
, like with a ensure_alphabet(size_t final_dim_size)
that would check against GetSize()
and return the same error, since the logic is the same for TensorFlow and TFLite runtime, only where we read the value differs ?
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.
Yeah, I want to do that, ideally we'd uplift all the metadata/model geometry checks to ModelState
, but that requires finding a good solution for embedding metadata in the TFLite model first.
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.
LGTM, a few nits / questions, but really nothing blocking. I agree we should be careful and not land this before 0.5.0, though
4713153
to
2dfce92
Compare
Pushed a commit fixing multiple concurrent streams per model instance. |
ae68380
to
8abb8ce
Compare
@reuben I guess we can merge that after you rebase, now that 0.5.0 is shipped. |
8abb8ce
to
a2189b5
Compare
Re-requesting review for the last commit fixing the concurrent streams bug. I'm also going to add a test that exercises this. |
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.
LGTM, just make sure we do not break on CUDA :)
@reuben I landed a fix for the ElectronJS build issues, you can rebase on top of it. |
c79c253
to
48bb5e5
Compare
48bb5e5
to
f12ea5e
Compare
I just saw your messages about 0.5.1 with the DS_IntermediateDecode fix. I'll hold on merging this PR until we do that. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This refactors the ModelState code which currently into a base
ModelState
class and two implementations,TFModelState
,TFLiteModelState
.This greatly improves the readability of
deepspeech.cc
. I've also taken the opportunity to try and make the code style a bit more consistent. I've made all member variable names end with_
and fixed inconsistent indentation in a few places.This also paves the way for fixing the multi-stream bugs we currently have in the client. Not sure if we should take this for 0.5.0 though, as it's a big change.