Skip to content

fix: update CLIP module path to match correct Python version (3.10.15)#59

Open
isiahw1 wants to merge 1 commit into
philz1337x:mainfrom
isiahw1:main
Open

fix: update CLIP module path to match correct Python version (3.10.15)#59
isiahw1 wants to merge 1 commit into
philz1337x:mainfrom
isiahw1:main

Conversation

@isiahw1
Copy link
Copy Markdown

@isiahw1 isiahw1 commented Nov 25, 2024

Bug Fix: CLIP Module Path Update

Fixes #56

Issue

The Docker build was failing with the following error:
sed: can't read /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py: No such file or directory

This occurred because the sed command in cog.yaml was trying to modify the CLIP module in Python 3.10.4's site-packages directory, but the module was actually installed under Python 3.10.15 despite the python version being specified as 3.10.4 in cog.yaml.

Changes

  • Updated the Python path in the sed command from:

- sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.4/lib/python3.10/site-packages/clip/clip.py

to:

- sed -i 's/from pkg_resources import packaging/import packaging/g' /root/.pyenv/versions/3.10.15/lib/python3.10/site-packages/clip/clip.py

Testing

  • Verified that the Docker build completes successfully with the new path
  • Confirmed that the CLIP module is properly patched and loads without errors
  • Tested with cog predict command which now executes without the previous error

Additional Notes

The discrepancy between the Python versions (3.10.4 vs 3.10.15) appears to be due to the actual installation path differing from the version specified in python_version. This fix aligns the path with the actual installation location.

The sed command was failing because it was looking for the CLIP module in Python 3.10.4's site-packages, but the actual installation is in 3.10.15. Updated the path to fix the Docker build error.
@BDVGitHub
Copy link
Copy Markdown

@philz1337x or @pixelprotest is it possible to review this PR and possible commit it to the main branch?

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.

May I ask if someone has successfully deployed it locally?

2 participants