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
File size: 1,284 Bytes
bb79dd4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 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()
})
})
|