Skip to content

Evaluate Gliner2 determinism#50

Open
Essmaw wants to merge 1 commit into
mainfrom
feat/evaluate-gliner-determinism
Open

Evaluate Gliner2 determinism#50
Essmaw wants to merge 1 commit into
mainfrom
feat/evaluate-gliner-determinism

Conversation

@Essmaw

@Essmaw Essmaw commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 4, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and training.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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants