Skip to content

Commit b8f23ef

Browse files
Replace deprecated AutoModelForVision2Seq with AutoModelForImageTextToText (#4353)
1 parent f8073cb commit b8f23ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_online_dpo_trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
if is_vision_available():
3939
import numpy as np
4040
from PIL import Image
41-
from transformers import AutoModelForVision2Seq, AutoProcessor
41+
from transformers import AutoModelForImageTextToText, AutoProcessor
4242

4343

4444
class TestOnlineDPOTrainer(TrlTestCase):
@@ -510,7 +510,7 @@ def test_online_dpo_vlm_trainer(self, model_id):
510510
dataset = Dataset.from_dict(dataset_dict)
511511
dataset = dataset.cast_column("images", features.Sequence(features.Image()))
512512

513-
model = AutoModelForVision2Seq.from_pretrained(model_id)
513+
model = AutoModelForImageTextToText.from_pretrained(model_id)
514514
reward_model = AutoModelForSequenceClassification.from_pretrained(
515515
"trl-internal-testing/tiny-LlamaForCausalLM-3.2", num_labels=1
516516
)

0 commit comments

Comments
 (0)