Enhanced transcription usability.
This commit is contained in:
1 parent
770cfc9ff7
commit
74858f63fc
8 files changed
+244
-21
No files matched your search
+2
-1
@@ -6,6 +6,7 @@ import { auth } from "./server/auth.ts";
|
||||
import { AUTH_ENABLED } from "./server/flags.ts";
|
||||
import { MAX_UPLOAD_BYTES, transcribe } from "./server/transcribe.ts";
|
||||
import { liveWebSocket } from "./server/live.ts";
|
||||
import { getFasterWhisperModel } from "./lib/models.ts";
|
||||
|
||||
const ROOT = join(import.meta.dir, "..");
|
||||
const IS_PRODUCTION = process.env.NODE_ENV === "production";
|
||||
@@ -129,7 +130,7 @@ async function handleApiRequest(request: Request, server: any): Promise<Response
|
||||
const url = new URL(request.url);
|
||||
const modelId = url.searchParams.get("model");
|
||||
if (!modelId) return new Response("Missing model", { status: 400 });
|
||||
const fasterWhisperModel = transcribe.getFasterWhisperModel?.(modelId) || (await import("./lib/models.ts")).getFasterWhisperModel(modelId);
|
||||
const fasterWhisperModel = getFasterWhisperModel(modelId);
|
||||
if (!fasterWhisperModel) return new Response("Unknown model", { status: 400 });
|
||||
|
||||
const success = server.upgrade(request, {
|
||||
|
||||
Reference in new issue
Block a user