Updated Pt Train Fine Tune Classification Transformer Model node and added a workflow and documentation.

This commit is contained in:
HowToSD
2025-03-31 18:16:25 -07:00
parent ea393b1793
commit 59ed74ba76
5 changed files with 17 additions and 3 deletions
@@ -54,4 +54,18 @@ Specify **Pt Train Transformer Classification Model** and configure training par
## Expected Accuracy
Using this workflow, you should achieve around 92-93% validation accuracy on the Hugging Face version of the IMDB dataset with the pretrained DistilBERT model.
Using this workflow, you should achieve around 92-93% validation accuracy on the Hugging Face version of the IMDB dataset with the pretrained DistilBERT model.
# Fine-tuning by freezing the pretrained module layers
ComfyUI-Pt-Wrapper also offers a node for fine-tuning by freezing the pretrained module layers.
See `examples/workflows/distilbert_classification_2.json`.
![Workflow](images/distilbert_classification_2.png)
Add **Pt Train Fine Tune Classification Transformer Model** node and specify the number of epochs to freeze in `freeze pretrained module epochs`.
Also specify the total number of epochs in `epochs`.
For example, if you set `freeze_pretrained_module_epochs` to 1 and `epochs` to 4, then the weights for the pretrained module are frozen during the first epoch, and full fine-tuning takes place from epochs 2 to 4.
Using this example workflow, you can expect a validation accuracy of 92% or 93%.
Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

File diff suppressed because one or more lines are too long
@@ -51,7 +51,6 @@ class PtTrainFineTuneClassificationTransformerModel:
"classification_metrics": ("BOOLEAN", {"default":True})
},
"optional": {
"scheduler": ("PTLRSCHEDULER", {}),
"val_loader": ("PTDATALOADER", {})
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "pt-wrapper"
description = "PyTorch extension for ComfyUI featuring extensive PyTorch wrapper nodes for seamless tensor operations and PyTorch model training."
version = "3.5.0"
version = "3.5.1"
license = {file = "LICENSE"}
[project.urls]