File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1257,9 +1257,13 @@ async function main() {
12571257 contrastiveResult . finalLoss = finalContrastiveLoss ;
12581258 contrastiveResult . improvement = contrastiveImprovement ;
12591259
1260- // Export contrastive training data
1261- const contrastiveOutDir = contrastiveTrainer . exportTrainingData ( ) ;
1262- console . log ( ` Training data exported to: ${ contrastiveOutDir } ` ) ;
1260+ // Export contrastive training data (skip for large datasets to avoid JSON string limit)
1261+ if ( contrastiveTrainer . getTripletCount ( ) < 100000 ) {
1262+ const contrastiveOutDir = contrastiveTrainer . exportTrainingData ( ) ;
1263+ console . log ( ` Training data exported to: ${ contrastiveOutDir } ` ) ;
1264+ } else {
1265+ console . log ( ` Skipping triplet export (${ contrastiveTrainer . getTripletCount ( ) } triplets too large for JSON)` ) ;
1266+ }
12631267
12641268 // -----------------------------------------------------------------------
12651269 // Phase 2: Task head training via TrainingPipeline
You can’t perform that action at this time.
0 commit comments