I’m trying to do the first import step after the “pip install” step.
I get something like the below and the rest of steps give an error implying things are not defined.
Much TIA.
=====================
2025-04-17 03:51:00.316992: I tensorflow[/core/platform/cpu_feature_guard.cc:210](removed link)] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[3], line 6 3 from peft import PeftModel, PeftConfig, LoraConfig, TaskType 5 # trl: Transformer Reinforcement Learning library ----> 6 from trl import PPOTrainer, PPOConfig, AutoModelForSeq2SeqLMWithValueHead 7 from trl import create_reference_model 8 from trl.core import LengthSampler File [/opt/conda/lib/python3.12/site-packages/trl/init.py:5](link removed) 1 # flake8: noqa 3 version = “0.4.2.dev0” ----> 5 from .core import set_seed 6 from .import_utils import is_peft_available 7 from .models import ( 8 AutoModelForCausalLMWithValueHead, 9 AutoModelForSeq2SeqLMWithValueHead, 10 PreTrainedModelWrapper, 11 create_reference_model, 12 ) File [/opt/conda/lib/python3.12/site-packages/trl/core.py:23](link removed) 21 import torch.nn.functional as F 22 from torch.nn.utils.rnn import pad_sequence —> 23 from transformers import top_k_top_p_filtering 26 try: 27 from collections.abc import Mapping ImportError: cannot import name ‘top_k_top_p_filtering’ from ‘transformers’ ([/opt/conda/lib/python3.12/site-packages/transformers/init.py]