a-s-g93 / neo4j-runway

End to end solution for migrating CSV data into a Neo4j graph using an LLM for the data discovery and graph data modeling stages.
https://a-s-g93.github.io/neo4j-runway/
Apache License 2.0
103 stars 15 forks source link

TypeError: issubclass() arg 1 must be a class in create_initial_model() #104

Closed RubensZimbres closed 3 months ago

RubensZimbres commented 3 months ago

I'm on Ubuntu 22.04, Anaconda environment, with the following versions:

neo4j                                    5.23.0
neo4j-runway                             0.8.1
graphviz                                 0.20.3
pandas                                   2.2.2

I already run an experiment using LLM to parse CSVs: here

However, when trying again with the same code and installs, I get this error on:

gdm = GraphDataModeler(llm=llm, discovery=disc)
gdm.create_initial_model()

Follows:

Screenshot from 2024-08-02 15-52-14

Can you please shed some light on the issue?

Thanks in advance

a-s-g93 commented 3 months ago

Hi @RubensZimbres sorry you're having this issue. Can you provide all dependency versions you have running? Thanks!

RubensZimbres commented 3 months ago

I guess the problem is in Python version. Using 3.10 it was working, now with 3.11.4 it's not.

Here's my pip list:

Package                                  Version
---------------------------------------- ----------------------
absl-py                                  1.4.0
accelerate                               0.33.0
ai-edge-model-explorer                   0.1.7
ai-edge-model-explorer-adapter           0.1.3
ai-edge-quantizer-nightly                0.0.1.dev202407012233
ai-edge-torch-nightly                    0.2.0.dev20240717
aiobotocore                              2.5.0
aiofiles                                 22.1.0
aiohappyeyeballs                         2.3.4
aiohttp                                  3.10.0
aioitertools                             0.7.1
aiosignal                                1.2.0
aiosqlite                                0.18.0
alabaster                                0.7.12
altair                                   5.3.0
anaconda-catalogs                        0.2.0
anaconda-client                          1.12.0
anaconda-navigator                       2.4.2
anaconda-project                         0.11.1
annotated-types                          0.7.0
antlr4-python3-runtime                   4.9.3
anyio                                    3.5.0
appdirs                                  1.4.4
argon2-cffi                              21.3.0
argon2-cffi-bindings                     21.2.0
array_record                             0.5.1
arrow                                    1.2.3
asgiref                                  3.8.1
astroid                                  2.14.2
astropy                                  5.1
asttokens                                2.0.5
astunparse                               1.6.3
async-timeout                            4.0.2
atomicwrites                             1.4.0
attrs                                    22.1.0
Automat                                  20.2.0
autopep8                                 1.6.0
Babel                                    2.11.0
backcall                                 0.2.0
backoff                                  2.2.1
backports.functools-lru-cache            1.6.4
backports.tempfile                       1.0
backports.weakref                        1.0.post1
bcrypt                                   4.2.0
beautifulsoup4                           4.12.2
binaryornot                              0.4.4
black                                    0.0
bleach                                   4.1.0
blinker                                  1.8.2
bokeh                                    3.2.1
boltons                                  23.0.0
botocore                                 1.29.76
Bottleneck                               1.3.5
brotlipy                                 0.7.0
build                                    1.2.1
cachetools                               4.2.4
certifi                                  2024.7.4
cffi                                     1.15.1
chardet                                  4.0.0
charset-normalizer                       3.3.2
chex                                     0.1.86
chroma-hnswlib                           0.7.6
chromadb                                 0.5.5
click                                    8.0.4
cloud-tpu-client                         0.10
cloudpickle                              2.2.1
clyent                                   1.2.2
colorama                                 0.4.6
colorcet                                 3.0.1
coloredlogs                              15.0.1
comm                                     0.1.2
conda                                    23.7.2
conda-build                              3.26.0
conda-content-trust                      0+unknown
conda_index                              0.2.3
conda-libmamba-solver                    23.5.0
conda-pack                               0.6.0
conda-package-handling                   2.2.0
conda_package_streaming                  0.9.0
conda-repo-cli                           1.0.41
conda-token                              0.4.0
conda-verify                             3.4.2
constantly                               15.1.0
contourpy                                1.0.5
cookiecutter                             1.7.3
cryptography                             41.0.2
cssselect                                1.1.0
ctransformers                            0.2.27
cycler                                   0.11.0
Cython                                   3.0.10
cytoolz                                  0.12.0
daal4py                                  2023.1.1
dask                                     2023.6.0
dataclasses-json                         0.6.7
datasets                                 2.12.0
datashader                               0.15.1
datashape                                0.5.4
debugpy                                  1.6.7
decorator                                5.1.1
deepdiff                                 7.0.1
defusedxml                               0.7.1
Deprecated                               1.2.14
diff-match-patch                         20200713
dill                                     0.3.6
distributed                              2023.6.0
distro                                   1.9.0
dm-tree                                  0.1.8
docstring_parser                         0.16
docstring-to-markdown                    0.11
docutils                                 0.18.1
effdet                                   0.4.1
emoji                                    2.12.1
entrypoints                              0.4
et-xmlfile                               1.1.0
etils                                    1.9.2
evaluate                                 0.4.2
executing                                0.8.3
fastapi                                  0.112.0
fastjsonschema                           2.16.2
filelock                                 3.9.0
filetype                                 1.2.0
flake8                                   6.0.0
Flask                                    2.2.2
flatbuffers                              24.3.25
flax                                     0.8.5
fonttools                                4.25.0
frozenlist                               1.3.3
fsspec                                   2024.6.1
future                                   0.18.3
gast                                     0.4.0
gensim                                   4.3.0
gin-config                               0.5.0
gitdb                                    4.0.11
GitPython                                3.1.43
glob2                                    0.7
gmpy2                                    2.1.2
google-api-core                          2.19.1
google-api-python-client                 1.8.0
google-auth                              2.32.0
google-auth-httplib2                     0.2.0
google-auth-oauthlib                     0.5.3
google-cloud-aiplatform                  1.60.0
google-cloud-bigquery                    3.25.0
google-cloud-core                        2.4.1
google-cloud-resource-manager            1.12.5
google-cloud-secret-manager              2.20.2
google-cloud-storage                     2.18.0
google-cloud-vision                      3.7.4
google-crc32c                            1.5.0
google-pasta                             0.2.0
google-resumable-media                   2.7.1
googleapis-common-protos                 1.63.2
graphviz                                 0.20.3
greenlet                                 2.0.1
grpc-google-iam-v1                       0.13.1
grpcio                                   1.64.1
grpcio-status                            1.62.2
h11                                      0.14.0
h5py                                     3.11.0
HeapDict                                 1.0.1
holoviews                                1.17.0
httpcore                                 1.0.5
httplib2                                 0.22.0
httptools                                0.6.1
httpx                                    0.27.0
huggingface-hub                          0.24.5
humanfriendly                            10.0
hvplot                                   0.8.4
hyperlink                                21.0.0
idna                                     3.4
imagecodecs                              2021.8.26
imageio                                  2.31.1
imagesize                                1.4.1
imbalanced-learn                         0.10.1
immutabledict                            4.2.0
importlib-metadata                       6.0.0
importlib_resources                      6.4.0
incremental                              21.3.0
inflection                               0.5.1
iniconfig                                1.1.1
instructor                               1.3.7
intake                                   0.6.8
intervaltree                             3.1.0
iopath                                   0.1.10
ipykernel                                6.19.2
ipython                                  8.26.0
ipython-genutils                         0.2.0
ipywidgets                               8.0.4
isort                                    5.9.3
itemadapter                              0.3.0
itemloaders                              1.0.4
itsdangerous                             2.0.1
jaraco.classes                           3.2.1
jax                                      0.4.30
jaxlib                                   0.4.30
jedi                                     0.18.1
jeepney                                  0.7.1
jellyfish                                0.9.0
Jinja2                                   3.1.2
jinja2-time                              0.2.0
jiter                                    0.4.2
jmespath                                 0.10.0
joblib                                   1.2.0
json5                                    0.9.6
jsonpatch                                1.33
jsonpath-python                          1.0.6
jsonpointer                              2.1
jsonschema                               4.17.3
jupyter                                  1.0.0
jupyter_client                           7.4.9
jupyter-console                          6.6.3
jupyter_core                             5.3.0
jupyter-events                           0.6.3
jupyter-server                           1.23.4
jupyter_server_fileid                    0.9.0
jupyter_server_ydoc                      0.8.0
jupyter-ydoc                             0.2.4
jupyterlab                               3.6.3
jupyterlab-pygments                      0.1.2
jupyterlab_server                        2.22.0
jupyterlab-widgets                       3.0.5
kaggle                                   1.6.14
keras                                    2.15.0
keras-nightly                            3.4.1.dev2024071203
keyring                                  23.13.1
kiwisolver                               1.4.4
kubernetes                               30.1.0
langchain                                0.2.11
langchain-chroma                         0.1.2
langchain-community                      0.2.10
langchain-core                           0.2.27
langchain-google-vertexai                1.0.8
langchain-openai                         0.1.20
langchain-text-splitters                 0.2.2
langdetect                               1.0.9
langsmith                                0.1.94
layoutparser                             0.3.4
lazy_loader                              0.2
lazy-object-proxy                        1.6.0
libarchive-c                             2.9
libclang                                 18.1.1
libmambapy                               1.4.1
linkify-it-py                            2.0.0
llvmlite                                 0.40.0
lmdb                                     1.4.1
locket                                   1.0.0
lxml                                     4.9.1
lz4                                      4.3.2
Markdown                                 3.4.1
markdown-it-py                           2.2.0
MarkupSafe                               2.1.1
marshmallow                              3.21.3
matplotlib                               3.7.1
matplotlib-inline                        0.1.6
mccabe                                   0.7.0
mdit-py-plugins                          0.3.0
mdurl                                    0.1.0
mediapipe                                0.10.14
mediapipe-model-maker                    0.2.1.4
mistune                                  0.8.4
mkl-fft                                  1.3.6
mkl-random                               1.2.2
mkl-service                              2.4.0
ml-dtypes                                0.2.0
mmh3                                     4.1.0
monotonic                                1.6
more-itertools                           8.12.0
mpmath                                   1.3.0
msgpack                                  1.0.3
multidict                                6.0.2
multipledispatch                         0.6.0
multiprocess                             0.70.14
munkres                                  1.1.4
mypy-extensions                          1.0.0
namex                                    0.0.8
navigator-updater                        0.4.0
nbclassic                                0.5.5
nbclient                                 0.5.13
nbconvert                                6.5.4
nbformat                                 5.7.0
neo4j                                    5.23.0
neo4j-runway                             0.8.1
nest-asyncio                             1.6.0
networkx                                 3.1
nltk                                     3.8.1
notebook                                 6.5.4
notebook_shim                            0.2.2
numba                                    0.57.0
numexpr                                  2.8.4
numpy                                    1.26.4
numpydoc                                 1.5.0
nvidia-cublas-cu11                       11.11.3.6
nvidia-cublas-cu12                       12.3.4.1
nvidia-cuda-cupti-cu11                   11.8.87
nvidia-cuda-cupti-cu12                   12.3.101
nvidia-cuda-nvcc-cu12                    12.3.107
nvidia-cuda-nvrtc-cu11                   11.8.89
nvidia-cuda-nvrtc-cu12                   12.3.107
nvidia-cuda-runtime-cu11                 11.8.89
nvidia-cuda-runtime-cu12                 12.3.101
nvidia-cudnn-cu11                        8.7.0.84
nvidia-cudnn-cu12                        8.9.7.29
nvidia-cufft-cu11                        10.9.0.58
nvidia-cufft-cu12                        11.0.12.1
nvidia-curand-cu11                       10.3.0.86
nvidia-curand-cu12                       10.3.4.107
nvidia-cusolver-cu11                     11.4.1.48
nvidia-cusolver-cu12                     11.5.4.101
nvidia-cusparse-cu11                     11.7.5.86
nvidia-cusparse-cu12                     12.2.0.103
nvidia-nccl-cu11                         2.20.5
nvidia-nccl-cu12                         2.19.3
nvidia-nvjitlink-cu12                    12.3.101
nvidia-nvtx-cu11                         11.8.86
oauth2client                             4.1.3
oauthlib                                 3.2.2
omegaconf                                2.3.0
onnx                                     1.16.1
onnx-tf                                  1.10.0
onnxruntime                              1.18.1
openai                                   1.37.2
opencv-contrib-python                    4.10.0.84
opencv-python                            4.10.0.84
opencv-python-headless                   4.10.0.84
openpyxl                                 3.0.10
opentelemetry-api                        1.26.0
opentelemetry-exporter-otlp-proto-common 1.26.0
opentelemetry-exporter-otlp-proto-grpc   1.26.0
opentelemetry-instrumentation            0.47b0
opentelemetry-instrumentation-asgi       0.47b0
opentelemetry-instrumentation-fastapi    0.47b0
opentelemetry-proto                      1.26.0
opentelemetry-sdk                        1.26.0
opentelemetry-semantic-conventions       0.47b0
opentelemetry-util-http                  0.47b0
opt-einsum                               3.3.0
optax                                    0.2.3
optree                                   0.12.1
orbax-checkpoint                         0.5.20
ordered-set                              4.1.0
orjson                                   3.10.6
overrides                                7.7.0
packaging                                23.2
pandas                                   2.2.2
pandocfilters                            1.5.0
panel                                    1.2.1
param                                    1.13.0
parsel                                   1.6.0
parso                                    0.8.3
partd                                    1.2.0
pathlib                                  1.0.1
pathspec                                 0.10.3
patsy                                    0.5.3
pdf2image                                1.17.0
pdfminer.six                             20231228
pdfplumber                               0.11.2
pep8                                     1.7.1
pexpect                                  4.8.0
pickleshare                              0.7.5
pikepdf                                  9.1.0
pillow                                   10.4.0
pillow_heif                              0.18.0
pip                                      24.2
pkginfo                                  1.9.6
platformdirs                             2.5.2
plotly                                   5.9.0
pluggy                                   1.0.0
ply                                      3.11
pooch                                    1.4.0
portalocker                              2.10.1
portpicker                               1.6.0
posthog                                  3.5.0
poyo                                     0.5.0
prometheus-client                        0.14.1
promise                                  2.3
prompt_toolkit                           3.0.47
Protego                                  0.1.16
proto-plus                               1.24.0
protobuf                                 4.25.4
psutil                                   5.9.0
ptyprocess                               0.7.0
pure-eval                                0.2.2
py-cpuinfo                               9.0.0
pyarrow                                  11.0.0
pyasn1                                   0.4.8
pyasn1-modules                           0.2.8
pybind11                                 2.13.1
pycocotools                              2.0.8
pycodestyle                              2.10.0
pycosat                                  0.6.4
pycparser                                2.21
pyct                                     0.5.0
pycurl                                   7.45.2
pydantic                                 2.8.2
pydantic_core                            2.20.1
pydeck                                   0.9.1
PyDispatcher                             2.0.5
pydocstyle                               6.3.0
pyerfa                                   2.0.0
pyflakes                                 3.0.1
Pygments                                 2.15.1
PyJWT                                    2.4.0
pylint                                   2.16.2
pylint-venv                              2.3.0
pyls-spyder                              0.4.0
pyodbc                                   4.0.34
pyOpenSSL                                23.2.0
pyparsing                                3.0.9
pypdf                                    4.3.1
pypdfium2                                4.30.0
PyPika                                   0.48.9
pyproject_hooks                          1.1.0
PyQt5-sip                                12.11.0
pyrsistent                               0.18.0
PySocks                                  1.7.1
pytesseract                              0.3.10
pytest                                   7.4.0
python-dateutil                          2.8.2
python-dotenv                            1.0.1
python-iso639                            2024.4.27
python-json-logger                       2.0.7
python-lsp-black                         1.2.1
python-lsp-jsonrpc                       1.0.0
python-lsp-server                        1.7.2
python-magic                             0.4.27
python-multipart                         0.0.9
python-slugify                           5.0.2
python-snappy                            0.6.1
pytoolconfig                             1.2.5
pytz                                     2022.7
pyviz-comms                              2.3.0
PyWavelets                               1.4.1
pyxdg                                    0.27
PyYAML                                   6.0.1
pyzmq                                    23.2.0
QDarkStyle                               3.0.2
qstylizer                                0.2.2
QtAwesome                                1.2.2
qtconsole                                5.4.2
QtPy                                     2.2.0
queuelib                                 1.5.0
rapidfuzz                                3.9.5
regex                                    2024.7.24
requests                                 2.31.0
requests-file                            1.5.1
requests-oauthlib                        2.0.0
requests-toolbelt                        1.0.0
responses                                0.13.3
rfc3339-validator                        0.1.4
rfc3986-validator                        0.1.1
rich                                     13.7.1
rope                                     1.7.0
rsa                                      4.9
Rtree                                    1.0.1
ruamel.yaml                              0.17.21
ruamel-yaml-conda                        0.17.21
s3fs                                     2023.4.0
sacrebleu                                2.4.2
sacremoses                               0.0.43
safetensors                              0.4.3
scikit-image                             0.20.0
scikit-learn                             1.3.0
scikit-learn-intelex                     20230426.111612
scipy                                    1.10.1
Scrapy                                   2.8.0
seaborn                                  0.12.2
SecretStorage                            3.3.1
Send2Trash                               1.8.0
sentencepiece                            0.2.0
seqeval                                  1.2.2
service-identity                         18.1.0
setuptools                               68.0.0
shapely                                  2.0.5
shellingham                              1.5.4
simple_parsing                           0.1.5
sip                                      6.6.2
six                                      1.16.0
smart-open                               5.2.1
smmap                                    5.0.1
sniffio                                  1.2.0
snowballstemmer                          2.2.0
sortedcontainers                         2.4.0
sounddevice                              0.4.7
soupsieve                                2.4
Sphinx                                   5.0.2
sphinxcontrib-applehelp                  1.0.2
sphinxcontrib-devhelp                    1.0.2
sphinxcontrib-htmlhelp                   2.0.0
sphinxcontrib-jsmath                     1.0.1
sphinxcontrib-qthelp                     1.0.3
sphinxcontrib-serializinghtml            1.1.5
spyder                                   5.4.3
spyder-kernels                           2.4.3
SQLAlchemy                               1.4.39
stack-data                               0.2.0
starlette                                0.37.2
statsmodels                              0.14.0
streamlit                                1.37.0
sympy                                    1.11.1
tables                                   3.8.0
tabulate                                 0.8.10
tb-nightly                               2.18.0a20240716
TBB                                      0.2
tblib                                    1.7.0
tenacity                                 8.5.0
tensorboard                              2.15.2
tensorboard-data-server                  0.7.2
tensorflow                               2.15.0
tensorflow-addons                        0.23.0
tensorflow-datasets                      4.9.6
tensorflow-decision-forests              1.5.0
tensorflow-estimator                     2.15.0
tensorflow-hub                           0.16.1
tensorflow-io-gcs-filesystem             0.37.1
tensorflow-metadata                      1.15.0
tensorflow-model-optimization            0.7.5
tensorflow-probability                   0.24.0
tensorflow-text                          2.15.0
tensorflowjs                             4.20.0
tensorrt                                 10.2.0.post1
tensorrt-cu12                            10.2.0.post1
tensorrt-cu12-bindings                   10.2.0.post1
tensorrt-cu12-libs                       10.2.0.post1
tensorstore                              0.1.63
termcolor                                2.4.0
terminado                                0.17.1
text-unidecode                           1.3
textdistance                             4.2.1
tf_keras                                 2.15.1
tf-models-official                       2.15.0
tf-nightly                               2.18.0.dev20240704
tf-slim                                  1.1.0
tflite-support                           0.1.0a1
thop                                     0.1.1-2209072238
threadpoolctl                            2.2.0
three-merge                              0.1.1
tifffile                                 2021.7.2
tiktoken                                 0.7.0
timm                                     1.0.8
tinycss2                                 1.2.1
tldextract                               3.2.0
tokenizers                               0.13.2
toml                                     0.10.2
tomlkit                                  0.11.1
toolz                                    0.12.0
torch                                    2.4.0.dev20240429+cpu
torch-xla                                2.4.0+git174f407
torchaudio                               2.2.0.dev20240429+cpu
torchvision                              0.19.0.dev20240429+cpu
tornado                                  6.3.2
tqdm                                     4.65.0
traitlets                                5.14.3
transformers                             4.29.2
triton                                   2.3.1
Twisted                                  22.10.0
typeguard                                2.13.3
typer                                    0.12.3
typing_extensions                        4.12.2
typing-inspect                           0.9.0
tzdata                                   2024.1
uc-micro-py                              1.0.1
ujson                                    5.4.0
ultralytics                              8.2.2
ultralytics-thop                         2.0.0
Unidecode                                1.2.0
unstructured                             0.15.0
unstructured-client                      0.25.1
unstructured-inference                   0.7.36
unstructured.pytesseract                 0.3.12
uritemplate                              3.0.1
urllib3                                  2.2.2
utils                                    1.0.2
uvicorn                                  0.30.5
uvloop                                   0.19.0
w3lib                                    1.21.0
watchdog                                 2.1.6
watchfiles                               0.22.0
wcwidth                                  0.2.5
webencodings                             0.5.1
websocket-client                         0.58.0
websockets                               12.0
Werkzeug                                 2.2.3
whatthepatch                             1.0.2
wheel                                    0.38.4
widgetsnbextension                       4.0.5
wrapt                                    1.14.1
wurlitzer                                3.0.2
xarray                                   2023.6.0
xxhash                                   2.0.2
xyzservices                              2022.9.0
y-py                                     0.5.9
yapf                                     0.31.0
yarl                                     1.8.1
ydf                                      0.6.0
ypy-websocket                            0.8.2
zict                                     2.2.0
zipp                                     3.11.0
zope.interface                           5.4.0
zstandard                                0.19.0

It looks like a dependence, because even installing other versions of neo4j-runway with Python 10 is generating the same error.

a-s-g93 commented 3 months ago

I'm also now receiving this error locally and I suspect it may be due to instructor 1.3.7. I downgraded instructor to 1.2.0 and the errors resolve. Let me know if this works for you

pip install instructor==1.2.0

RubensZimbres commented 3 months ago

Perfect, problem solved. Thanks very much!