explicit type imports to help robustness of isinstance check for images#41
Open
mathematicalmichael wants to merge 1 commit intoabraham-ai:masterfrom
Open
explicit type imports to help robustness of isinstance check for images#41mathematicalmichael wants to merge 1 commit intoabraham-ai:masterfrom
mathematicalmichael wants to merge 1 commit intoabraham-ai:masterfrom
Conversation
I still don't entirely have an explanation for this, but when I ran eden within docker, the client script that was working fine locally started running into the following error when the IP was changed to the container's address:
```
File "/home/eden/.local/lib/python3.10/site-packages/eden/datatypes.py", line 33, in __init__
self.data = encode(image)
File "/home/eden/.local/lib/python3.10/site-packages/eden/image_utils.py", line 41, in encode
or isinstance(
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union
```
`eden-python` was installed with `pip` in the docker image. When I sent a request to the container, I was getting "failed" statuses, and the logs of the container contained the error above printed to `stdout` (I set `logfile=None` in my `server.py`).
I added the proposed modified `image_utils.py` file into the build as a test for this change and consistently started getting "complete" statuses:
```
COPY image_utils.py /home/eden/.local/lib/python3.10/site-packages/eden/image_utils.py
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I still don't entirely have an explanation for this, but when I ran
edenwithin docker, the client script that was working fine locally started running into the following error when the IP was changed to the container's address:For context,
eden-pythonwas installed withpipin the docker image. When I sent a request to the container (from a client script running locally), I was getting "failed" statuses, and the logs of the container contained the error above printed tostdout(I setlogfile=Nonein myserver.py).I added the proposed modified
image_utils.pyfile into the build as a test for this change and consistently started getting "complete" statuses (tested this many times, seems to be reproducible behavior).Full
Dockerfilefor context (server.pyis thenot_so_minimalexample...)