Instructions to use Wellz1000/hermes-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- HERMES
How to use Wellz1000/hermes-2 with HERMES:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download apps/desktop/scripts/bundle-electron-main.mjs from Wellz1000/hermes-2: direct link, hf CLI and curl.
- Browser
- Download file 2.22 kB
-
https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/scripts/bundle-electron-main.mjs
- Command line
-
hf download hf://Wellz1000/hermes-2/apps/desktop/scripts/bundle-electron-main.mjs
-
curl -L -o bundle-electron-main.mjs https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/scripts/bundle-electron-main.mjs
2.22 kB
| // bundle-electron-main.mjs — bundles electron/main.ts and electron/preload.ts | |
| // into self-contained js files in dist/ so the packaged app doesn't need | |
| // node_modules/ or tsx at runtime. | |
| // | |
| // Output: | |
| // dist/electron-main.mjs (MJS bundle — entry point for packaged app) | |
| // dist/electron-preload.js (CJS bundle — loaded via BrowserWindow preload) | |
| // | |
| // `electron` and `node-pty` are external (provided by the runtime / staged | |
| // separately via stage-native-deps). | |
| import { build } from 'esbuild' | |
| import { resolve, dirname } from 'node:path' | |
| import { fileURLToPath } from 'node:url' | |
| import { mkdirSync } from 'node:fs' | |
| const here = dirname(fileURLToPath(import.meta.url)) | |
| const root = resolve(here, '..') | |
| const distDir = resolve(root, 'dist') | |
| mkdirSync(distDir, { recursive: true }) | |
| const mainEntry = resolve(root, 'electron/main.ts') | |
| const mainOut = resolve(distDir, 'electron-main.mjs') | |
| const preloadEntry = resolve(root, 'electron/preload.ts') | |
| const preloadOut = resolve(distDir, 'electron-preload.js') | |
| const external = ['electron', 'node-pty', 'fs'] | |
| // Production bundles bake packaged=true so unpackaged `electron .` still | |
| // behaves like a packaged build. Dev bundles (`--dev`) leave the env alone | |
| // so HERMES_DESKTOP_DEV_SERVER / source-tree resolution keep working. | |
| const isDev = process.argv.includes('--dev') | |
| const define = isDev | |
| ? {} | |
| : { 'process.env.HERMES_DESKTOP_IS_PACKAGED': JSON.stringify(true) } | |
| // Bundle main.ts → dist/electron-main.mjs | |
| await build({ | |
| entryPoints: [mainEntry], | |
| bundle: true, | |
| platform: 'node', | |
| format: 'esm', | |
| target: 'node20', | |
| outfile: mainOut, | |
| external, | |
| banner: { | |
| js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);", | |
| }, | |
| define, | |
| logLevel: 'info', | |
| }) | |
| console.log(`bundled ${mainOut}${isDev ? ' (dev)' : ''}`) | |
| // Bundle preload.ts → dist/electron-preload.js | |
| await build({ | |
| entryPoints: [preloadEntry], | |
| bundle: true, | |
| platform: 'node', | |
| format: 'cjs', | |
| target: 'node20', | |
| outfile: preloadOut, | |
| external, | |
| define, | |
| logLevel: 'info', | |
| }) | |
| console.log(`bundled ${preloadOut}${isDev ? ' (dev)' : ''}`) | |