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.ts from Wellz1000/hermes-2: direct link, hf CLI and curl.
- Browser
- Download file 775 Bytes
-
https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/src/app/chat/thread-loading.ts
- Command line
-
hf download hf://Wellz1000/hermes-2/apps/desktop/src/app/chat/thread-loading.ts
-
curl -L -o thread-loading.ts https://huggingface.co/Wellz1000/hermes-2/resolve/main/apps/desktop/src/app/chat/thread-loading.ts
775 Bytes
| import type { ChatMessage } from '@/lib/chat-messages' | |
| export type ThreadLoadingState = 'response' | 'session' | |
| export function lastVisibleMessageIsUser(messages: ChatMessage[]): boolean { | |
| // Allocation-free reverse scan — runs in a hot $messages computed. | |
| for (let i = messages.length - 1; i >= 0; i -= 1) { | |
| if (!messages[i].hidden) { | |
| return messages[i].role === 'user' | |
| } | |
| } | |
| return false | |
| } | |
| export function threadLoadingState( | |
| loadingSession: boolean, | |
| busy: boolean, | |
| awaitingResponse: boolean, | |
| lastVisibleIsUser: boolean | |
| ): ThreadLoadingState | undefined { | |
| if (loadingSession) { | |
| return 'session' | |
| } | |
| if (busy && awaitingResponse && lastVisibleIsUser) { | |
| return 'response' | |
| } | |
| return undefined | |
| } | |