Spaces:
Sleeping
Sleeping
Download generation_config.py from TheCodeKat/Scholar-Sage: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/TheCodeKat/Scholar-Sage/resolve/main/generation_config.py
- Command line
-
hf download hf://spaces/TheCodeKat/Scholar-Sage/generation_config.py
-
curl -L -o generation_config.py https://huggingface.co/spaces/TheCodeKat/Scholar-Sage/resolve/main/generation_config.py
1.09 kB
| # 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}" | |
| } | |