From b39f48cc81afa697b10825541b4aef19c87913da Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Thu, 29 Jan 2026 20:17:55 -0800 Subject: [PATCH] Refactor useGenerationForm to streamline model download handling - Removed unnecessary isDownloading variable and related logic. - Consolidated model download state reset to the finally block for improved clarity and reliability. - Enhanced error handling by ensuring model download state is reset in case of failure. --- app/src/lib/hooks/useGenerationForm.ts | 11 ++--------- docs/nixpacks.toml | 11 +++++++++++ docs/package.json | 2 ++ landing/src/app/page.tsx | 23 +++++++++++++++++++++++ 4 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 docs/nixpacks.toml diff --git a/app/src/lib/hooks/useGenerationForm.ts b/app/src/lib/hooks/useGenerationForm.ts index 2126d90d..c6fdba50 100644 --- a/app/src/lib/hooks/useGenerationForm.ts +++ b/app/src/lib/hooks/useGenerationForm.ts @@ -70,7 +70,6 @@ export function useGenerationForm(options: UseGenerationFormOptions = {}) { const modelName = `qwen-tts-${data.modelSize}`; const displayName = data.modelSize === '1.7B' ? 'Qwen TTS 1.7B' : 'Qwen TTS 0.6B'; - let isDownloading = false; try { const modelStatus = await apiClient.getModelStatus(); const model = modelStatus.models.find((m) => m.model_name === modelName); @@ -78,7 +77,6 @@ export function useGenerationForm(options: UseGenerationFormOptions = {}) { if (model && !model.downloaded) { setDownloadingModelName(modelName); setDownloadingDisplayName(displayName); - isDownloading = true; } } catch (error) { console.error('Failed to check model status:', error); @@ -103,21 +101,16 @@ export function useGenerationForm(options: UseGenerationFormOptions = {}) { form.reset(); options.onSuccess?.(result.id); - - if (isDownloading) { - setDownloadingModelName(null); - setDownloadingDisplayName(null); - } } catch (error) { toast({ title: 'Generation failed', description: error instanceof Error ? error.message : 'Failed to generate audio', variant: 'destructive', }); - setDownloadingModelName(null); - setDownloadingDisplayName(null); } finally { setIsGenerating(false); + setDownloadingModelName(null); + setDownloadingDisplayName(null); } } diff --git a/docs/nixpacks.toml b/docs/nixpacks.toml new file mode 100644 index 00000000..5cb001d9 --- /dev/null +++ b/docs/nixpacks.toml @@ -0,0 +1,11 @@ +[phases.setup] +nixPkgs = ["nodejs_20", "bun"] + +[phases.install] +cmds = ["bun install"] + +[phases.build] +cmds = ["bun run build"] + +[start] +cmd = "bun run start" diff --git a/docs/package.json b/docs/package.json index e21c43ed..6d177bd9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,6 +4,8 @@ "private": true, "scripts": { "dev": "mintlify dev", + "build": "mintlify build", + "start": "mintlify serve", "install:mintlify": "bun add -g mintlify" }, "devDependencies": { diff --git a/landing/src/app/page.tsx b/landing/src/app/page.tsx index aedd6fd3..be4869f3 100644 --- a/landing/src/app/page.tsx +++ b/landing/src/app/page.tsx @@ -228,6 +228,29 @@ export default function Home() { + {/* Description Section */} +
+
+

+ What is Voicebox? +

+
+

+ Voicebox is a local-first voice cloning studio with DAW-like features + for professional voice synthesis. Think of it as the Ollama for voice{' '} + — download models, clone voices, and generate speech entirely on your machine. +

+

+ Unlike cloud services that lock your voice data behind subscriptions, Voicebox gives + you complete privacy, professional tools, and native performance. Download a voice + model, clone any voice from a few seconds of audio, and compose multi-voice projects + with studio-grade editing tools. +

+

No Python install required.

+
+
+
+ {/* Demo Video Section */}