mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(desktop): support pnpm 11 packaging
This commit is contained in:
1 parent
a54af007ae
commit
4a9801226f
3 files changed
+556
-566
No files matched your search
@@ -32,7 +32,10 @@ export default function verifyPackagedLocalRuntime(context) {
|
||||
const { createRequire } = require('node:module');
|
||||
const path = require('node:path');
|
||||
const requireFromApp = createRequire(path.join(process.env.CHATLAB_PACKAGED_RESOURCES, 'app.asar', 'package.json'));
|
||||
requireFromApp.resolve('@huggingface/transformers');
|
||||
const transformers = requireFromApp('@huggingface/transformers');
|
||||
if (typeof transformers.pipeline !== 'function') {
|
||||
throw new Error('Packaged @huggingface/transformers does not expose pipeline()');
|
||||
}
|
||||
requireFromApp('onnxruntime-common');
|
||||
requireFromApp('onnxruntime-node');
|
||||
requireFromApp('sharp');
|
||||
|
||||
Reference in new issue
Block a user