-
Notifications
You must be signed in to change notification settings - Fork 351
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
add electron example #65
Conversation
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.
@dsteinman That looks nice, thanks, but before merging can we please add a test.sh
file like e.g., https://github.com/mozilla/DeepSpeech-examples/blob/r0.7/nodejs_wav/test.sh so we could have CI support ?
Since it's broken currently on Windows we could only enable that on linux and mac for the moment, but having coverage for the future would really be cool.
From the readme, it looks like the steps should already be simple enough, especially since CI setup already downloads model / scorer.
If you feel it's too complicated, I can take care of it later.
I can add a unit test -- but what should test.sh do? I guess could test that the electron app opens in dev mode (npm run dev) and successfully transcribes all 3 wav files and closes it back down. But I'd need more things than just a bash file to do this, like a mocha/chai type test engine. And can the CI build system run desktop apps? |
Why? We could have a CLI flag that asks for std output and then you grab it and you compare. Also, maybe just checking return / exit code is fine, and you set correct value of it when inference runs, that should catch the kind of regression we had in your electron-builder issue.
It should since I think we have some coverage of some stuff like that, but I'm not sure under windows |
Again if you feel it's too complicated, let me know and we'll take care of that (but maybe later). |
No problem, I've added a test.sh and rearranged where the DS model filess are linked from (/models instead of /), and I added a
So I think this might be what you'll need. The |
Thanks, I'll run that tomorrow and will fix remainders issues. To avoid breaking CI I'll hold the merge until :) |
@lissyx ping, did this slip through the cracks? |
I fear it did, ill try to take care later |
I'm fixing the current r0.8 status between deepspeech and examples repos and then I'l run this one, sorry @dsteinman for letting it slip through :/ |
No problem at all. |
Please look at #69, it's working except it is not closing after |
@dsteinman Can you suggest how to properly close the process after performing the inference? |
Unfortunately this might not be fixable without an unpleasant hack like some of the suggestions here: electron-userland/electron-webpack#249 The problem going on is that "process.exit()" is stopping the app, but not the development server. How to unit test an Electron app in this way is not clear to me. I see what you tried here, does it work? |
I'm still having troubles with
Looks like without |
A possible alternative I can think of might be to create a test build which doesn't require the development server to be running. I'll see if I can figure out how to do this. |
Maybe a |
It looks like Spectron is the proper way to test Electron apps, but I'm not exactly eager to set all this up to satisfy one CI test. Let me know if there's no other solutions found. |
my hack does not work :/ |
./electron/node_modules/react-scripts/scripts/start.js: |
Tried setting up |
@dsteinman According to my reading of |
Yes, please see how we could use that? |
@dsteinman or just have a way that |
See here: https://github.com/kimmobrunfeldt/concurrently/issues/127 I tried modifying the npm dev-test script to this and seems to work:
|
Testing ... :) |
it worked! |
Thanks @dsteinman I'll make a lastPR for msaterbranch |
Okay, great! Thanks. |
This adds an ElectronJS example. The example loads up the 3 example .WAV files and processes each through DeepSpeech and displays the transcription results in the window.
The readme has complete instructions, everything works on Mac and Linux. The dev mode works on Windows
npm run dev-win
, but the packaged windows app usingnpm run dist-win
does not work. See 3127There are some complexities involved in where the pretrained English models are located. I've done my best to simplify this. It is easiest to first run in dev mode
npm run dev
and let it download the models, and then try the packaged version withnpm run dist
. The reason for the download is because in the prod package, i can't figure out how to package the models from the /public directory, it doesn't work, but it does work from the electron "appData" directory. So the downloader saves the files there. This is probably the correct way to go anyways because the .exe/.dmg package doesn't need to include the model files.If you really don't want download the models again, you can softlink the files to their destination location (see the Uninstall section of the Readme).