Spaces:
Sleeping
Sleeping
| # Optimized Generation Configurations for Different Use Cases | |
| CONFIGS = { | |
| "creative": { | |
| "temperature": 0.9, | |
| "top_k": 50, | |
| "top_p": 0.95, | |
| "repetition_penalty": 1.1, | |
| "description": "More creative and diverse outputs" | |
| }, | |
| "balanced": { | |
| "temperature": 0.7, | |
| "top_k": 40, | |
| "top_p": 0.9, | |
| "repetition_penalty": 1.3, | |
| "description": "Balanced creativity and coherence (recommended)" | |
| }, | |
| "focused": { | |
| "temperature": 0.5, | |
| "top_k": 30, | |
| "top_p": 0.85, | |
| "repetition_penalty": 1.5, | |
| "description": "More focused and deterministic" | |
| }, | |
| "factual": { | |
| "temperature": 0.3, | |
| "top_k": 20, | |
| "top_p": 0.8, | |
| "repetition_penalty": 1.4, | |
| "description": "Best for encyclopedia-style content" | |
| } | |
| } | |
| # Better prompts for small models | |
| PROMPT_TEMPLATES = { | |
| "article": "Wikipedia article about {topic}:\n\n", | |
| "definition": "{term} is defined as", | |
| "explanation": "Here is an explanation of {topic}:\n\n", | |
| "continuation": "{text}" | |
| } | |