[Update] Config Page: Transcription Tab. Add Whisper Weight Type Selector. Downloadable.

This commit is contained in:
Sakamoto Shiina
2024-11-12 14:52:15 +09:00
parent 36c53c49a2
commit 96ed2a9afc
7 changed files with 162 additions and 1 deletions

View File

@@ -10,11 +10,15 @@ import {
useSpeakerRecordTimeout,
useSpeakerPhraseTimeout,
useSpeakerMaxWords,
useWhisperWeightTypeStatus,
useSelectedWhisperWeightType,
} from "@logics_configs";
import {
EntryContainer,
WordFilterContainer,
DownloadModelsContainer,
} from "../_templates/Templates";
export const Transcription = () => {
@@ -22,6 +26,7 @@ export const Transcription = () => {
<>
<Mic_Container />
<Speaker_Container />
<WhisperWeightType_Box />
</>
);
};
@@ -225,3 +230,40 @@ const SpeakerMaxWords_Box = () => {
/>
);
};
const WhisperWeightType_Box = () => {
const { t } = useTranslation();
const {
currentWhisperWeightTypeStatus,
pendingWhisperWeightType,
downloadWhisperWeight,
} = useWhisperWeightTypeStatus();
const { currentSelectedWhisperWeightType, setSelectedWhisperWeightType } = useSelectedWhisperWeightType();
const selectFunction = (id) => {
setSelectedWhisperWeightType(id);
};
const downloadStartFunction = (id) => {
pendingWhisperWeightType(id);
downloadWhisperWeight(id);
};
return (
<>
<DownloadModelsContainer
label={t("config_page.whisper_weight_type.label")}
desc={t(
"config_page.whisper_weight_type.desc",
{translator: t("main_page.translator")}
)}
name="whisper_weight_type"
options={currentWhisperWeightTypeStatus.data}
checked_variable={currentSelectedWhisperWeightType}
selectFunction={selectFunction}
downloadStartFunction={downloadStartFunction}
/>
</>
);
};