From bc1a44bec96c391f87d86f1e9c53335db0256774 Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Thu, 1 Feb 2024 13:19:26 -0800 Subject: [PATCH] fix: update deploy config for render instead of github pages --- index.html | 1 - src/router.tsx | 47 ++++++++++++++++------------------ src/whisper-utils.ts | 60 ++++++++++++++++++++++---------------------- vite.config.ts | 1 - 4 files changed, 51 insertions(+), 58 deletions(-) diff --git a/index.html b/index.html index 68734a2..9864654 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,6 @@ Orderly: Dictation-based book writing -
diff --git a/src/router.tsx b/src/router.tsx index d1eb16a..e89ee5b 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -1,33 +1,28 @@ -import { createHashRouter } from "react-router-dom"; +import { createBrowserRouter } from "react-router-dom"; import { App } from "./App"; import { Demo } from "./Demo"; import { Home } from "./routes/Home"; import { Chapter } from "./routes/Chapter"; import { Snippet } from "./routes/Snippet"; -export const router = createHashRouter( - [ - { - path: "", - element: , - children: [ - { - path: "", - element: , - }, - { - path: "books/:bookId/chapters/:chapterId", - element: , - children: [{ path: "snippets/:snippetId", element: }], - }, - ], - }, - { - path: "/demo", - element: , - }, - ], +export const router = createBrowserRouter([ { - // basename: "orderly", - } -); + path: "", + element: , + children: [ + { + path: "", + element: , + }, + { + path: "books/:bookId/chapters/:chapterId", + element: , + children: [{ path: "snippets/:snippetId", element: }], + }, + ], + }, + { + path: "/demo", + element: , + }, +]); diff --git a/src/whisper-utils.ts b/src/whisper-utils.ts index 9aa773f..d5149ad 100644 --- a/src/whisper-utils.ts +++ b/src/whisper-utils.ts @@ -3,8 +3,8 @@ export const whisperModelUrls = { tiny: "/models/tiny.bin", "base.en": "/models/base.en.bin", base: "/models/base.bin", - "small.en": "/models/small.en.bin", - small: "/models/small.bin", + // "small.en": "/models/small.en.bin", + // small: "/models/small.bin", "tiny-en-q5_1": "/models/tiny.en-q5_1.bin", "tiny-q5_1": "/models/tiny-q5_1.bin", @@ -12,9 +12,9 @@ export const whisperModelUrls = { "base-q5_1": "/models/base-q5_1.bin", "small-en-q5_1": "/models/small.en-q5_1.bin", "small-q5_1": "/models/small-q5_1.bin", - "medium-en-q5_0": "/models/medium.en-q5_0.bin", - "medium-q5_0": "/models/medium-q5_0.bin", - "large-q5_0": "/models/large-q5_0.bin", + // "medium-en-q5_0": "/models/medium.en-q5_0.bin", + // "medium-q5_0": "/models/medium-q5_0.bin", + // "large-q5_0": "/models/large-q5_0.bin", }; export const whisperModelSizes = { @@ -22,8 +22,8 @@ export const whisperModelSizes = { tiny: 75, "base.en": 142, base: 142, - "small.en": 466, - small: 466, + // "small.en": 466, + // small: 466, "tiny-en-q5_1": 31, "tiny-q5_1": 31, @@ -31,9 +31,9 @@ export const whisperModelSizes = { "base-q5_1": 57, "small-en-q5_1": 182, "small-q5_1": 182, - "medium-en-q5_0": 515, - "medium-q5_0": 515, - "large-q5_0": 1030, + // "medium-en-q5_0": 515, + // "medium-q5_0": 515, + // "large-q5_0": 1030, }; export interface ModelOption { @@ -58,14 +58,14 @@ export const whisperModelsBase: ModelOption[] = [ label: "base (142 MB)", value: "base", }, - { - label: "small.en (466 MB)", - value: "small.en", - }, - { - label: "small (466 MB)", - value: "small", - }, + // { + // label: "small.en (466 MB)", + // value: "small.en", + // }, + // { + // label: "small (466 MB)", + // value: "small", + // }, ]; export const whisperModelsQuantized: ModelOption[] = [ @@ -96,19 +96,19 @@ export const whisperModelsQuantized: ModelOption[] = [ value: "small-q5_1", }, - { - label: "medium.en (Q5_0, 515 MB)", - value: "medium-en-q5_0", - }, - { - label: "medium (Q5_0, 515 MB)", - value: "medium-q5_0", - }, + // { + // label: "medium.en (Q5_0, 515 MB)", + // value: "medium-en-q5_0", + // }, + // { + // label: "medium (Q5_0, 515 MB)", + // value: "medium-q5_0", + // }, - { - label: "large (Q5_0, 1030 MB)", - value: "large-q5_0", - }, + // { + // label: "large (Q5_0, 1030 MB)", + // value: "large-q5_0", + // }, ]; export const whisperModels = [...whisperModelsBase, ...whisperModelsQuantized]; diff --git a/vite.config.ts b/vite.config.ts index 5502ddb..0c0ebd6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,7 +4,6 @@ import { nodePolyfills } from "vite-plugin-node-polyfills"; // https://vitejs.dev/config/ export default defineConfig({ - base: "/orderly/", optimizeDeps: { exclude: ["sqlocal"], },