MCPcopy Create free account
hub / github.com/Speakn0w/RealChart2Code / read_gt_code

Function read_gt_code

RealChart2Code_eval/evaluate_task2.py:575–582  ·  view source on GitHub ↗

读取ground truth代码文件

(gt_code_path: Path)

Source from the content-addressed store, hash-verified

573
574
575def read_gt_code(gt_code_path: Path) -> str:
576 """读取ground truth代码文件"""
577 try:
578 with open(gt_code_path, 'r', encoding='utf-8') as f:
579 return f.read().strip()
580 except Exception as e:
581 print(f"❌ Error reading ground truth code from {gt_code_path}: {e}")
582 return ""
583
584def create_data_evaluation_request(gt_code_path:Path, code_path: Path, data_evaluation_prompt: str, model_name: str) -> Dict:
585 gt_code = read_gt_code(gt_code_path)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected