Generative AI with LLMs

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to:
  • Description (include relevant info but please do not post solution code or your entire notebook):
    Generative AI with Large language models: week-1
    when i try to run the below specified cell:
    “from datasets import load_dataset
    from transformers import AutoModelForSeq2SeqLM
    from transformers import AutoTokenizer
    from transformers import GenerationConfig”,
    I get an error, saying “ModuleNotFoundError: No module named ‘torch._C’”
    It seems to be an issue with the Previous code snippet that has pip installations, but i am unable to find a way out and yes, i did try restarting the kernel and still it doesn’t work but i did download the notebook and ran it in colab and it does work there.
    the pip installations code:
    "# First upgrade pip
    %pip install --upgrade pip

Install tensorflow and keras first

%pip install tensorflow==2.18.0 keras==3.9.0

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
evaluate==0.4.0
rouge_score==0.1.2
peft==0.3.0 --quiet"
Please help me solve this error.

Dear @saiBeeraka,

Please try restoring the lab files first, and then restart the kernel to ensure all dependencies are properly loaded.

Let me know if the problem still persists.

Appreciate the help and support.
Thank you for reaching out.