Spaces:
Runtime error
Runtime error
Download core/fusion.py from BrainDrive/FinanceEval: direct link, hf CLI and curl.
- Browser
- Download file 628 Bytes
-
https://huggingface.co/spaces/BrainDrive/FinanceEval/resolve/main/core/fusion.py
- Command line
-
hf download hf://spaces/BrainDrive/FinanceEval/core/fusion.py
-
curl -L -o fusion.py https://huggingface.co/spaces/BrainDrive/FinanceEval/resolve/main/core/fusion.py
628 Bytes
| # core/fusion.py (simplified: no fusion, just pass-through) | |
| from typing import Dict | |
| def normalize_llm_score(judge_score) -> float: | |
| """ | |
| Convert LLM score (1–5) into 0–10 scale. | |
| If None, return 0. | |
| """ | |
| if judge_score is None: | |
| return 0.0 | |
| try: | |
| return round(max(0.0, min(5.0, float(judge_score))) * 2.0, 2) | |
| except Exception: | |
| return 0.0 | |
| def weighted_total(metric_scores_0_10: Dict[str, float], weights: Dict[str, float]) -> float: | |
| tot = 0.0 | |
| for k, v in metric_scores_0_10.items(): | |
| w = weights.get(k, 0.0) | |
| tot += (v or 0.0) * w | |
| return round(tot, 2) | |