Skip to content

Numpy version#6

Merged
bradley-erickson merged 9 commits into
mainfrom
numpy_version
Dec 16, 2024
Merged

Numpy version#6
bradley-erickson merged 9 commits into
mainfrom
numpy_version

Conversation

@duckduckdoof
Copy link
Copy Markdown

Added numpy version lock -- installing AWE_Workbench causes an installation issue when pulling model data. Also updates lexica dependency.

Comment thread setup.cfg
rdflib
spacytextblob
numpy
numpy==1.26.4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reluctant to add version locking here without knowing where the code breaks. Have we figured out why we need both this and the torch version lock?
Ideally, we don't have to lock either and we just fix the code that is breaking.

@bradley-erickson
Copy link
Copy Markdown

bradley-erickson commented Nov 18, 2024

  • Mark TODOs in the code where the version locks are needed (like our chosen model, wherever its accessed, needs numpy v1)

@duckduckdoof
Copy link
Copy Markdown
Author

I was able to track down the errors which originally caused me to revert the numpy version, but it's more confusing that I thought:

File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/awe_languagetool/setup/data.py", line 29, in <module>
    from spacy.cli.download import download
  File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/spacy/__init__.py", line 6, in <module>
    from .errors import setup_default_warnings
  File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/spacy/errors.py", line 2, in <module>
    from .compat import Literal
  File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/spacy/compat.py", line 38, in <module>
    from thinc.api import Optimizer  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/thinc/api.py", line 1, in <module>
    from .backends import (
  File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/thinc/backends/__init__.py", line 17, in <module>
    from .cupy_ops import CupyOps
  File "/home/goose/anaconda3/envs/arglab-wb-test/lib/python3.11/site-packages/thinc/backends/cupy_ops.py", line 16, in <module>
    from .numpy_ops import NumpyOps
  File "thinc/backends/numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Components is what installs numpy, but the issue is invoked after trying the python -m awe_workbench.setup.data --develop command

@duckduckdoof
Copy link
Copy Markdown
Author

duckduckdoof commented Nov 21, 2024

I'm not sure - referencing #6 (comment) - if there is a specific place in Components I can comment the proper TODO?

Comment thread awe_components/setup/data.py Outdated
#!/usr/bin/env python3
# Copyright 2022, Educational Testing Service

# TODO: using numpy>1.21.4 seems to cause errors when installing from awe_workbench.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version lock is 1.26.4. Is this just a typo?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct spot for this comment? I thought it had to do with the model we are using. So this comment ought to be placed where the model is loaded in. A quick search in the codebase makes me think it belongs in awe_components/wordprobs/wordProbabilityInContext.py; however, this may not be the correct spot for it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version lock is 1.26.4. Is this just a typo?

Yup! I'll fix that.

Is this the correct spot for this comment? I thought it had to do with the model we are using. So this comment ought to be placed where the model is loaded in. A quick search in the codebase makes me think it belongs in awe_components/wordprobs/wordProbabilityInContext.py; however, this may not be the correct spot for it.

From what I remember about the errors I was getting, it was referencing the spacy.cli.download import in data.py. I'll look at awe_components/wordprobs/wordProbabilityInContext.py nonetheless, but I think my comment is in the right place.

@bradley-erickson bradley-erickson merged commit 0d86877 into main Dec 16, 2024
duckduckdoof added a commit that referenced this pull request Oct 15, 2025
* Updated numpy dependency

* Updated reference to lexica

* Locked torch version

* Removed holmes dependency

* Added TODO for numpy version locking

* Fixed version in comment

* Fixed version typo

* Added websocket version lock
duckduckdoof added a commit that referenced this pull request Oct 15, 2025
* updated install data path

* added find packages flag to setup

* added function to download so we can call it from code if needed

* Updated numpy dependency

* Updated reference to lexica

* Numpy version (#6)

* Updated numpy dependency

* Updated reference to lexica

* Locked torch version

* Removed holmes dependency

* Added TODO for numpy version locking

* Fixed version in comment

* Fixed version typo

* Added websocket version lock

* textblob features hotfix

* Added spacytextblob doc feature name fix

* Added blob

* Added changes to config for testing

* Removed unnecessary dependencies, cleaned up existing

* Removed more unnecessary imports, fixed other import issues

* Removed even moar dependency issues, cleaned up imports

* Added back missing error imports, fixed variable decl

* Removed deprecated nameof

* Removed pesky import

* Removed branch for lexica

* Updated readme on installation

* updated readme and setup with ets specific urls

* Update setup.cfg

---------

Co-authored-by: duckduckdoof <duckduckdoof@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants