Download src/lib/utils/transformInput.ts from huggingfacejs/chat-template-playground: direct link, hf CLI and curl.
- Browser
- Download file 207 Bytes
-
https://huggingface.co/spaces/huggingfacejs/chat-template-playground/resolve/main/src/lib/utils/transformInput.ts
- Command line
-
hf download hf://spaces/huggingfacejs/chat-template-playground/src/lib/utils/transformInput.ts
-
curl -L -o transformInput.ts https://huggingface.co/spaces/huggingfacejs/chat-template-playground/resolve/main/src/lib/utils/transformInput.ts
207 Bytes
| export function transformInput(input: Record<string, unknown>, templateStr: string) { | |
| // handle cohere special case | |
| if (templateStr.includes('safety_mode')) { | |
| input.safety_mode = ''; | |
| } | |
| return input; | |
| } | |