kathrinse / be_great

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

np.float is deprecated #16

Closed sebffischer closed 1 year ago

sebffischer commented 1 year ago

First and foremost, thanks for making this code available!

However, when trying to sample from a trained GReaT model I get an an error (included at the end of this issue). I don't include any code because it is clear from the error message what went wrong.

I know I can get around it by installing a different numpy version but still it would be valuable to address this issue I think.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fischers/miniconda2/envs/inference/lib/python3.10/site-packages/be_great/great.py", line 168, in sample
    df_gen[self.num_cols] = df_gen[self.num_cols].astype(np.float)
  File "/home/fischers/miniconda2/envs/inference/lib/python3.10/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?
sebffischer commented 1 year ago

Added a PR here: https://github.com/kathrinse/be_great/pull/17

unnir commented 1 year ago

Thank you for your contribution!

I've merged the PR, and your code is already on pip :)