Learn Found. GenAI - w3 - Error on "import necessary component"

******** this is the code that I submit (step 3):
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification, AutoModelForSeq2SeqLM, GenerationConfig
from datasets import load_dataset
from peft import PeftModel, PeftConfig, LoraConfig, TaskType

trl: Transformer Reinforcement Learning library

from trl import PPOTrainer, PPOConfig, AutoModelForSeq2SeqLMWithValueHead
from trl import create_reference_model
from trl.core import LengthSampler

import torch
import evaluate

import numpy as np
import pandas as pd

tqdm library makes the loops show a smart progress meter.

from tqdm import tqdm
tqdm.pandas()

******* these are the output:

ModuleNotFoundError Traceback (most recent call last)
Cell In[3], line 3
1 from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification, AutoModelForSeq2SeqLM, GenerationConfig
2 from datasets import load_dataset
----> 3 from peft import PeftModel, PeftConfig, LoraConfig, TaskType
5 # trl: Transformer Reinforcement Learning library
6 from trl import PPOTrainer, PPOConfig, AutoModelForSeq2SeqLMWithValueHead

ModuleNotFoundError: No module named ‘peft’

***** I have many error in all the subsequent steps

Hello there, there seems to be an incompatibility problem with versions on these Labs. Hi @chris.favila, I am also getting this error:

Hi Maurizio and Gent! Thank you for reporting! I can also reproduce the issue. Will escalate to our partners so they can fix it asap. Will update this thread as soon as I get updates.

1 Like

Still having an issue with lab3. Any fixes yet?

Hi everyone. I’ve escalated this issue to our partners. In the meantime, please manually edit the pip install block and use 4.38.2 for the transformers package instead of 4.27.2. That worked for the labs I tested. Remember to restart the kernel before importing. Still waiting for updates. Thank you, and sorry for the inconvenience.

1 Like

Hi everyone! I’m closing this thread so we can have one topic regarding this installation issue. It would be easier for everyone to manage feedback and monitor updates as we work on this. Please refer to the topic here. Thank you!

1 Like