renpas22 commited on
Commit ·
82de57b
1
Parent(s): da76488
Fix config path resolution for HF Jobs
Browse files- train_qwen_cot_dual.py +5 -0
train_qwen_cot_dual.py
CHANGED
|
@@ -58,6 +58,11 @@ logger = logging.getLogger(__name__)
|
|
| 58 |
|
| 59 |
def load_config(config_path: str) -> Dict[str, Any]:
|
| 60 |
"""Load training configuration from YAML file."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
with open(config_path, 'r') as f:
|
| 62 |
config = yaml.safe_load(f)
|
| 63 |
return config
|
|
|
|
| 58 |
|
| 59 |
def load_config(config_path: str) -> Dict[str, Any]:
|
| 60 |
"""Load training configuration from YAML file."""
|
| 61 |
+
# If running in HF Jobs and path is relative, look in repository
|
| 62 |
+
if not Path(config_path).is_absolute() and not Path(config_path).exists():
|
| 63 |
+
if repo_root and (repo_root / config_path).exists():
|
| 64 |
+
config_path = str(repo_root / config_path)
|
| 65 |
+
|
| 66 |
with open(config_path, 'r') as f:
|
| 67 |
config = yaml.safe_load(f)
|
| 68 |
return config
|