forked from Blendman974/faceclaw
Merge dedicated offline French Whisper model
This commit is contained in:
18 files changed
+621
-17
No files matched your search
@@ -74,6 +74,7 @@ class FaceclawVoiceController(context: Context) {
|
||||
@Volatile
|
||||
private var communicator: FaceclawBleCommunicator? = null
|
||||
private var whisperModel = WhisperModelFiles.forLanguage(null)
|
||||
private var frenchWhisper = false
|
||||
|
||||
private val host = object : VoiceCaptureHost {
|
||||
override val dispatcher = CallbackDispatcher { action -> mainHandler.post { action() } }
|
||||
@@ -160,9 +161,15 @@ class FaceclawVoiceController(context: Context) {
|
||||
session.setOnboardModelKind(kind)
|
||||
}
|
||||
|
||||
/** Select the dedicated French fine-tune before setting the capture language. */
|
||||
fun setFrenchWhisper(enabled: Boolean) {
|
||||
frenchWhisper = enabled
|
||||
whisperModel = WhisperModelFiles.forSelection(whisperModel.language, enabled)
|
||||
}
|
||||
|
||||
/** Language for the next on-device Whisper capture; empty enables auto-detection. */
|
||||
fun setOnboardLanguage(language: String?) {
|
||||
whisperModel = WhisperModelFiles.forLanguage(language)
|
||||
whisperModel = WhisperModelFiles.forSelection(language, frenchWhisper)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user