kathrinse / be_great

A novel approach for synthesizing tabular data using pretrained large language models
MIT License
254 stars 43 forks source link

Problem in running the model #24

Closed Joel113-sys closed 1 year ago

Joel113-sys commented 1 year ago

Dear authors,

Hi! When I ran the notebook given in the readme file, there is an error reported on the line "model.fit(data)" that says:

ImportError Traceback (most recent call last) in <cell line: 7>() 5 6 model = GReaT(llm='distilgpt2', batch_size=32, epochs=50) ----> 7 model.fit(data) 8 synthetic_data = model.sample(n_samples=100)

5 frames /usr/local/lib/python3.10/dist-packages/transformers/training_args.py in _setup_devices(self) 1670 if not is_sagemaker_mp_enabled(): 1671 if not is_accelerate_available(min_version="0.20.1"): -> 1672 raise ImportError( 1673 "Using the Trainer with PyTorch requires accelerate>=0.20.1: Please run pip install transformers[torch] or pip install accelerate -U" 1674 )

ImportError: Using the Trainer with PyTorch requires accelerate>=0.20.1: Please run pip install transformers[torch] or pip install accelerate -U


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the "Open Examples" button below.

I tried installing the hinted packages, and it didn't help. I tried it locally, no good either. Could you please let me know what may have gone wrong with my settings or packages?

Thanks a lot!

Joel

unnir commented 1 year ago

Dear @Joel113-sys,

Please install the GReaT package like this:

!pip install be-great
!pip install --upgrade accelerate
!pip uninstall -y transformers accelerate
!pip install transformers accelerate

Hope it helps!

Shruti-codes commented 1 year ago

Hi @unnir On following above package installation steps, I get below error on sklearn dataset import line. image

I have tried upgrading the version of numpy and restarted the runtime, after which I could run the example notebook.

unnir commented 1 year ago

@Shruti-codes I believe you have package conflicts, I suggest creating an python or conda environments specifically for GReaT. Other possibility is to reinstall python on your machine.