Spaces:
Running
Running
| """Central configuration -- tweak knobs here, not file to file. | |
| Scalar knobs only (paths, numbers, flags). Agent behavior/prompts live in | |
| agents/*.py; this file stays small and scannable. | |
| """ | |
| from __future__ import annotations | |
| import os | |
| _ROOT = os.path.dirname(__file__) | |
| # --- model / inference --- | |
| # Local dev uses the file under models/; if it is missing (e.g. on the Space) the | |
| # GGUF is pulled from the Hub repo below and cached. | |
| MODEL_PATH = os.path.join(_ROOT, "models", "hf-knight-1.5b-q8_0.gguf") # finetuned narrator (local) | |
| MODEL_REPO = "build-small-hackathon/HF-Knight-Qwen2.5-1.5B-Instruct-GGUF" | |
| MODEL_FILE = "hf-knight-qwen2.5-1.5b-instruct-q8_0.gguf" | |
| N_CTX = 8192 | |
| N_GPU_LAYERS = int(os.getenv("N_GPU_LAYERS", "0")) # 0 = CPU (Space default); set -1 locally for GPU | |
| NARRATOR_TEMP = 1 # storytelling: some creativity | |
| JUDGE_TEMP = 0.0 # grading: deterministic | |
| # --- game rules --- | |
| MAX_ATTEMPT = 3 # strikes before the quest fails | |
| MAX_TOOL_ROUNDS = 5 # safety cap on model<->tool rounds per turn | |
| # --- paths --- | |
| QUEST_DIR = os.path.join(_ROOT, "data", "quests") | |