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/assert-dist-built.test.mjs from Wellz1000/hermes-2: direct link, hf CLI and curl.
- Browser
- Download file 3.06 kB
-
https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/scripts/assert-dist-built.test.mjs
- Command line
-
hf download hf://Wellz1000/hermes-2/apps/desktop/scripts/assert-dist-built.test.mjs
-
curl -L -o assert-dist-built.test.mjs https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/scripts/assert-dist-built.test.mjs
3.06 kB
| import assert from 'node:assert/strict' | |
| import fs from 'node:fs' | |
| import os from 'node:os' | |
| import path from 'node:path' | |
| import { test } from 'vitest' | |
| import { checkDistBuilt } from '../scripts/assert-dist-built.mjs' | |
| function makeDist(extra) { | |
| const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'hermes-assert-dist-')) | |
| const distDir = path.join(tempRoot, 'dist') | |
| fs.mkdirSync(distDir, { recursive: true }) | |
| if (extra) extra(distDir) | |
| return { tempRoot, distDir } | |
| } | |
| test('checkDistBuilt passes when index.html + an assets JS bundle exist', () => { | |
| const { tempRoot, distDir } = makeDist(d => { | |
| fs.writeFileSync(path.join(d, 'index.html'), '<!doctype html><div id=root></div>', 'utf8') | |
| fs.mkdirSync(path.join(d, 'assets')) | |
| fs.writeFileSync(path.join(d, 'assets', 'index-abc123.js'), 'console.log(1)', 'utf8') | |
| }) | |
| try { | |
| assert.deepEqual(checkDistBuilt(distDir), { ok: true }) | |
| } finally { | |
| fs.rmSync(tempRoot, { recursive: true, force: true }) | |
| } | |
| }) | |
| test('checkDistBuilt fails when the dist directory is absent', () => { | |
| const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'hermes-assert-dist-')) | |
| try { | |
| const result = checkDistBuilt(path.join(tempRoot, 'dist')) | |
| assert.equal(result.ok, false) | |
| assert.match(result.error, /no dist directory/) | |
| } finally { | |
| fs.rmSync(tempRoot, { recursive: true, force: true }) | |
| } | |
| }) | |
| test('checkDistBuilt fails when index.html is missing', () => { | |
| const { tempRoot, distDir } = makeDist(d => { | |
| fs.mkdirSync(path.join(d, 'assets')) | |
| fs.writeFileSync(path.join(d, 'assets', 'index-abc123.js'), 'console.log(1)', 'utf8') | |
| }) | |
| try { | |
| const result = checkDistBuilt(distDir) | |
| assert.equal(result.ok, false) | |
| assert.match(result.error, /index\.html is missing/) | |
| } finally { | |
| fs.rmSync(tempRoot, { recursive: true, force: true }) | |
| } | |
| }) | |
| test('checkDistBuilt fails when index.html is empty', () => { | |
| const { tempRoot, distDir } = makeDist(d => { | |
| fs.writeFileSync(path.join(d, 'index.html'), '', 'utf8') | |
| fs.mkdirSync(path.join(d, 'assets')) | |
| fs.writeFileSync(path.join(d, 'assets', 'index-abc123.js'), 'console.log(1)', 'utf8') | |
| }) | |
| try { | |
| const result = checkDistBuilt(distDir) | |
| assert.equal(result.ok, false) | |
| assert.match(result.error, /index\.html is empty/) | |
| } finally { | |
| fs.rmSync(tempRoot, { recursive: true, force: true }) | |
| } | |
| }) | |
| test('checkDistBuilt fails when assets/ has no JS bundle', () => { | |
| const { tempRoot, distDir } = makeDist(d => { | |
| fs.writeFileSync(path.join(d, 'index.html'), '<!doctype html>', 'utf8') | |
| fs.mkdirSync(path.join(d, 'assets')) | |
| // CSS only, no JS — still a blank page at runtime. | |
| fs.writeFileSync(path.join(d, 'assets', 'index-abc123.css'), 'body{}', 'utf8') | |
| }) | |
| try { | |
| const result = checkDistBuilt(distDir) | |
| assert.equal(result.ok, false) | |
| assert.match(result.error, /no built JS bundle/) | |
| } finally { | |
| fs.rmSync(tempRoot, { recursive: true, force: true }) | |
| } | |
| }) | |