Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions src/components/ReasoningModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
InferenceMode,
} from "../types/electron";
import { Button } from "./ui/button";
import { Cloud, Lock, Zap } from "lucide-react";
import { CircleAlert, Cloud, Lock, Zap } from "lucide-react";
import ApiKeyInput from "./ui/ApiKeyInput";
import ModelCardList from "./ui/ModelCardList";
import LocalModelPicker, { type LocalProvider } from "./LocalModelPicker";
Expand Down Expand Up @@ -245,23 +245,33 @@ function GpuStatusBadge() {
// State 6: Activation failed
if (!isGpu && activationFailed) {
return (
<div className="flex items-center gap-1.5 mt-2 px-1">
<span className="inline-block w-1.5 h-1.5 rounded-full shrink-0 bg-warning" />
<span className="text-xs text-muted-foreground">{t("gpu.activationFailed")}</span>
<button
type="button"
onClick={handleRetry}
className="text-xs text-muted-foreground hover:text-foreground transition-colors ml-1"
>
{t("gpu.retry")}
</button>
<button
<div className="mt-2 flex items-start justify-between gap-3 rounded-md border border-warning/40 bg-warning/5 p-2.5">
<div className="flex min-w-0 items-start gap-2">
<CircleAlert size={15} className="mt-0.5 shrink-0 text-warning" />
<div className="min-w-0">
<p className="text-xs font-medium text-foreground">{t("gpu.activationFailed")}</p>
<p className="mt-0.5 text-xs leading-snug text-muted-foreground">
{t("gpu.reasoningActivationFailedDescription")}
</p>
<Button
type="button"
onClick={handleRetry}
size="sm"
className="mt-2 h-7 px-3 text-xs"
>
{t("gpu.retryActivation")}
</Button>
</div>
</div>
<Button
type="button"
onClick={handleDelete}
className="text-xs text-muted-foreground hover:text-foreground transition-colors ml-auto"
size="sm"
variant="ghost"
className="h-6 shrink-0 px-2 text-xs text-muted-foreground hover:text-destructive"
>
{t("gpu.remove")}
</button>
</Button>
</div>
);
}
Expand Down
114 changes: 69 additions & 45 deletions src/components/TranscriptionModelPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { Button } from "./ui/button";
import { Input } from "./ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select";
import { Download, Trash2, Cloud, Lock, X, Zap, Check } from "lucide-react";
import { Download, Trash2, Cloud, Lock, X, Zap, Check, CircleAlert } from "lucide-react";
import { ProviderIcon } from "./ui/ProviderIcon";
import { ProviderTabs } from "./ui/ProviderTabs";
import ModelCardList from "./ui/ModelCardList";
Expand Down Expand Up @@ -1298,55 +1298,79 @@ export default function TranscriptionModelPicker({
!gpuDismissed &&
!gpuDownloading &&
gpuBackend && (
<div className="rounded-md border border-border bg-surface-1 p-2.5">
<div
className={`rounded-md border p-2.5 ${
gpuDownloaded && gpuFailed
? "border-warning/40 bg-warning/5"
: "border-border bg-surface-1"
}`}
>
{gpuDownloaded ? (
<div className="flex items-center justify-between">
<div className="flex items-center gap-1.5">
{gpuFailed ? (
<>
<span className="inline-block w-1.5 h-1.5 rounded-full shrink-0 bg-warning" />
<span className="text-xs font-medium text-foreground">
gpuFailed ? (
<div className="flex items-start justify-between gap-3">
<div className="flex min-w-0 items-start gap-2">
<CircleAlert size={15} className="mt-0.5 shrink-0 text-warning" />
<div className="min-w-0">
<p className="text-xs font-medium text-foreground">
{t("gpu.activationFailed")}
</span>
<button
</p>
<p className="mt-0.5 text-xs leading-snug text-muted-foreground">
{t("gpu.activationFailedDescription")}
</p>
<Button
onClick={handleGpuRetry}
className="text-xs text-muted-foreground hover:text-foreground transition-colors ml-1"
size="sm"
className="mt-2 h-7 px-3 text-xs"
>
{t("gpu.retry")}
</button>
</>
) : gpuActivating ? (
<>
<span className="inline-block w-1.5 h-1.5 rounded-full shrink-0 bg-primary animate-pulse" />
<span className="text-xs font-medium text-foreground">
{t("gpu.activating")}
</span>
</>
) : gpuActive ? (
<>
<Check size={13} className="text-success" />
<span className="text-xs font-medium text-foreground">
{t("gpu.active")}
</span>
</>
) : (
<>
<span className="inline-block w-1.5 h-1.5 rounded-full shrink-0 bg-primary" />
<span className="text-xs font-medium text-foreground">
{t("gpu.ready")}
</span>
</>
)}
{t("gpu.retryActivation")}
</Button>
</div>
</div>
<Button
onClick={handleGpuDelete}
size="sm"
variant="ghost"
className="h-6 shrink-0 px-2 text-xs text-muted-foreground hover:text-destructive"
>
{t("gpu.remove")}
</Button>
</div>
<Button
onClick={handleGpuDelete}
size="sm"
variant="ghost"
className="h-6 px-2 text-xs text-muted-foreground hover:text-destructive"
>
{t("gpu.remove")}
</Button>
</div>
) : (
<div className="flex items-center justify-between">
<div className="flex items-center gap-1.5">
{gpuActivating ? (
<>
<span className="inline-block w-1.5 h-1.5 rounded-full shrink-0 bg-primary animate-pulse" />
<span className="text-xs font-medium text-foreground">
{t("gpu.activating")}
</span>
</>
) : gpuActive ? (
<>
<Check size={13} className="text-success" />
<span className="text-xs font-medium text-foreground">
{t("gpu.active")}
</span>
</>
) : (
<>
<span className="inline-block w-1.5 h-1.5 rounded-full shrink-0 bg-primary" />
<span className="text-xs font-medium text-foreground">
{t("gpu.ready")}
</span>
</>
)}
</div>
<Button
onClick={handleGpuDelete}
size="sm"
variant="ghost"
className="h-6 px-2 text-xs text-muted-foreground hover:text-destructive"
>
{t("gpu.remove")}
</Button>
</div>
)
) : (
<div className="flex items-start gap-2.5">
<Zap size={13} className="text-primary shrink-0 mt-0.5" />
Expand Down
14 changes: 13 additions & 1 deletion src/hooks/useMainProcessNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,22 @@ export function useMainProcessNotifications({
});

const showGpuFallbackToast = () => {
toast({
let toastId: string;
toastId = toast({
title: t("app.toasts.gpuFallback.title"),
description: t("app.toasts.gpuFallback.description"),
duration: 10000,
action: (
<button
onClick={async () => {
const result = await window.electronAPI?.whisperGpuRetry?.();
if (result?.success) dismiss(toastId);
}}
className="rounded-sm border border-white/20 bg-white/10 px-2.5 py-1 text-[10px] font-medium whitespace-nowrap text-white/90 transition-colors hover:border-white/35 hover:bg-white/20 hover:text-white"
>
{t("app.toasts.gpuFallback.retry")}
</button>
),
});
};
const unsubscribeCudaFallback =
Expand Down
8 changes: 6 additions & 2 deletions src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3410,8 +3410,11 @@
"active": "GPU-Beschleunigung aktiv",
"ready": "GPU-Beschleunigung bereit",
"activating": "GPU wird aktiviert...",
"activationFailed": "GPU konnte nicht aktiviert werden",
"activationFailed": "GPU-Beschleunigung nicht verfügbar",
"activationFailedDescription": "OpenWhispr verwendet die CPU-Transkription.",
"reasoningActivationFailedDescription": "OpenWhispr verwendet die CPU-Verarbeitung.",
"retry": "Erneut versuchen",
"retryActivation": "GPU-Beschleunigung erneut versuchen",
"remove": "Entfernen",
"dismiss": "Nicht jetzt",
"cancel": "Abbrechen"
Expand All @@ -3434,7 +3437,8 @@
},
"gpuFallback": {
"title": "GPU-Beschleunigung nicht verfügbar",
"description": "Die Transkription verwendet stattdessen die CPU. Du kannst die GPU-Beschleunigung in den Einstellungen deaktivieren."
"description": "OpenWhispr verwendet die CPU-Transkription.",
"retry": "GPU erneut versuchen"
},
"gpuPackMigration": {
"title": "GPU-Paket muss erneut heruntergeladen werden",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3410,8 +3410,11 @@
"active": "GPU acceleration active",
"ready": "GPU acceleration ready",
"activating": "Activating GPU...",
"activationFailed": "GPU could not be activated",
"activationFailed": "GPU acceleration unavailable",
"activationFailedDescription": "OpenWhispr switched to CPU transcription.",
"reasoningActivationFailedDescription": "OpenWhispr switched to CPU processing.",
"retry": "Retry",
"retryActivation": "Retry GPU acceleration",
"remove": "Remove",
"dismiss": "Not now",
"cancel": "Cancel"
Expand All @@ -3434,7 +3437,8 @@
},
"gpuFallback": {
"title": "GPU acceleration unavailable",
"description": "Transcription is using the CPU instead. You can disable GPU acceleration in Settings."
"description": "OpenWhispr switched to CPU transcription.",
"retry": "Retry GPU"
},
"gpuPackMigration": {
"title": "GPU pack needs re-downloading",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3293,8 +3293,11 @@
"active": "Aceleración GPU activa",
"ready": "Aceleración GPU lista",
"activating": "Activando GPU...",
"activationFailed": "No se pudo activar la GPU",
"activationFailed": "Aceleración GPU no disponible",
"activationFailedDescription": "OpenWhispr cambió a la transcripción por CPU.",
"reasoningActivationFailedDescription": "OpenWhispr cambió al procesamiento por CPU.",
"retry": "Reintentar",
"retryActivation": "Reintentar aceleración GPU",
"remove": "Eliminar",
"dismiss": "Ahora no",
"cancel": "Cancelar"
Expand All @@ -3317,7 +3320,8 @@
},
"gpuFallback": {
"title": "Aceleración GPU no disponible",
"description": "La transcripción está usando la CPU. Puedes desactivar la aceleración GPU en Configuración."
"description": "OpenWhispr cambió a la transcripción por CPU.",
"retry": "Reintentar GPU"
},
"gpuPackMigration": {
"title": "Es necesario volver a descargar el paquete GPU",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3410,8 +3410,11 @@
"active": "Accélération GPU active",
"ready": "Accélération GPU prête",
"activating": "Activation du GPU...",
"activationFailed": "Impossible d'activer le GPU",
"activationFailed": "Accélération GPU indisponible",
"activationFailedDescription": "OpenWhispr est passé à la transcription par CPU.",
"reasoningActivationFailedDescription": "OpenWhispr est passé au traitement par CPU.",
"retry": "Réessayer",
"retryActivation": "Réessayer l’accélération GPU",
"remove": "Supprimer",
"dismiss": "Pas maintenant",
"cancel": "Annuler"
Expand All @@ -3434,7 +3437,8 @@
},
"gpuFallback": {
"title": "Accélération GPU indisponible",
"description": "La transcription utilise le CPU à la place. Vous pouvez désactiver l'accélération GPU dans les paramètres."
"description": "OpenWhispr est passé à la transcription par CPU.",
"retry": "Réessayer le GPU"
},
"gpuPackMigration": {
"title": "Le pack GPU doit être retéléchargé",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3245,8 +3245,11 @@
"active": "Accelerazione GPU attiva",
"ready": "Accelerazione GPU pronta",
"activating": "Attivazione GPU...",
"activationFailed": "Impossibile attivare la GPU",
"activationFailed": "Accelerazione GPU non disponibile",
"activationFailedDescription": "OpenWhispr sta usando la trascrizione CPU.",
"reasoningActivationFailedDescription": "OpenWhispr sta usando l'elaborazione CPU.",
"retry": "Riprova",
"retryActivation": "Riprova l'accelerazione GPU",
"remove": "Rimuovi",
"dismiss": "Non ora",
"cancel": "Annulla"
Expand All @@ -3269,7 +3272,8 @@
},
"gpuFallback": {
"title": "Accelerazione GPU non disponibile",
"description": "La trascrizione sta usando la CPU. Puoi disattivare l'accelerazione GPU nelle Impostazioni."
"description": "OpenWhispr sta usando la trascrizione CPU.",
"retry": "Riprova GPU"
},
"gpuPackMigration": {
"title": "Il pacchetto GPU deve essere scaricato di nuovo",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3245,8 +3245,11 @@
"active": "GPU アクセラレーション有効",
"ready": "GPUアクセラレーション準備完了",
"activating": "GPU を有効化中...",
"activationFailed": "GPU を有効化できませんでした",
"activationFailed": "GPU アクセラレーションを利用できません",
"activationFailedDescription": "OpenWhispr は CPU 文字起こしに切り替えました。",
"reasoningActivationFailedDescription": "OpenWhispr は CPU 処理に切り替えました。",
"retry": "再試行",
"retryActivation": "GPU アクセラレーションを再試行",
"remove": "削除",
"dismiss": "後で",
"cancel": "キャンセル"
Expand All @@ -3269,7 +3272,8 @@
},
"gpuFallback": {
"title": "GPU アクセラレーションを利用できません",
"description": "文字起こしは代わりに CPU を使用しています。設定で GPU アクセラレーションを無効にできます。"
"description": "OpenWhispr は CPU 文字起こしに切り替えました。",
"retry": "GPU を再試行"
},
"gpuPackMigration": {
"title": "GPU パックの再ダウンロードが必要です",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3245,8 +3245,11 @@
"active": "Aceleração GPU ativa",
"ready": "Aceleração GPU pronta",
"activating": "Ativando GPU...",
"activationFailed": "Não foi possível ativar a GPU",
"activationFailed": "Aceleração GPU indisponível",
"activationFailedDescription": "OpenWhispr mudou para a transcrição por CPU.",
"reasoningActivationFailedDescription": "OpenWhispr mudou para o processamento por CPU.",
"retry": "Tentar novamente",
"retryActivation": "Tentar aceleração por GPU novamente",
"remove": "Remover",
"dismiss": "Agora não",
"cancel": "Cancelar"
Expand All @@ -3269,7 +3272,8 @@
},
"gpuFallback": {
"title": "Aceleração GPU indisponível",
"description": "A transcrição está usando a CPU. Você pode desativar a aceleração GPU nas Configurações."
"description": "OpenWhispr mudou para a transcrição por CPU.",
"retry": "Tentar GPU novamente"
},
"gpuPackMigration": {
"title": "O pacote GPU precisa ser baixado novamente",
Expand Down
8 changes: 6 additions & 2 deletions src/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3273,8 +3273,11 @@
"active": "Ускорение GPU активно",
"ready": "Ускорение GPU готово",
"activating": "Активация GPU...",
"activationFailed": "Не удалось активировать GPU",
"activationFailed": "Ускорение GPU недоступно",
"activationFailedDescription": "OpenWhispr переключился на транскрипцию на CPU.",
"reasoningActivationFailedDescription": "OpenWhispr переключился на обработку на CPU.",
"retry": "Повторить",
"retryActivation": "Повторить ускорение GPU",
"remove": "Удалить",
"dismiss": "Не сейчас",
"cancel": "Отмена"
Expand All @@ -3297,7 +3300,8 @@
},
"gpuFallback": {
"title": "Ускорение GPU недоступно",
"description": "Транскрипция выполняется на CPU. Вы можете отключить ускорение GPU в настройках."
"description": "OpenWhispr переключился на транскрипцию на CPU.",
"retry": "Повторить GPU"
},
"gpuPackMigration": {
"title": "Требуется повторная загрузка GPU-пакета",
Expand Down
Loading
Loading