W2 Lab doesnt work - Cannot import dependencies cell 2

Hi team, I got an issue while executing cell 2, and then I got stuck to continue with other cells

The code in cell 2:
First upgrade pip

%pip install --upgrade pip

Install torch and torchdata

%pip install --no-deps torch==2.5.1 torchdata==0.6.0 --quiet

Then install other packages except TRL

%pip install -U
datasets==2.17.0
transformers==4.38.2
accelerate==0.28.0
evaluate==0.4.0
rouge_score==0.1.2
peft==0.3.0 --quiet

The error:
Downloading pip-26.1.1-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 76.7 MB/s 0:00:00
Requirement already satisfied: pip in /opt/conda/lib/python3.12/site-packages (26.0.1)
Collecting pip
Downloading pip-26.1.1-py3-none-any.whl.metadata (4.6 kB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 26.0.1
Uninstalling pip-26.0.1:
Successfully uninstalled pip-26.0.1
Note: you may need to restart the kernel to use updated packages.
Successfully installed pip-26.1.1
Note: you may need to restart the kernel to use updated packages.
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
autogluon-multimodal 1.5.0 requires nvidia-ml-py3<8.0,>=7.352.0, which is not installed.
autogluon-timeseries 1.5.0 requires chronos-forecasting<2.4,>=2.2.2, which is not installed.
autogluon-timeseries 1.5.0 requires einops<1,>=0.7, which is not installed.
autogluon-multimodal 1.5.0 requires accelerate<2.0,>=0.34.0, but you have accelerate 0.28.0 which is incompatible.
autogluon-multimodal 1.5.0 requires torch<2.10,>=2.6, but you have torch 2.5.1 which is incompatible.
autogluon-multimodal 1.5.0 requires transformers[sentencepiece]<4.58,>=4.51.0, but you have transformers 4.38.2 which is incompatible.
autogluon-timeseries 1.5.0 requires accelerate<2.0,>=0.34.0, but you have accelerate 0.28.0 which is incompatible.
autogluon-timeseries 1.5.0 requires peft<0.18,>=0.13.0, but you have peft 0.3.0 which is incompatible.
autogluon-timeseries 1.5.0 requires torch<2.10,>=2.6, but you have torch 2.5.1 which is incompatible.
autogluon-timeseries 1.5.0 requires transformers[sentencepiece]<4.58,>=4.51.0, but you have transformers 4.38.2 which is incompatible.
jupyter-scheduler 2.12.0 requires fsspec>=2025.3.2, but you have fsspec 2023.10.0 which is incompatible.
s3fs 2026.3.0 requires fsspec==2026.3.0, but you have fsspec 2023.10.0 which is incompatible.
strands-agents-tools 0.1.9 requires dill<0.5.0,>=0.4.0, but you have dill 0.3.8 which is incompatible.
Note: you may need to restart the kernel to use updated packages.

Could you please help

Based on what you’ve shared, at this point you should go ahead and restart the kernel and run the notebook further down. The warnings you are seeing can happen and are generally fine. Let us know if you cannot continue further down with the Lab.

Hi Gent,

I restarted the kernel, and reexecuted the script again, the issue seem gone.

However, I cannot continue with the next steps. In step 4, the error returned:

The script:
huggingface_dataset_name = “knkarthick/dialogsum”

dataset = load_dataset(huggingface_dataset_name)

dataset

The error:

Error displaying widget: model not found

Downloading data: 100%

11.3M/11.3M [00:00<00:00, 94.4MB/s]

Error displaying widget: model not found

Error displaying widget: model not found

Error displaying widget: model not found

/opt/conda/lib/python3.12/site-packages/datasets/download/streaming_download_manager.py:784: FutureWarning: The 'verbose' keyword in pd.read_csv is deprecated and will be removed in a future version.
  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)

Error displaying widget: model not found

/opt/conda/lib/python3.12/site-packages/datasets/download/streaming_download_manager.py:784: FutureWarning: The 'verbose' keyword in pd.read_csv is deprecated and will be removed in a future version.
  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)

Error displaying widget: model not found

/opt/conda/lib/python3.12/site-packages/datasets/download/streaming_download_manager.py:784: FutureWarning: The 'verbose' keyword in pd.read_csv is deprecated and will be removed in a future version.
  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)

Thank you very much for your support!

There seems to be no issue with cell number 4—the model can be found and runs correctly. I have tested it myself, and it works as expected.

Please make sure to run all the cells from the top of the notebook. After performing the pip installations once, there is no need to repeat them if you have already reset the kernel. However, you do need to rerun all the cells, especially the ones that import the required libraries.

Following this sequence should resolve the issue. If you still encounter any problems, let me know.

Hi Gent,

I tried your suggestion, but it didn’t work.
After restarting the kernel, the scripts were executed from the beginning, and this is what I got from script 3 and 4:

from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, GenerationConfig, TrainingArguments, Trainer
import torch
import time
import evaluate
import pandas as pd
import numpy as np

2026-05-06 05:28:12.379328: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. 

To enable the following instructions: AVX512F, in other operations, rebuild TensorFlow with the appropriate compiler flags.

huggingface_dataset_name = “knkarthick/dialogsum”

dataset = load_dataset(huggingface_dataset_name)

dataset

Error displaying widget: model not found

Error displaying widget: model not found

Error displaying widget: model not found

Error displaying widget: model not found

Error displaying widget: model not found

/opt/conda/lib/python3.12/site-packages/datasets/download/streaming_download_manager.py:784: FutureWarning: The 'verbose' keyword in pd.read_csv is deprecated and will be removed in a future version.
  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)

Error displaying widget: model not found

/opt/conda/lib/python3.12/site-packages/datasets/download/streaming_download_manager.py:784: FutureWarning: The 'verbose' keyword in pd.read_csv is deprecated and will be removed in a future version.
  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)

Error displaying widget: model not found

/opt/conda/lib/python3.12/site-packages/datasets/download/streaming_download_manager.py:784: FutureWarning: The 'verbose' keyword in pd.read_csv is deprecated and will be removed in a future version. 

return pd.read_csv(xopen(filepath_or_buffer, “rb”, download_config=download_config), **kwargs)

Thanks and regards

Strange, try now, delete the current file and then use terminal to reopen it with the comand provided in the vocareaum instructions! And then run lab cells again.

Hi Gent,

Every time access the lab 2 assignment, the command line is executed: aws s3 cp --recursive s3://dlai-generative-ai/labs-202502/w2-170864 ./
The file Lab_2_fine_tune… is new in my workspace right?

Thanks and regards

It should be reset, yes! But delete the current one!

What ‘the current one’ are you referring to?

The one you were working!

Hi Gent,

I tried, but it didn’t work. I also stuck with lab 3 in the similar issue. Could you please help.

Thanks and regards,

Hi, @chris.favila I think maybe you can offer some help here, because when I run the Lab it works for me but not for the learner, I am not sure what to advice anymore!

Hi. It seems what you’re running into are not critical errors. I think the markdown in the pip install tells you that you can ignore some package incompatibilities. Try running each cell without restarting the kernel (unless the markdown instructions tell you to). If a number appears next to the cell after you run it, then the warnings/errors might be superficial and you can still go through the lab. However, if the cell halts (i.e. no number appears next to it), please take a screenshot and post it here (including the error message). This is technically an ungraded lab so no need to worry about showing code here. Thank you.