[Update] Config Page: Transcription Tab. Add SelectedTranscriptionEngine.
This commit is contained in:
@@ -203,9 +203,8 @@
|
|||||||
"desc": "It is the lower limit for the number of transcribed words, and only when this number is exceeded will the transcription results be displayed logs.",
|
"desc": "It is the lower limit for the number of transcribed words, and only when this number is exceeded will the transcription results be displayed logs.",
|
||||||
"error_message": "You can set a number equal to or greater than 0."
|
"error_message": "You can set a number equal to or greater than 0."
|
||||||
},
|
},
|
||||||
"use_whisper_feature": {
|
"select_transcription_engine": {
|
||||||
"label": "Use Whisper Model As Transcription",
|
"label": "Select Transcription Engine"
|
||||||
"desc": "In some languages, the accuracy of speech recognition may improve. During speech recognition usage, CPU usage increases, so please consider your PC specs before using this feature."
|
|
||||||
},
|
},
|
||||||
"whisper_weight_type": {
|
"whisper_weight_type": {
|
||||||
"label": "Select Whisper Model",
|
"label": "Select Whisper Model",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
useSpeakerPhraseTimeout,
|
useSpeakerPhraseTimeout,
|
||||||
useSpeakerMaxWords,
|
useSpeakerMaxWords,
|
||||||
|
|
||||||
|
useSelectedTranscriptionEngine,
|
||||||
useWhisperWeightTypeStatus,
|
useWhisperWeightTypeStatus,
|
||||||
useSelectedWhisperWeightType,
|
useSelectedWhisperWeightType,
|
||||||
} from "@logics_configs";
|
} from "@logics_configs";
|
||||||
@@ -20,6 +21,7 @@ import {
|
|||||||
EntryContainer,
|
EntryContainer,
|
||||||
WordFilterContainer,
|
WordFilterContainer,
|
||||||
DownloadModelsContainer,
|
DownloadModelsContainer,
|
||||||
|
RadioButtonContainer,
|
||||||
} from "../_templates/Templates";
|
} from "../_templates/Templates";
|
||||||
|
|
||||||
export const Transcription = () => {
|
export const Transcription = () => {
|
||||||
@@ -27,7 +29,7 @@ export const Transcription = () => {
|
|||||||
<>
|
<>
|
||||||
<Mic_Container />
|
<Mic_Container />
|
||||||
<Speaker_Container />
|
<Speaker_Container />
|
||||||
<WhisperWeightType_Box />
|
<TranscriptionEngine_Container />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -233,6 +235,34 @@ const SpeakerMaxWords_Box = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const TranscriptionEngine_Container = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TranscriptionEngine_Box />
|
||||||
|
<WhisperWeightType_Box />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const TranscriptionEngine_Box = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { currentSelectedTranscriptionEngine, setSelectedTranscriptionEngine } = useSelectedTranscriptionEngine();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<RadioButtonContainer
|
||||||
|
label={t("config_page.select_transcription_engine.label")}
|
||||||
|
selectFunction={setSelectedTranscriptionEngine}
|
||||||
|
name="select_transcription_engine"
|
||||||
|
options={[
|
||||||
|
{ id: "Google", label: "Google" },
|
||||||
|
{ id: "Whisper", label: "Whisper" },
|
||||||
|
]}
|
||||||
|
checked_variable={currentSelectedTranscriptionEngine}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const WhisperWeightType_Box = () => {
|
const WhisperWeightType_Box = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export { useSpeakerRecordTimeout } from "./transcription/useSpeakerRecordTimeout
|
|||||||
export { useSpeakerPhraseTimeout } from "./transcription/useSpeakerPhraseTimeout";
|
export { useSpeakerPhraseTimeout } from "./transcription/useSpeakerPhraseTimeout";
|
||||||
export { useSpeakerMaxWords } from "./transcription/useSpeakerMaxWords";
|
export { useSpeakerMaxWords } from "./transcription/useSpeakerMaxWords";
|
||||||
|
|
||||||
|
export { useSelectedTranscriptionEngine } from "./transcription/useSelectedTranscriptionEngine";
|
||||||
export { useWhisperWeightTypeStatus } from "./transcription/useWhisperWeightTypeStatus";
|
export { useWhisperWeightTypeStatus } from "./transcription/useWhisperWeightTypeStatus";
|
||||||
export { useSelectedWhisperWeightType } from "./transcription/useSelectedWhisperWeightType";
|
export { useSelectedWhisperWeightType } from "./transcription/useSelectedWhisperWeightType";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { useStore_SelectedTranscriptionEngine } from "@store";
|
||||||
|
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||||
|
|
||||||
|
export const useSelectedTranscriptionEngine = () => {
|
||||||
|
const { asyncStdoutToPython } = useStdoutToPython();
|
||||||
|
const { currentSelectedTranscriptionEngine, updateSelectedTranscriptionEngine, pendingSelectedTranscriptionEngine } = useStore_SelectedTranscriptionEngine();
|
||||||
|
|
||||||
|
const getSelectedTranscriptionEngine = () => {
|
||||||
|
pendingSelectedTranscriptionEngine();
|
||||||
|
asyncStdoutToPython("/get/data/selected_transcription_engine");
|
||||||
|
};
|
||||||
|
|
||||||
|
const setSelectedTranscriptionEngine = (selected_transcription_engine) => {
|
||||||
|
pendingSelectedTranscriptionEngine();
|
||||||
|
asyncStdoutToPython("/set/data/selected_transcription_engine", selected_transcription_engine);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
currentSelectedTranscriptionEngine,
|
||||||
|
getSelectedTranscriptionEngine,
|
||||||
|
updateSelectedTranscriptionEngine,
|
||||||
|
setSelectedTranscriptionEngine,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -48,6 +48,7 @@ import {
|
|||||||
useDeepLAuthKey,
|
useDeepLAuthKey,
|
||||||
useCTranslate2WeightTypeStatus,
|
useCTranslate2WeightTypeStatus,
|
||||||
useSelectedCTranslate2WeightType,
|
useSelectedCTranslate2WeightType,
|
||||||
|
useSelectedTranscriptionEngine,
|
||||||
useSelectedWhisperWeightType,
|
useSelectedWhisperWeightType,
|
||||||
useWhisperWeightTypeStatus,
|
useWhisperWeightTypeStatus,
|
||||||
useOverlaySettings,
|
useOverlaySettings,
|
||||||
@@ -129,6 +130,7 @@ export const useReceiveRoutes = () => {
|
|||||||
downloadedCTranslate2WeightType,
|
downloadedCTranslate2WeightType,
|
||||||
} = useCTranslate2WeightTypeStatus();
|
} = useCTranslate2WeightTypeStatus();
|
||||||
|
|
||||||
|
const { updateSelectedTranscriptionEngine } = useSelectedTranscriptionEngine();
|
||||||
const { updateSelectedWhisperWeightType } = useSelectedWhisperWeightType();
|
const { updateSelectedWhisperWeightType } = useSelectedWhisperWeightType();
|
||||||
const {
|
const {
|
||||||
updateDownloadedWhisperWeightTypeStatus,
|
updateDownloadedWhisperWeightTypeStatus,
|
||||||
@@ -351,6 +353,9 @@ export const useReceiveRoutes = () => {
|
|||||||
"/get/data/speaker_max_phrases": updateSpeakerMaxWords,
|
"/get/data/speaker_max_phrases": updateSpeakerMaxWords,
|
||||||
"/set/data/speaker_max_phrases": updateSpeakerMaxWords,
|
"/set/data/speaker_max_phrases": updateSpeakerMaxWords,
|
||||||
|
|
||||||
|
"/get/data/selected_transcription_engine": updateSelectedTranscriptionEngine,
|
||||||
|
"/set/data/selected_transcription_engine": updateSelectedTranscriptionEngine,
|
||||||
|
|
||||||
"/get/data/whisper_weight_type": updateSelectedWhisperWeightType,
|
"/get/data/whisper_weight_type": updateSelectedWhisperWeightType,
|
||||||
"/set/data/whisper_weight_type": updateSelectedWhisperWeightType,
|
"/set/data/whisper_weight_type": updateSelectedWhisperWeightType,
|
||||||
|
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ export const { atomInstance: Atom_SpeakerMaxWords, useHook: useStore_SpeakerMaxW
|
|||||||
|
|
||||||
export const { atomInstance: Atom_SelectedWhisperWeightType, useHook: useStore_SelectedWhisperWeightType } = createAtomWithHook("", "SelectedWhisperWeightType");
|
export const { atomInstance: Atom_SelectedWhisperWeightType, useHook: useStore_SelectedWhisperWeightType } = createAtomWithHook("", "SelectedWhisperWeightType");
|
||||||
export const { atomInstance: Atom_WhisperWeightTypeStatus, useHook: useStore_WhisperWeightTypeStatus } = createAtomWithHook(whisper_weight_type_status, "WhisperWeightTypeStatus");
|
export const { atomInstance: Atom_WhisperWeightTypeStatus, useHook: useStore_WhisperWeightTypeStatus } = createAtomWithHook(whisper_weight_type_status, "WhisperWeightTypeStatus");
|
||||||
|
export const { atomInstance: Atom_SelectedTranscriptionEngine, useHook: useStore_SelectedTranscriptionEngine } = createAtomWithHook(whisper_weight_type_status, "SelectedTranscriptionEngine");
|
||||||
|
|
||||||
|
|
||||||
// VR
|
// VR
|
||||||
|
|||||||
Reference in New Issue
Block a user