fix: embed admin webui and wasm for serverless runtime

This commit is contained in:
CJACK
2026-02-16 18:56:11 +08:00
parent 057862f7fb
commit f82a7e3e3c
9 changed files with 408 additions and 9 deletions

Binary file not shown.

View File

@@ -0,0 +1,6 @@
package deepseek
import _ "embed"
//go:embed assets/sha3_wasm_bg.7b9ca65ddd.wasm
var embeddedWASM []byte

View File

@@ -33,8 +33,11 @@ func (p *PowSolver) init(ctx context.Context) error {
p.once.Do(func() {
wasmBytes, err := os.ReadFile(p.wasmPath)
if err != nil {
p.err = err
return
if len(embeddedWASM) == 0 {
p.err = err
return
}
wasmBytes = embeddedWASM
}
p.runtime = wazero.NewRuntime(ctx)
p.compiled, p.err = p.runtime.CompileModule(ctx, wasmBytes)