Spaces:
Running on Zero
Running on Zero
Download config.py from R-Kentaren/ChatUI: direct link, hf CLI and curl.
- Browser
- Download file 7.65 kB
-
https://huggingface.co/spaces/R-Kentaren/ChatUI/resolve/main/config.py
- Command line
-
hf download hf://spaces/R-Kentaren/ChatUI/config.py
-
curl -L -o config.py https://huggingface.co/spaces/R-Kentaren/ChatUI/resolve/main/config.py
7.65 kB
| from typing import Dict, Any | |
| # ββ Model Registry ββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| MODEL_REGISTRY: Dict[str, Dict[str, Any]] = { | |
| # ββ Original models (fixed) βββββββββββββββββββββββββββββββββββββββββ | |
| "HuggingFaceTB/SmolLM2-360M-Instruct": { | |
| "label": "SmolLM2 360M", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 2048, | |
| }, | |
| "Qwen/Qwen2.5-0.5B-Instruct": { | |
| "label": "Qwen2.5 0.5B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| "TinyLlama/TinyLlama-1.1B-Chat-v1.0": { | |
| "label": "TinyLlama 1.1B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 2048, | |
| }, | |
| "Qwen/Qwen2.5-1.5B-Instruct": { | |
| "label": "Qwen2.5 1.5B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| "microsoft/Phi-3.5-mini-instruct": { | |
| "label": "Phi-3.5 mini", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 128000, | |
| }, | |
| "microsoft/Phi-3-mini-4k-instruct": { | |
| "label": "Phi-3 mini 4K", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 4096, | |
| }, | |
| "Qwen/Qwen2.5-3B-Instruct": { | |
| "label": "Qwen2.5 3B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| "google/gemma-3-1b-it": { | |
| "label": "Gemma-3 1B IT", | |
| "family": "causal-lm", # fixed typo: was "casual-lm" | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, # fixed: missing closing brace | |
| "openbmb/MiniCPM5-2B": { | |
| "label": "MiniCPM5 2B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 131072, | |
| }, | |
| "constructai/Qwenite3.5-2B": { | |
| "label": "Qwenite 3.5 2B Β· T4 trained reasoning", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| # ββ Added 1β3B models βββββββββββββββββββββββββββββββββββββββββββββββ | |
| "HuggingFaceTB/SmolLM2-1.7B-Instruct": { | |
| "label": "SmolLM2 1.7B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 8192, | |
| }, | |
| "google/gemma-2-2b-it": { | |
| "label": "Gemma-2 2B IT", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 8192, | |
| }, | |
| "meta-llama/Llama-3.2-1B-Instruct": { | |
| "label": "Llama-3.2 1B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 131072, | |
| }, | |
| "meta-llama/Llama-3.2-3B-Instruct": { | |
| "label": "Llama-3.2 3B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 131072, | |
| }, | |
| "stabilityai/stablelm-2-1_6b-chat": { | |
| "label": "StableLM-2 1.6B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 4096, | |
| }, | |
| "stabilityai/stablelm-zephyr-3b": { | |
| "label": "StableLM Zephyr 3B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 4096, | |
| }, | |
| "allenai/OLMo-1B-hf": { | |
| "label": "OLMo 1B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 2048, | |
| }, | |
| "HuggingFaceTB/SmolLM-1.7B-Instruct": { | |
| "label": "SmolLM 1.7B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 2048, | |
| }, | |
| "google/gemma-2b-it": { | |
| "label": "Gemma 2B IT", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 8192, | |
| }, | |
| "Qwen/Qwen2-1.5B-Instruct": { | |
| "label": "Qwen2 1.5B", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| "HuggingFaceTB/SmolLM2-1.7B-Instruct-16k": { | |
| "label": "SmolLM2 1.7B Β· 16K", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 16384, | |
| }, | |
| "Qwen/Qwen2.5-1.5B-Instruct-GGUF": { | |
| "label": "Qwen2.5 1.5B GGUF", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| "microsoft/Phi-3-mini-128k-instruct": { | |
| "label": "Phi-3 mini 128K", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 128000, | |
| }, | |
| "google/gemma-3-1b-it-GGUF": { | |
| "label": "Gemma-3 1B IT GGUF", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 32768, | |
| }, | |
| "meta-llama/Llama-3.2-1B-Instruct-GGUF": { | |
| "label": "Llama-3.2 1B GGUF", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 131072, | |
| }, | |
| "meta-llama/Llama-3.2-3B-Instruct-GGUF": { | |
| "label": "Llama-3.2 3B GGUF", | |
| "family": "causal-lm", | |
| "tasks": ["chat", "code", "summarize", "translate", "agent"], | |
| "context": 131072, | |
| }, | |
| } | |
| DEFAULT_MODEL = "HuggingFaceTB/SmolLM2-360M-Instruct" | |
| # ββ Task Registry βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| TASK_REGISTRY: Dict[str, Dict[str, Any]] = { | |
| "chat": { | |
| "label": "π¬ Chat", | |
| "description": "Open-ended conversation", | |
| "system_prompt": "You are a friendly, helpful conversational assistant.", | |
| }, | |
| "code": { | |
| "label": "π» Code", | |
| "description": "Generate, explain, or debug code", | |
| "system_prompt": ( | |
| "You are a senior software engineer. Produce clean, idiomatic, " | |
| "well-commented code. Wrap code in fenced markdown blocks." | |
| ), | |
| }, | |
| "summarize": { | |
| "label": "π Summarize", | |
| "description": "Condense long text into key points", | |
| "system_prompt": ( | |
| "Summarise the user's text in 5β7 bullet points. " | |
| "Be concise and faithful to the source." | |
| ), | |
| }, | |
| "translate": { | |
| "label": "π Translate", | |
| "description": "Translate text between languages", | |
| "system_prompt": ( | |
| "Translate the user's text. If they don't specify a target " | |
| "language, translate to English." | |
| ), | |
| }, | |
| "agent": { | |
| "label": "π€ Agent", | |
| "description": "Autonomous tool-using agent", | |
| "system_prompt": ( | |
| "You are an autonomous agent. Use tools when they help, " | |
| "then give a final answer." | |
| ), | |
| }, | |
| } |