haaksmash/pyutils

I keep getting an error that says "ModuleNotFoundError: No module named 'utils.dataset_utils'"

Closed this issue · 2 comments

I was trying to use utlis, following the example from llama-recipes/examples/quickstart.ipynb file. However, I keep getting a utils error when I run this Python code:

from pathlib import Path
import os
import sys
from utils.dataset_utils import get_preprocessed_dataset
from configs.datasets import samsum_dataset

train_dataset = get_preprocessed_dataset(tokenizer, samsum_dataset, 'train')

First it was saying there is No modle named 'utlis' so I did pip install utils. Now it says the below error:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 4
      2 import os
      3 import sys
----> 4 from utils.dataset_utils import get_preprocessed_dataset
      5 from configs.datasets import samsum_dataset
      7 train_dataset = get_preprocessed_dataset(tokenizer, samsum_dataset, 'train')

ModuleNotFoundError: No module named 'utils.dataset_utils'

When I do:

!pip show utils

This is the output about my utlis version:

Name: utils
Version: 1.0.1
Summary: A grab-bag of utility functions and objects
Home-page: http://github.com/haaksmash/pyutils
Author: Haak Saxberg
Author-email: haak.erling@gmail.com
License: UNKNOWN
Location: /root/Desktop/llama2_70B/llama/env_Py310/lib/python3.10/site-packages
Requires: 
Required-by: 

@BrookMakF, great detective work getting all the way here from that initial hurdle! I'm pretty sure that the utils that llama-recipes is referring to is not this package (haaksmash/pyutils) but rather this one, a part of the llama-recipes repository: https://github.com/facebookresearch/llama-recipes/tree/main/src/llama_recipes/utils

It seems like there might have been a missing step when activating or linking your python environment? I've never interacted with llama-research, so unfortunately I can't be much further help with trouble-shooting, and this repository probably can't help unblock you 😞

@haaksmash thank you for responding, I found out this yesterday and already solved it, as I mentioned it on another Issues thread elsewhere. But your comment would have actually helped me to find the problem have I not already solved it.