Ver código fonte

修复dpo报错

lxylxy123321 15 horas atrás
pai
commit
e3123dad68
2 arquivos alterados com 134 adições e 85 exclusões
  1. 7 33
      backend/app/engines/text_engine.py
  2. 127 52
      result.txt

+ 7 - 33
backend/app/engines/text_engine.py

@@ -333,8 +333,11 @@ class TextEngine(BaseEngine):
                 logging_steps=10,
                 fp16=True,
                 report_to="none",
+                remove_unused_columns=False,
                 dataloader_num_workers=4,
                 dataloader_pin_memory=False,
+                max_length=max_seq_length,
+                max_prompt_length=max_seq_length // 2,
             )
 
             trainer = DPOTrainer(
@@ -604,10 +607,10 @@ class TextEngine(BaseEngine):
         return tokenized_dataset
 
     def _load_dataset_dpo(self, dataset_path: str):
-        """加载并 tokenize DPO 数据集,生成 TRL 0.9.x 需要的 prompt/chosen/rejected_input_ids。"""
+        """加载 DPO 数据集,保留 prompt/chosen/rejected 原始文本,由 DPOTrainer 内部 tokenize。"""
         from datasets import Dataset as HFDataset
 
-        raw_data = []
+        data = []
         with open(dataset_path, "r", encoding="utf-8") as f:
             for line in f:
                 line = line.strip()
@@ -617,41 +620,12 @@ class TextEngine(BaseEngine):
                     chosen = item.get("chosen", item.get("positive", ""))
                     rejected = item.get("rejected", item.get("negative", ""))
                     if prompt and chosen and rejected:
-                        raw_data.append({
+                        data.append({
                             "prompt": str(prompt),
                             "chosen": str(chosen),
                             "rejected": str(rejected),
                         })
-
-        max_len = 2048
-
-        def tokenize_fn(examples):
-            prompts = examples.get("prompt", [])
-            chosens = examples.get("chosen", [])
-            rejecteds = examples.get("rejected", [])
-
-            prompt_tok = self._tokenizer(prompts, truncation=True, max_length=max_len, padding=False)
-            chosen_tok = self._tokenizer(
-                [p + c for p, c in zip(prompts, chosens)],
-                truncation=True, max_length=max_len, padding=False,
-            )
-            rejected_tok = self._tokenizer(
-                [p + r for p, r in zip(prompts, rejecteds)],
-                truncation=True, max_length=max_len, padding=False,
-            )
-
-            return {
-                "prompt_input_ids": prompt_tok["input_ids"],
-                "prompt_attention_mask": prompt_tok["attention_mask"],
-                "chosen_input_ids": chosen_tok["input_ids"],
-                "chosen_attention_mask": chosen_tok["attention_mask"],
-                "rejected_input_ids": rejected_tok["input_ids"],
-                "rejected_attention_mask": rejected_tok["attention_mask"],
-            }
-
-        hf_dataset = HFDataset.from_list(raw_data)
-        tokenized = hf_dataset.map(tokenize_fn, batched=True)
-        return tokenized
+        return HFDataset.from_list(data)
 
 
 try:

+ 127 - 52
result.txt

@@ -1,52 +1,127 @@
-(base) [root@localhost ~]# docker exec finetune-trainer bash -c 'sed -n "1400,1450p" /opt/conda/lib/python3.10/site-packages/trl/trainer/dpo_trainer.py'
-            warnings.warn(
-                "compute_loss is only implemented for DPODataCollatorWithPadding, and you passed a datacollator that is different than "
-                "DPODataCollatorWithPadding - you might see unexpected behavior. Alternatively, you can implement your own prediction_step method if you are using a custom data collator"
-            )
-
-        compute_loss_context_manager = torch.cuda.amp.autocast if self._peft_has_been_casted_to_bf16 else nullcontext
-
-        with compute_loss_context_manager():
-            loss, metrics = self.get_batch_loss_metrics(model, inputs, train_eval="train")
-
-        # Make sure to move the loss to the device the original accumulating loss is at back in the `Trainer` class:
-        loss = loss.to(self.args.device)
-        # force log the metrics
-        self.store_metrics(metrics, train_eval="train")
-
-        if return_outputs:
-            return (loss, metrics)
-        return loss
-
-    def get_batch_samples(self, model, batch: Dict[str, torch.LongTensor]) -> Tuple[str, str]:
-        """Generate samples from the model and reference model for the given batch of inputs."""
-
-        # If one uses `generate_during_eval` with peft + bf16, we need to explicitly call generate with
-        # the torch cuda amp context manager as some hidden states are silently casted to full precision.
-        generate_context_manager = nullcontext if not self._peft_has_been_casted_to_bf16 else torch.cuda.amp.autocast
-
-        with generate_context_manager():
-            policy_output = model.generate(
-                input_ids=batch["prompt_input_ids"],
-                attention_mask=batch["prompt_attention_mask"],
-                max_length=self.max_length,
-                do_sample=True,
-                pad_token_id=self.tokenizer.pad_token_id,
-            )
-
-            # if reference_output in batch use that otherwise use the reference model
-            if "reference_output" in batch:
-                reference_output = batch["reference_output"]
-            else:
-                if self.ref_model is None:
-                    with self.null_ref_context():
-                        reference_output = self.model.generate(
-                            input_ids=batch["prompt_input_ids"],
-                            attention_mask=batch["prompt_attention_mask"],
-                            max_length=self.max_length,
-                            do_sample=True,
-                            pad_token_id=self.tokenizer.pad_token_id,
-                        )
-                else:
-                    reference_output = self.ref_model.generate(
-                        input_ids=batch["prompt_input_ids"],
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Map:   0%|          | 0/5 [00:00<?, ? examples/s]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Map: 100%|██████████| 5/5 [00:00<00:00, 174.12 examples/s]
+2026-05-27 07:35:25 | WARNING  | peft-platform | [253:489b64b9] /opt/conda/lib/python3.10/site-packages/peft/tuners/tuners_utils.py:1348: UserWarning: Model has `tie_word_embeddings=True` and a tied layer is part of the adapter, but `ensure_weight_tying` is not set to True. This can lead to complications, for example when merging the adapter or converting your model to formats other than safetensors. Check the discussion here: https://github.com/huggingface/peft/issues/2777
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] warnings.warn(msg)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] bitsandbytes library load error: Configured CUDA binary not found at /opt/conda/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda116.so
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/bitsandbytes/cextension.py", line 320, in <module>
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] lib = get_native_library()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/bitsandbytes/cextension.py", line 288, in get_native_library
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] raise RuntimeError(f"Configured {BNB_BACKEND} binary not found at {cuda_binary_path}")
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] RuntimeError: Configured CUDA binary not found at /opt/conda/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda116.so
+2026-05-27 07:35:25 | WARNING  | peft-platform | [253:489b64b9] [transformers] warmup_ratio is deprecated and will be removed in v5.2. Use `warmup_steps` instead.
+2026-05-27 07:35:25 | WARNING  | peft-platform | [253:489b64b9] [transformers] warmup_ratio is deprecated and will be removed in v5.2. Use `warmup_steps` instead.
+2026-05-27 07:35:25 | WARNING  | peft-platform | [253:489b64b9] /opt/conda/lib/python3.10/site-packages/trl/trainer/dpo_trainer.py:394: UserWarning: `max_length` is not set in the DPOConfig's init it will default to `512` by default, but you should do it yourself in the future.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] warnings.warn(
+2026-05-27 07:35:25 | WARNING  | peft-platform | [253:489b64b9] /opt/conda/lib/python3.10/site-packages/trl/trainer/dpo_trainer.py:407: UserWarning: `max_prompt_length` is not set in the DPOConfig's init it will default to `128` by default, but you should do it yourself in the future.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] warnings.warn(
+2026-05-27 07:35:25 | WARNING  | peft-platform | [253:489b64b9] /opt/conda/lib/python3.10/site-packages/trl/trainer/dpo_trainer.py:442: UserWarning: When using DPODataCollatorWithPadding, you should set `remove_unused_columns=False` in your TrainingArguments we have set it for you, but you should do it yourself in the future.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] warnings.warn(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] trainable params: 5,070,848 || all params: 757,463,872 || trainable%: 0.6695
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Map:   0%|          | 0/5 [00:00<?, ? examples/s]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Map: 100%|██████████| 5/5 [00:00<00:00, 173.18 examples/s]
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] 0%|          | 0/1 [00:00<?, ?it/s]Training failed for job 489b64b9-f349-4263-82e1-b6a73eaeff80: Caught TypeError in DataLoader worker process 0.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Original Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 349, in _worker_loop
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data = fetcher.fetch(index)  # type: ignore[possibly-undefined]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 55, in fetch
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return self.collate_fn(data)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in __call__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in <listcomp>
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] TypeError: 'NoneType' object cannot be interpreted as an integer
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] [remote_train] [rank 0] ERROR: Caught TypeError in DataLoader worker process 0.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Original Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 349, in _worker_loop
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data = fetcher.fetch(index)  # type: ignore[possibly-undefined]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 55, in fetch
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return self.collate_fn(data)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in __call__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in <listcomp>
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] TypeError: 'NoneType' object cannot be interpreted as an integer
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] [remote_train] Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/remote_train.py", line 236, in run_training
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] adapter_path = await engine.train(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/text_engine.py", line 469, in train
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] trainer.train()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/transformers/trainer.py", line 1427, in train
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return inner_training_loop(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/transformers/trainer.py", line 1509, in _inner_training_loop
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] self._run_epoch(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/transformers/trainer.py", line 1704, in _run_epoch
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] batch_samples, num_items_in_batch = self.get_batch_samples(epoch_iterator, num_batches, self.args.device)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/text_engine.py", line 296, in _patched_gbs
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] batch = next(epoch_iterator)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/accelerate/data_loader.py", line 577, in __iter__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] current_batch = next(dataloader_iter)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 734, in __next__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data = self._next_data()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1516, in _next_data
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return self._process_data(data, worker_id)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1551, in _process_data
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data.reraise()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/_utils.py", line 769, in reraise
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] raise exception
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] TypeError: Caught TypeError in DataLoader worker process 0.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Original Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 349, in _worker_loop
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data = fetcher.fetch(index)  # type: ignore[possibly-undefined]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 55, in fetch
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return self.collate_fn(data)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in __call__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in <listcomp>
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] TypeError: 'NoneType' object cannot be interpreted as an integer
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] [remote_train] === Training job failed: 489b64b9-f349-4263-82e1-b6a73eaeff80 ===
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/runpy.py", line 196, in _run_module_as_main
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return _run_code(code, main_globals, None,
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/runpy.py", line 86, in _run_code
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] exec(code, run_globals)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/remote_train.py", line 466, in <module>
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] main()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/remote_train.py", line 461, in main
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] asyncio.run(run_training(job_id, model_id, model_type, dataset_id, config,
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/asyncio/runners.py", line 44, in run
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return loop.run_until_complete(main)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return future.result()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/remote_train.py", line 236, in run_training
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] adapter_path = await engine.train(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/text_engine.py", line 469, in train
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] trainer.train()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/transformers/trainer.py", line 1427, in train
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return inner_training_loop(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/transformers/trainer.py", line 1509, in _inner_training_loop
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] self._run_epoch(
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/transformers/trainer.py", line 1704, in _run_epoch
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] batch_samples, num_items_in_batch = self.get_batch_samples(epoch_iterator, num_batches, self.args.device)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/root/Fine-tuning/backend/app/engines/text_engine.py", line 296, in _patched_gbs
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] batch = next(epoch_iterator)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/accelerate/data_loader.py", line 577, in __iter__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] current_batch = next(dataloader_iter)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 734, in __next__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data = self._next_data()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1516, in _next_data
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return self._process_data(data, worker_id)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1551, in _process_data
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data.reraise()
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/_utils.py", line 769, in reraise
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] raise exception
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] TypeError: Caught TypeError in DataLoader worker process 0.
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] Original Traceback (most recent call last):
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 349, in _worker_loop
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] data = fetcher.fetch(index)  # type: ignore[possibly-undefined]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 55, in fetch
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] return self.collate_fn(data)
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in __call__
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] File "/opt/conda/lib/python3.10/site-packages/trl/trainer/utils.py", line 460, in <listcomp>
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] to_pad = [torch.tensor(ex[k], dtype=dtype) for ex in features]
+2026-05-27 07:35:25 | ERROR    | peft-platform | [253:489b64b9] TypeError: 'NoneType' object cannot be interpreted as an integer
+2026-05-27 07:35:25 | INFO     | peft-platform | [253:489b64b9] 0%|          | 0/1 [00:14<?, ?it/s]
+INFO:     127.0.0.1:56702 - "GET /health HTTP/1.1" 200 OK