Skip to content

Commit f258c1d

Browse files
committed
Fix path issues in model uploading script
1 parent 0fe3273 commit f258c1d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/huggingface/upload_model.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
logger = logging.getLogger("the_well")
1414

15-
CONFIG_DIR = pathlib.Path(__file__) / ".." / ".." / "the_well" / "benchmark" / "configs"
15+
CONFIG_DIR = (
16+
pathlib.Path(__file__) / ".." / ".." / ".." / "the_well" / "benchmark" / "configs"
17+
).resolve()
1618
CONFIG_NAME = "model_upload"
1719

1820

@@ -22,7 +24,8 @@ def link_model_card(model_name: str, target_file: pathlib.Path):
2224
pathlib.Path(__file__) / ".." / ".." / "the_well" / "benchmark" / "models"
2325
)
2426
readme_file = model_directory / model_name / "README.md"
25-
readme_file.symlink_to(target_file)
27+
readme_file = readme_file.resolve()
28+
target_file.symlink_to(readme_file)
2629

2730

2831
def upload_folder(folder: pathlib.Path, repo_id: str):
@@ -32,7 +35,7 @@ def upload_folder(folder: pathlib.Path, repo_id: str):
3235
)
3336

3437

35-
@hydra.main(config_path=CONFIG_DIR, config_name=CONFIG_NAME)
38+
@hydra.main(config_path=str(CONFIG_DIR), config_name=CONFIG_NAME)
3639
def main(cfg: DictConfig):
3740
logger.info(f"Instantiate datamodule {cfg.data._target_}")
3841
datamodule: WellDataModule = instantiate(cfg.data)

0 commit comments

Comments
 (0)