ref: format

This commit is contained in:
alikia2x (寒寒) 2024-10-07 01:41:21 +08:00
parent 76c4472de1
commit ea8b503653
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
11 changed files with 4326 additions and 371 deletions

View File

@ -12,7 +12,7 @@ import { settingsAtom } from "lib/state/settings";
import PlainText from "./plainText";
import { sendError } from "lib/telemetering/sendError";
import { handleNLUResult } from "./handleNLUResult";
import * as ort from 'onnxruntime-web';
import * as ort from "onnxruntime-web";
import { useAtom, useAtomValue } from "jotai";
import i18next from "i18next";
import { useTranslation } from "react-i18next";
@ -105,11 +105,10 @@ export default function OneSearch() {
// console.error("NLU model was not correctly loaded.")
// }
})();
}, []);
async function loadModel(modelPath: string) {
ort.env.wasm.wasmPaths = "/onnx/"
ort.env.wasm.wasmPaths = "/onnx/";
const session = await ort.InferenceSession.create(modelPath);
setNLUsession(session);
}

View File

@ -15,7 +15,10 @@ export default function AboutPage() {
<span className="leading-7 md:leading-9 text-3xl font-bold">sparkast</span>
<p className="mt-2 leading-5 text-base md:text-xl">
Made with <span className="text-red-500"></span> by
<a className="underline decoration-dotted text-red-500 mx-1" href="https://alikia2x.com">
<a
className="underline decoration-dotted text-red-500 mx-1"
href="https://alikia2x.com"
>
alikia2x
</a>
from Luminara Studio
@ -40,7 +43,7 @@ export default function AboutPage() {
className="relative px-2 py-1 text-sm font-bold rounded-md text-nowrap underline
bg-green-600 text-white"
>
<a href="/about/license">{t('about.license.view')}</a>
<a href="/about/license">{t("about.license.view")}</a>
</span>
</p>

View File

@ -1 +1,13 @@
{"idx_to_class": {"0": "weather", "1": "base64", "2": "url-encode", "3": "html-encode", "4": "ai.command", "5": "knowledge", "6": "ai.question", "7": "datetime"}, "threshold": 1.7}
{
"idx_to_class": {
"0": "weather",
"1": "base64",
"2": "url-encode",
"3": "html-encode",
"4": "ai.command",
"5": "knowledge",
"6": "ai.question",
"7": "datetime"
},
"threshold": 1.7
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import { isValidIPv4, } from "../lib/url/validLink";
import { isValidIPv4 } from "../lib/url/validLink";
describe("Check if a string is a valid IPv4", () => {
test("Invalid IPv4 addresses - Missing part", () => {