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
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Versionskontrollaktion wird ausgeführt",
"bd89398fa7d11169": "Die Versionskontrollaktion ist fehlgeschlagen.",
"fac0a7eeb4021001": "{hook} wird ausgeführt...",
"fa6a84f05e3ec11c": "Diese Aufnahme konnte nicht transkribiert werden. Sie wurde für einen neuen Versuch behalten.",
"8822e2c36699fc5d": "Für die Spracheingabe ist Mikrofonzugriff erforderlich. Erlaube den Zugriff in den Browser- oder Systemeinstellungen und versuche es erneut.",
"124a9122bc3ecf5c": "Die Sprachtranskription wird noch abgeschlossen. Versuche es gleich noch einmal.",
"a4727d05b33fe336": "Die Sprachtranskription ist für diese Sprache nicht verfügbar.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Running source control action",
"bd89398fa7d11169": "Source control action failed.",
"fac0a7eeb4021001": "Running {hook}...",
"fa6a84f05e3ec11c": "Could not transcribe this recording. It was kept for a retry.",
"8822e2c36699fc5d": "Microphone access is required for voice input. Allow access in your browser or system settings and try again.",
"124a9122bc3ecf5c": "Voice transcription is still finishing. Try again shortly.",
"a4727d05b33fe336": "Voice transcription is not available for this language.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Ejecutando la acción de control de versiones",
"bd89398fa7d11169": "Falló la acción de control de versiones.",
"fac0a7eeb4021001": "Ejecutando {hook}...",
"fa6a84f05e3ec11c": "No se pudo transcribir esta grabación. Se ha conservado para volver a intentarlo.",
"8822e2c36699fc5d": "La entrada de voz necesita acceso al micrófono. Permite el acceso en los ajustes del navegador o del sistema y vuelve a intentarlo.",
"124a9122bc3ecf5c": "La transcripción de voz aún está terminando. Vuelve a intentarlo en breve.",
"a4727d05b33fe336": "La transcripción de voz no está disponible para este idioma.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Exécution de l’action de gestion de versions",
"bd89398fa7d11169": "Échec de l’action de gestion de versions.",
"fac0a7eeb4021001": "Exécution de {hook}...",
"fa6a84f05e3ec11c": "Impossible de transcrire cet enregistrement. Il a été conservé pour une nouvelle tentative.",
"8822e2c36699fc5d": "L’accès au micro est nécessaire pour la saisie vocale. Autorisez-le dans les paramètres de votre navigateur ou de votre système, puis réessayez.",
"124a9122bc3ecf5c": "La transcription vocale n’est pas encore terminée. Réessayez dans un instant.",
"a4727d05b33fe336": "La transcription vocale n’est pas disponible pour cette langue.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "ソース管理の操作を実行しています",
"bd89398fa7d11169": "ソース管理のアクションに失敗しました。",
"fac0a7eeb4021001": "{hook} を実行しています...",
"fa6a84f05e3ec11c": "この録音を文字起こしできませんでした。再試行できるよう保持されています。",
"8822e2c36699fc5d": "音声入力にはマイクへのアクセスが必要です。ブラウザーまたはシステムの設定でアクセスを許可してから、もう一度お試しください。",
"124a9122bc3ecf5c": "音声の文字起こしがまだ終わっていません。しばらくしてからもう一度お試しください。",
"a4727d05b33fe336": "この言語では音声の文字起こしを利用できません。",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "소스 제어 작업 실행 중",
"bd89398fa7d11169": "소스 제어 작업에 실패했습니다.",
"fac0a7eeb4021001": "{hook} 실행 중...",
"fa6a84f05e3ec11c": "이 녹음을 받아쓰지 못했습니다. 다시 시도할 수 있도록 보관했습니다.",
"8822e2c36699fc5d": "음성 입력에는 마이크 액세스 권한이 필요합니다. 브라우저 또는 시스템 설정에서 액세스를 허용한 후 다시 시도하세요.",
"124a9122bc3ecf5c": "음성 받아쓰기를 아직 마무리하는 중입니다. 잠시 후 다시 시도하세요.",
"a4727d05b33fe336": "이 언어에서는 음성 받아쓰기를 사용할 수 없습니다.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Executando ação de controle de versão",
"bd89398fa7d11169": "A ação de controle de versão falhou.",
"fac0a7eeb4021001": "Executando {hook}...",
"fa6a84f05e3ec11c": "Não foi possível transcrever esta gravação. Ela foi mantida para uma nova tentativa.",
"8822e2c36699fc5d": "É necessário acesso ao microfone para a entrada de voz. Permita o acesso nas configurações do navegador ou do sistema e tente novamente.",
"124a9122bc3ecf5c": "A transcrição de voz ainda está terminando. Tente novamente em instantes.",
"a4727d05b33fe336": "A transcrição de voz não está disponível para este idioma.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Выполнение действия контроля версий",
"bd89398fa7d11169": "Ошибка действия контроля версий.",
"fac0a7eeb4021001": "Выполняется {hook}...",
"fa6a84f05e3ec11c": "Не удалось расшифровать эту запись. Она сохранена для повторной попытки.",
"8822e2c36699fc5d": "Для голосового ввода нужен доступ к микрофону. Разрешите доступ в настройках браузера или системы и повторите попытку.",
"124a9122bc3ecf5c": "Расшифровка голоса ещё не завершена. Повторите чуть позже.",
"a4727d05b33fe336": "Расшифровка голоса недоступна для этого языка.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "Kör versionshanteringsåtgärd",
"bd89398fa7d11169": "Versionshanteringsåtgärden misslyckades.",
"fac0a7eeb4021001": "Kör {hook}...",
"fa6a84f05e3ec11c": "Det gick inte att transkribera inspelningen. Den sparades så att du kan försöka igen.",
"8822e2c36699fc5d": "Mikrofonåtkomst krävs för röstinmatning. Tillåt åtkomst i webbläsarens eller systemets inställningar och försök igen.",
"124a9122bc3ecf5c": "Rösttranskriberingen håller fortfarande på att slutföras. Försök igen snart.",
"a4727d05b33fe336": "Rösttranskribering är inte tillgänglig för det här språket.",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@
"ade1c07a7b86bc75": "正在运行版本控制操作",
"bd89398fa7d11169": "版本控制操作失败。",
"fac0a7eeb4021001": "正在运行 {hook}...",
"fa6a84f05e3ec11c": "无法转写此录音。录音已保留,可以重试。",
"8822e2c36699fc5d": "语音输入需要麦克风权限。请在浏览器或系统设置中允许访问后重试。",
"124a9122bc3ecf5c": "语音转写仍在收尾,请稍后重试。",
"a4727d05b33fe336": "这种语言暂不支持语音转写。",
Expand Down
79 changes: 53 additions & 26 deletions apps/server/src/speech/SpeechService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,24 +818,36 @@ it.effect(
}),
);

it.effect("reports a failure on a GPU the person chose instead of switching to CPU", () =>
Effect.gen(function* () {
const failure = new Error("GPU failed");
native.transcribe.mockRejectedValueOnce(failure);
const speech = yield* SpeechService.SpeechService;
const acceleration = 'gpu:["vulkan","gpu-1"]';
yield* speech.updateAcceleration(acceleration);
const result = yield* Effect.result(
speech.transcribe(pcm(), DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS),
);
expect(Result.isFailure(result) && result.failure).toMatchObject({
_tag: "SpeechOperationError",
operation: "inference",
cause: failure,
});
expect(loadNative).toHaveBeenCalledTimes(1);
expect(loadNative.mock.calls[0]?.[3]).toBe(acceleration);
}).pipe(Effect.provide(layer)),
it.effect.each([
['gpu:["vulkan","gpu-1"]', "cpu"],
["cpu", "auto"],
] as const)(
"retries a recording from a chosen %s on %s only when fallback is on",
([acceleration, other]) =>
Effect.gen(function* () {
const speech = yield* SpeechService.SpeechService;
for (const failing of ["model preparation", "inference"] as const)
for (const fallback of [false, true]) {
loadNative.mockClear();
const failure = new Error("device failed");
if (failing === "inference") native.transcribe.mockRejectedValueOnce(failure);
else loadNative.mockRejectedValueOnce(failure);
yield* speech.updateAcceleration(acceleration, fallback);
const result = yield* Effect.result(
speech.transcribe(pcm(), DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS),
);
if (fallback) expect(Result.isSuccess(result) && result.success).toBe("hello");
else
expect(Result.isFailure(result) && result.failure).toMatchObject({
_tag: "SpeechOperationError",
operation: failing,
cause: failure,
});
expect(loadNative.mock.calls.map((call) => call[3])).toEqual(
fallback ? [acceleration, other] : [acceleration],
);
}
}).pipe(Effect.provide(layer)),
);

it.effect("replays streamed audio on CPU after an Auto-placed feed crashes, once", () =>
Expand Down Expand Up @@ -950,9 +962,15 @@ it.effect.each([false, true])(
}).pipe(Effect.provide(layer)),
);

it.effect.each(["auto", 'gpu:["vulkan","gpu-1"]', "cpu"] as const)(
"reports finalization failure without repeated or explicit-backend fallback: %s",
(acceleration) =>
it.effect.each([
["auto", false],
['gpu:["vulkan","gpu-1"]', false],
["cpu", false],
['gpu:["vulkan","gpu-1"]', true],
["cpu", true],
] as const)(
"reports finalization failure after at most one fallback: %s, fallback %s",
([acceleration, fallback]) =>
Effect.gen(function* () {
const failure = new Error("finish failed");
const worker = {
Expand All @@ -962,15 +980,24 @@ it.effect.each(["auto", 'gpu:["vulkan","gpu-1"]', "cpu"] as const)(
throw failure;
}),
};
const cpu = { ...worker, backend: "CPU", dispose: vi.fn() };
const other = {
...worker,
backend: acceleration === "cpu" ? "Vulkan0" : "CPU",
dispose: vi.fn(),
};
const retries = acceleration === "auto" || fallback;
loadNative.mockResolvedValueOnce(worker);
if (acceleration === "auto") loadNative.mockResolvedValueOnce(cpu);
if (retries) loadNative.mockResolvedValueOnce(other);
const speech = yield* SpeechService.SpeechService;
yield* speech.updateAcceleration(acceleration);
yield* speech.updateAcceleration(acceleration, fallback);
const stream = yield* speech.startStream(DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS);
expect(Result.isFailure(yield* Effect.result(stream.finish))).toBe(true);
expect(worker.finish).toHaveBeenCalledTimes(acceleration === "auto" ? 2 : 1);
expect(loadNative).toHaveBeenCalledTimes(acceleration === "auto" ? 2 : 1);
// The failed stream frees the model before its socket closes, so a retry is not busy.
expect(yield* speech.status).toMatchObject({ state: "ready" });
expect(worker.finish).toHaveBeenCalledTimes(retries ? 2 : 1);
expect(loadNative.mock.calls.map((call) => call[3])).toEqual(
retries ? [acceleration, acceleration === "cpu" ? "auto" : "cpu"] : [acceleration],
);
}).pipe(Effect.scoped, Effect.provide(layer)),
);

Expand Down
Loading
Loading