Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion experiments/grouped/codebert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ run_name: "InvCodeBERT-grouped"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
1 change: 0 additions & 1 deletion experiments/grouped/contrabert_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ run_name: "InvContraBERT_C-grouped"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
1 change: 0 additions & 1 deletion experiments/grouped/contrabert_g.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ run_name: "InvContraBERT_G-grouped"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
1 change: 0 additions & 1 deletion experiments/grouped/graphcodebert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ run_name: "InvGraphCodeBERT-grouped"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
1 change: 0 additions & 1 deletion experiments/supcon/contrabert_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ run_name: "InvContraBERT_C-supcon"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"
1 change: 0 additions & 1 deletion experiments/supcon/contrabert_g.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ run_name: "InvContraBERT_G-supcon"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"
1 change: 0 additions & 1 deletion experiments/supcon/graphcodebert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ run_name: "InvGraphCodeBERT-supcon"
alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"
12 changes: 10 additions & 2 deletions modeling/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ def run(
Path,
typer.Argument(help="Path to a YAML experiment config file."),
],
sample_rate: Annotated[
Optional[float],
typer.Option("--sample-rate", "-sr", help="Override sample rate from config."),
] = None,
) -> None:
"""Run pre-training from a YAML config file.

All parameters are read from the config file to ensure full reproducibility.
Use --sample-rate to override the dataset sampling fraction.

Example: python -m modeling run experiments/base.yaml
Example: python -m modeling run experiments/base.yaml --sample-rate 0.1
"""
cfg = load_config(config)
main(**asdict(cfg))
kwargs = asdict(cfg)
if sample_rate is not None:
kwargs["sample_rate"] = sample_rate
main(**kwargs)


@app.command()
Expand Down