[Update] Config Page: Transcription Tab. Add SelectedTranscriptionEngine.
This commit is contained in:
@@ -31,6 +31,7 @@ export { useSpeakerRecordTimeout } from "./transcription/useSpeakerRecordTimeout
|
||||
export { useSpeakerPhraseTimeout } from "./transcription/useSpeakerPhraseTimeout";
|
||||
export { useSpeakerMaxWords } from "./transcription/useSpeakerMaxWords";
|
||||
|
||||
export { useSelectedTranscriptionEngine } from "./transcription/useSelectedTranscriptionEngine";
|
||||
export { useWhisperWeightTypeStatus } from "./transcription/useWhisperWeightTypeStatus";
|
||||
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,
|
||||
useCTranslate2WeightTypeStatus,
|
||||
useSelectedCTranslate2WeightType,
|
||||
useSelectedTranscriptionEngine,
|
||||
useSelectedWhisperWeightType,
|
||||
useWhisperWeightTypeStatus,
|
||||
useOverlaySettings,
|
||||
@@ -129,6 +130,7 @@ export const useReceiveRoutes = () => {
|
||||
downloadedCTranslate2WeightType,
|
||||
} = useCTranslate2WeightTypeStatus();
|
||||
|
||||
const { updateSelectedTranscriptionEngine } = useSelectedTranscriptionEngine();
|
||||
const { updateSelectedWhisperWeightType } = useSelectedWhisperWeightType();
|
||||
const {
|
||||
updateDownloadedWhisperWeightTypeStatus,
|
||||
@@ -351,6 +353,9 @@ export const useReceiveRoutes = () => {
|
||||
"/get/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,
|
||||
"/set/data/whisper_weight_type": updateSelectedWhisperWeightType,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user