diff --git a/enjoy/e2e/main.spec.ts b/enjoy/e2e/main.spec.ts index 2681e36d0..c58fe8666 100644 --- a/enjoy/e2e/main.spec.ts +++ b/enjoy/e2e/main.spec.ts @@ -81,3 +81,8 @@ test("valid ffmpeg command", async () => { }); expect(res).toBeTruthy(); }); + +test("should setup default library path", async () => { + const settings = fs.readJsonSync(path.join(resultDir, "settings.json")); + expect(settings.library).not.toBeNull(); +}); diff --git a/enjoy/src/constants.ts b/enjoy/src/constants.ts index 0355afbcb..7a78f4d36 100644 --- a/enjoy/src/constants.ts +++ b/enjoy/src/constants.ts @@ -11,6 +11,13 @@ export const REPO_URL = "https://github.com/xiaolai/everyone-can-use-english"; export const WHISPER_MODELS_OPTIONS = [ { type: "tiny", + name: "ggml-tiny.bin", + size: "75 MB", + sha: "bd577a113a864445d4c299885e0cb97d4ba92b5f", + url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin", + }, + { + type: "tiny.en", name: "ggml-tiny.en.bin", size: "75 MB", sha: "c78c86eb1a8faa21b369bcd33207cc90d64ae9df", @@ -18,6 +25,13 @@ export const WHISPER_MODELS_OPTIONS = [ }, { type: "base", + name: "ggml-base.bin", + size: "142 MB", + sha: "465707469ff3a37a2b9b8d8f89f2f99de7299dac", + url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin", + }, + { + type: "base.en", name: "ggml-base.en.bin", size: "142 MB", sha: "137c40403d78fd54d454da0f9bd998f78703390c", @@ -25,6 +39,13 @@ export const WHISPER_MODELS_OPTIONS = [ }, { type: "small", + name: "ggml-small.bin", + size: "466 MB", + sha: "55356645c2b361a969dfd0ef2c5a50d530afd8d5", + url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin", + }, + { + type: "small.en", name: "ggml-small.en.bin", size: "466 MB", sha: "db8a495a91d927739e50b3fc1cc4c6b8f6c2d022", @@ -32,11 +53,32 @@ export const WHISPER_MODELS_OPTIONS = [ }, { type: "medium", + name: "ggml-medium.bin", + size: "1.5 GB", + sha: "fd9727b6e1217c2f614f9b698455c4ffd82463b4", + url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.bin", + }, + { + type: "medium.en", name: "ggml-medium.en.bin", size: "1.5 GB", sha: "8c30f0e44ce9560643ebd10bbe50cd20eafd3723", url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.en.bin", }, + { + type: "large-v1", + name: "ggml-large-v1.bin", + size: "2.9 GB", + sha: "b1caaf735c4cc1429223d5a74f0f4d0b9b59a299", + url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v1.bin", + }, + { + type: "large-v2", + name: "ggml-large-v2.bin", + size: "2.9 GB", + sha: "0f4c8e34f21cf1a914c59d8b3ce882345ad349d6", + url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v2.bin", + }, { type: "large", name: "ggml-large-v3.bin", diff --git a/enjoy/src/renderer/pages/landing.tsx b/enjoy/src/renderer/pages/landing.tsx index aa21e77a6..e85756c4a 100644 --- a/enjoy/src/renderer/pages/landing.tsx +++ b/enjoy/src/renderer/pages/landing.tsx @@ -1,115 +1,30 @@ import { t } from "i18next"; -import { useState, useContext, useEffect } from "react"; -import { Button, Progress } from "@renderer/components/ui"; +import { useContext } from "react"; +import { Button } from "@renderer/components/ui"; import { Link } from "react-router-dom"; -import { LoginForm, ChooseLibraryPathInput } from "@renderer/components"; -import { - AppSettingsProviderContext, - AISettingsProviderContext, -} from "@renderer/context"; -import { CheckCircle2Icon } from "lucide-react"; +import { LoginForm } from "@renderer/components"; +import { AppSettingsProviderContext } from "@renderer/context"; export default () => { - const [currentStep, setCurrentStep] = useState(1); - const [currentStepValid, setCurrentStepValid] = useState(false); - - const { user, libraryPath, initialized } = useContext( - AppSettingsProviderContext - ); - const { whisperConfig } = useContext(AISettingsProviderContext); - const totalSteps = 3; - - useEffect(() => { - validateCurrentStep(); - }, [currentStep, user, whisperConfig]); - - const validateCurrentStep = async () => { - switch (currentStep) { - case 1: - setCurrentStepValid(!!user); - break; - case 2: - setCurrentStepValid(!!libraryPath); - break; - case 3: - setCurrentStepValid(initialized); - break; - default: - setCurrentStepValid(false); - } - }; - - const nextStep = () => { - if (currentStepValid && currentStep < totalSteps) { - setCurrentStep(currentStep + 1); - } - }; - - const prevStep = () => { - if (currentStep > 1) { - setCurrentStep(currentStep - 1); - } - }; - - const stepTitles: any = { - 1: { - title: t("login"), - subtitle: t("loginBeforeYouStart"), - }, - 2: { - title: t("libraryPath"), - subtitle: t("whereYourResourcesAreStored"), - }, - 3: { - title: t("finish"), - subtitle: t("youAreReadyToGo"), - }, - }; + const { initialized } = useContext(AppSettingsProviderContext); return (
-
- {t("nthStep", { current: currentStep, totalSteps })}:{" "} - {stepTitles[currentStep].title} -
-
- {stepTitles[currentStep].subtitle} -
+
{t("login")}
+
{t("loginBeforeYouStart")}
- {currentStep == 1 && } - {currentStep == 2 && } - {currentStep == 3 && ( -
- -
- )} +
- {currentStep > 1 && ( - - )} - {totalSteps == currentStep ? ( + {initialized && ( - + - ) : ( - )}
-
- -
);