mirror of
https://github.com/wassname/jsteer.git
synced 2026-09-12 14:50:16 +08:00
fit: tqdm progress bar + first-prompt trace + summary; config configures loguru on import
- Jacobian.fit wraps prompts in tqdm (jlens has no bar; safe since fit only enumerate/len's them), logs the full first prompt (special tokens on, SHOULD line) and a done-summary -- token-efficient-logging style, both tqdm intervals set - config.py sets up loguru on import (compact single-char icons, routed through tqdm.write so bars survive), so every script/notebook importing config gets it - notebooks drop their manual logger setup and import config in cell 1 Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
@@ -9,6 +9,17 @@ template -- see chat_corpus for why.
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
from loguru import logger
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
# Configure loguru once, on import, so every script/notebook that imports config
|
||||
# gets the same compact format. Routed through tqdm.write so log lines don't
|
||||
# break a live progress bar (e.g. the fit bar).
|
||||
logger.remove()
|
||||
logger.add(lambda m: tqdm.write(m, end=""), colorize=True,
|
||||
format="<level>{level.icon}</level> {message}", level="INFO")
|
||||
for _lvl, _icon in (("INFO", "I"), ("WARNING", "W"), ("ERROR", "E"), ("DEBUG", "D")):
|
||||
logger.level(_lvl, icon=_icon)
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
ART = ROOT / "artifacts"
|
||||
|
||||
Reference in New Issue
Block a user