-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
if (mMozillaSpeechService.ensureModelInstalled()) { | ||
mMozillaSpeechService.start(getApplicationContext()); | ||
} else { | ||
maybeDownloadOrExtractModel(getExternalFilesDir("models").getAbsolutePath(), mMozillaSpeechService.getLanguageDir()); |
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 logic is required on the app side because after checking with a few potential users they indeed want to be more in charge of securing / handling the selection and distribution of models.
return LocalSpeechRecognition.ensureModelInstalled(this.getModelPath() + "/" + this.getLanguageDir()); | ||
} | ||
|
||
public String getModelDownloadURL() { |
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 is intended to provide access to "default" models. Packaging and hosting is open for debate.
cc @philip-lamb, @MortimerGoro: this is the work that will allow us to do on-device speech. |
public static String kTrie = "trie"; | ||
|
||
private static Map<String,String> mLanguages = new HashMap<String, String>(); | ||
static { |
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.
To be extended, for now producing DeepSpeech model using the same naming convention for languages as Common Voice, but for example, locale names in MR Browser is not the same. Here is a mapping helping.
mLanguages.put("fr-FR", "fra"); | ||
} | ||
|
||
private static String kBaseModelURL = "https://github.com/lissyx/DeepSpeech/releases/download/android-test/"; |
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.
Obviously needs to be hosted at some proper place, this is here for debating.
@andrenatal @philip-lamb @MortimerGoro Just wondering who should take a look at this? |
Hey, I didn't even know this was here. I'll take a look tomorrow. |
Sorry guys, I'm late here but I promise this won't get past this weekend. |
LGTM. I won't be able to test it before Monday, but if @lissyx confirms it's working, I'm fine merging it. |
Well, I would not have opened the PR if it was not working locally :) |
This is now is a shape good enough to justify discussions.