Closed TakshPanchal closed 4 months ago
[!WARNING]
Review failed
The pull request is closed.
The changes in workflow/training/classification.py
involve enhancements to the model initialization and dataset preparation logic by incorporating self.id2label
and modifying id2label
and label2id
handling. These adjustments ensure proper labeling configuration during training.
Files | Change Summary |
---|---|
workflow/training/classification.py |
Added self.id2label in __init__ . Updated _load_model to handle id2label and label2id parameters. Adjusted _prepare_dataset to create self.id2label based on self.label2id if it is None. |
sequenceDiagram
participant User
participant Classification
participant Dataset
participant Model
User->>Classification: Initialize Classification
Classification->>Classification: __init__ with self.id2label = None
User->>Classification: Call _prepare_dataset
Classification->>Dataset: Load Dataset
Classification->>Classification: Check if label2id is None
alt label2id is None
Classification->>Classification: Create self.id2label based on labels in Dataset
else
Classification->>Classification: Use provided label2id
end
User->>Classification: Call _load_model
Classification->>Model: Load model with id2label and label2id
Model->>Classification: Return Initialized Model
Classification->>User: Classification process ready
In code’s vast field, a change does bloom,
id2label
brings the dataset room,
label2id
now stands in line,
Enhancing models, in swift incline.
With datasets trained in perfect rhyme,
Classification’s joy in coding time.
🌟🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
id2label
andlabel2id
).