Skip to content

Commit 2122324

Browse files
committed
Apply suggested pathlib edits
1 parent d43f34a commit 2122324

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/huggingface/upload_model.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

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

15-
CONFIG_DIR = (
16-
pathlib.Path(__file__) / ".." / ".." / ".." / "the_well" / "benchmark" / "configs"
17-
).resolve()
15+
CONFIG_DIR = (pathlib.Path(__file__) / "../../../the_well/benchmark/configs").resolve(
16+
strict=True
17+
)
1818
CONFIG_NAME = "model_upload"
1919

2020

@@ -57,8 +57,7 @@ def main(cfg: DictConfig):
5757
dataset_name = str(cfg.data.well_dataset_name)
5858
repo_id = f"polymathic-ai/{model_name}-{dataset_name}"
5959
logger.info("Uploading model.")
60-
model_card_path = (model_path / "README.md").resolve()
61-
assert model_card_path.exists(), f"{model_card_path} does not exist."
60+
model_card_path = (model_path / "README.md").resolve(strict=True)
6261
# Upload model with HF formalism
6362
model.push_to_hub(
6463
repo_id=repo_id,

0 commit comments

Comments
 (0)