[Update] Config Page: Translation, Transcription Tab: CTranslate2, Whisper. Apply Localization.

This commit is contained in:
Sakamoto Shiina
2024-11-13 09:50:21 +09:00
parent 6c0c67ab40
commit 4db5306178
2 changed files with 23 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import styles from "./Transcription.module.scss";
import { updateLabelsById } from "@utils";
import {
useMicRecordTimeout,
@@ -250,6 +251,18 @@ const WhisperWeightType_Box = () => {
downloadWhisperWeight(id);
};
const new_labels = [
{ id: "tiny", label: t("config_page.whisper_weight_type.model_template", {model_name: "tiny", capacity: "74.5MB"}) },
{ id: "base", label: t("config_page.whisper_weight_type.recommended_model_template", {model_name: "base", capacity: "141MB"}) },
{ id: "small", label: t("config_page.whisper_weight_type.model_template", {model_name: "small", capacity: "463MB"}) },
{ id: "medium", label: t("config_page.whisper_weight_type.model_template", {model_name: "medium", capacity: "1.42GB"}) },
{ id: "large-v1", label: t("config_page.whisper_weight_type.model_template", {model_name: "large-v1", capacity: "2.87GB"}) },
{ id: "large-v2", label: t("config_page.whisper_weight_type.model_template", {model_name: "large-v2", capacity: "2.87GB"}) },
{ id: "large-v3", label: t("config_page.whisper_weight_type.model_template", {model_name: "large-v3", capacity: "2.87GB"}) },
];
const whisper_weight_types = updateLabelsById(currentWhisperWeightTypeStatus.data, new_labels);
return (
<>
<DownloadModelsContainer
@@ -259,7 +272,7 @@ const WhisperWeightType_Box = () => {
{translator: t("main_page.translator")}
)}
name="whisper_weight_type"
options={currentWhisperWeightTypeStatus.data}
options={whisper_weight_types}
checked_variable={currentSelectedWhisperWeightType}
selectFunction={selectFunction}
downloadStartFunction={downloadStartFunction}

View File

@@ -1,6 +1,7 @@
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import styles from "./Translation.module.scss";
import { updateLabelsById } from "@utils";
import {
useDeepLAuthKey,
@@ -40,6 +41,13 @@ const CTranslate2WeightType_Box = () => {
downloadCTranslate2Weight(id);
};
const new_labels = [
{ id: "small", label: t("config_page.ctranslate2_weight_type.small", {capacity: "418MB"}) },
{ id: "large", label: t("config_page.ctranslate2_weight_type.large", {capacity: "1.2GB"}) },
];
const c_translate2_weight_types = updateLabelsById(currentCTranslate2WeightTypeStatus.data, new_labels);
return (
<>
<DownloadModelsContainer
@@ -49,7 +57,7 @@ const CTranslate2WeightType_Box = () => {
{translator: t("main_page.translator")}
)}
name="ctransalte2_weight_type"
options={currentCTranslate2WeightTypeStatus.data}
options={c_translate2_weight_types}
checked_variable={currentSelectedCTranslate2WeightType}
selectFunction={selectFunction}
downloadStartFunction={downloadStartFunction}