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/src/app/chat/thread-loading.test.ts from Wellz1000/hermes-2: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/src/app/chat/thread-loading.test.ts
- Command line
-
hf download hf://Wellz1000/hermes-2/apps/desktop/src/app/chat/thread-loading.test.ts
-
curl -L -o thread-loading.test.ts https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/src/app/chat/thread-loading.test.ts
1.28 kB
| import { describe, expect, it } from 'vitest' | |
| import type { ChatMessage } from '@/lib/chat-messages' | |
| import { lastVisibleMessageIsUser, threadLoadingState } from './thread-loading' | |
| function message(id: string, role: ChatMessage['role'], hidden = false): ChatMessage { | |
| return { | |
| id, | |
| role, | |
| parts: [{ type: 'text', text: `${role}:${id}` }], | |
| hidden | |
| } | |
| } | |
| describe('thread loading state', () => { | |
| it('returns session when routed session is still hydrating', () => { | |
| expect(threadLoadingState(true, true, true, false)).toBe('session') | |
| }) | |
| it('returns response while awaiting an assistant reply to the last visible user message', () => { | |
| const messages = [message('u1', 'user'), message('a1', 'assistant', true)] | |
| expect(lastVisibleMessageIsUser(messages)).toBe(true) | |
| expect(threadLoadingState(false, true, true, lastVisibleMessageIsUser(messages))).toBe('response') | |
| }) | |
| it('does not show response loading when the last visible message is not user-authored', () => { | |
| const messages = [message('u1', 'user'), message('a1', 'assistant')] | |
| expect(lastVisibleMessageIsUser(messages)).toBe(false) | |
| expect(threadLoadingState(false, true, true, lastVisibleMessageIsUser(messages))).toBeUndefined() | |
| }) | |
| }) | |