refac: transformer.js

This commit is contained in:
Timothy Jaeryang Baek
2025-02-08 02:34:30 -08:00
parent 9be8bea6f4
commit 181fca4707
4 changed files with 132 additions and 75 deletions

View File

@@ -1,6 +1,8 @@
<script lang="ts">
import * as ort from 'onnxruntime-web';
import { AutoModel, AutoTokenizer } from '@huggingface/transformers';
import { env, AutoModel, AutoTokenizer } from '@huggingface/transformers';
env.backends.onnx.wasm.wasmPaths = '/wasm/';
import { onMount, getContext } from 'svelte';
import { models } from '$lib/stores';