Download router.js from VethaNarayananG/MultiModel-AI-Router: direct link, hf CLI and curl.
- Browser
- Download file 571 Bytes
-
https://huggingface.co/spaces/VethaNarayananG/MultiModel-AI-Router/resolve/main/router.js
- Command line
-
hf download hf://spaces/VethaNarayananG/MultiModel-AI-Router/router.js
-
curl -L -o router.js https://huggingface.co/spaces/VethaNarayananG/MultiModel-AI-Router/resolve/main/router.js
571 Bytes
| const keywords = { | |
| image:[ | |
| "draw","image","picture","paint","generate image","photo" | |
| ], | |
| translation:[ | |
| "translate","translation","convert language" | |
| ], | |
| summary:[ | |
| "summarize","summary","shorten" | |
| ], | |
| caption:[ | |
| "describe image","caption" | |
| ] | |
| }; | |
| function detectTask(prompt){ | |
| prompt = prompt.toLowerCase(); | |
| for(let task in keywords){ | |
| for(let word of keywords[task]){ | |
| if(prompt.includes(word)){ | |
| return task; | |
| } | |
| } | |
| } | |
| return "text"; | |
| } |