Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
knoopx committed Oct 30, 2023
1 parent ff90241 commit 0ac27f7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun vite build
- run: bun vite build --base="/llm-workbench/"
- uses: actions/upload-pages-artifact@v2
with:
path: "dist"
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"devDependencies": {
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"autoprefixer": "^10.4.16",
"bun-types": "latest",
"postcss": "^8.4.31",
Expand Down
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
onSnapshot(store, (snapshot) => {
window.localStorage.setItem("store", JSON.stringify(snapshot))
})

console.log("Initialized")
9 changes: 4 additions & 5 deletions src/lib/extraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ async function extractWithMammoth(file: File) {
return result.value
}

// import pdfParse from "pdf-parse"
const pdfjs = await import("pdfjs-dist/build/pdf")
const pdfjsWorker = await import("pdfjs-dist/build/pdf.worker.entry")
pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker

async function extractWithPDFParse(file: File) {
const pdfjs = await import("pdfjs-dist/build/pdf")
const pdfjsWorker = await import("pdfjs-dist/build/pdf.worker.entry")
pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker

async function getDoc(file) {
const arrayBuffer = await readFileInputEventAsArrayBuffer(file)
const result = await pdfjs.getDocument({
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
4 changes: 0 additions & 4 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"

export default defineConfig({
base: "/llm-workbench/",
build: {
target: 'esnext'
},
plugins: [react()],
resolve: {
alias: {
Expand Down

0 comments on commit 0ac27f7

Please sign in to comment.