From 01e6ceebd2b2f36f654c39d4b0a1da7b204a6c44 Mon Sep 17 00:00:00 2001 From: Niaz Date: Sat, 16 Nov 2024 13:57:54 +0100 Subject: [PATCH] Remove heavyweight_process setting --- src/api_client/site-settings.ts | 1 - src/layouts/settings/SiteSettings.tsx | 52 +-------------------------- src/reducers/utilReducer.js | 1 - 3 files changed, 1 insertion(+), 53 deletions(-) diff --git a/src/api_client/site-settings.ts b/src/api_client/site-settings.ts index 0080e6dc..c86e32c2 100644 --- a/src/api_client/site-settings.ts +++ b/src/api_client/site-settings.ts @@ -11,7 +11,6 @@ const SiteSettingsSchema = z.object({ allow_registration: z.boolean(), allow_upload: z.boolean(), skip_patterns: z.string(), - heavyweight_process: z.number().nullable(), map_api_key: z.string(), map_api_provider: z.string(), captioning_model: z.string(), diff --git a/src/layouts/settings/SiteSettings.tsx b/src/layouts/settings/SiteSettings.tsx index 0cabb946..d0031040 100644 --- a/src/layouts/settings/SiteSettings.tsx +++ b/src/layouts/settings/SiteSettings.tsx @@ -18,11 +18,6 @@ import { useTranslation } from "react-i18next"; import { useGetSettingsQuery, useUpdateSettingsMutation } from "../../api_client/site-settings"; -const MAX_HEAVYWEIGHT_PROCESSES = 10; -const heavyweightProcessOptions = Array(MAX_HEAVYWEIGHT_PROCESSES) - .fill("") - .map((_, i) => (i + 1).toString()); - const MAP_API_PROVIDERS = [ { value: "mapbox", label: "Mapbox", data: { use_api_key: true, url: "https://www.mapbox.com/" } }, { value: "maptiler", label: "MapTiler", data: { use_api_key: true, url: "https://www.maptiler.com/" } }, @@ -53,7 +48,6 @@ export function SiteSettings() { const [skipPatterns, setSkipPatterns] = useState(""); const [mapApiKey, setMapApiKey] = useState(""); const [mapApiProvider, setMapApiProvider] = useState("proton"); - const [heavyweightProcess, setHeavyweightProcess] = useState(1); const [allowRegistration, setAllowRegistration] = useState(false); const [allowUpload, setAllowUpload] = useState(false); const [captioningModel, setCaptioningModel] = useState("im2txt"); @@ -65,11 +59,6 @@ export function SiteSettings() { const [opened, { open, close }] = useDisclosure(false); const saveSettingsWithValidation = (input: any) => { - if (input.heavyweight_process && input.heavyweight_process > 3) { - setWarning("heavyweight"); - open(); - return; - } if (input.captioning_model === "blip_base_capfilt_large") { setWarning("blip"); open(); @@ -83,7 +72,6 @@ export function SiteSettings() { setSkipPatterns(settings.skip_patterns); setMapApiKey(settings.map_api_key); setMapApiProvider(settings.map_api_provider); - setHeavyweightProcess(settings.heavyweight_process); setAllowRegistration(settings.allow_registration); setAllowUpload(settings.allow_upload); setCaptioningModel(settings.captioning_model); @@ -100,18 +88,12 @@ export function SiteSettings() { setCaptioningModel("im2txt"); saveSettings({ captioning_model: "im2txt" }); } - if (warning === "heavyweight") { - setHeavyweightProcess(3); - saveSettings({ heavyweight_process: 3 }); - } close(); }} title={{t("sitesettings.ram_warning_header")}} > - - {warning === "blip" ? t("sitesettings.blip_warning") : t("sitesettings.heavyweight_process_warning")} - + {t("sitesettings.blip_warning")}