Evaluate Gliner2 determinism#50
Open
Essmaw wants to merge 1 commit into
Open
Conversation
…+ add the deterministic parameter
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GLiNER2 training pipeline configuration and execution flow to support evaluating training determinism by adding a deterministic flag, introducing an optional cross-validation toggle, and enabling a standard train/val/test split workflow.
Changes:
- Extend the Pydantic config schema with
data.test_ratio,training.deterministic, andtraining.use_cv. - Update the default training YAML to use a base model, shorter run, no LoRA, and a 60/20/20 train/val/test split.
- Modify the training entrypoint to conditionally run K-fold CV or a single standard split (saving split JSONLs).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/mdner_llm/gliner/training_models.py |
Adds new config fields for test split ratio, determinism, and CV enablement. |
src/mdner_llm/gliner/training_config.yaml |
Adjusts training run parameters and enables a train/val/test split configuration. |
src/mdner_llm/gliner/train_gliner.py |
Wires deterministic into training config and adds a non-CV standard split path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+56
to
+60
| test_ratio: float | None = Field( | ||
| ge=0.0, | ||
| le=1.0, | ||
| description="Fraction of dataset used for test split.", | ||
| ) |
Comment on lines
+626
to
+632
| train_data, val_data, test_data = dataset.split( | ||
| train_ratio=cfg.data.train_ratio, | ||
| val_ratio=cfg.data.val_ratio, | ||
| test_ratio=cfg.data.test_ratio, | ||
| shuffle=True, | ||
| seed=cfg.data.seed, | ||
| ) |
Comment on lines
+638
to
+652
| save_metadata_to_txt( | ||
| selected_annotation_paths, | ||
| urls, | ||
| single_dir / "train.jsonl", | ||
| ) | ||
| save_metadata_to_txt( | ||
| selected_annotation_paths, | ||
| urls, | ||
| single_dir / "val.jsonl", | ||
| ) | ||
| save_metadata_to_txt( | ||
| selected_annotation_paths, | ||
| urls, | ||
| single_dir / "test.jsonl", | ||
| ) |
Comment on lines
+611
to
+621
| if cfg.training.use_cv: | ||
| # K-fold nested CV directly on the full dataset | ||
| folds = k_fold_split( | ||
| dataset, | ||
| selected_annotation_paths, | ||
| urls, | ||
| cfg, | ||
| output_dir, | ||
| logger, | ||
| ) | ||
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.