Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding environment variable for transformers in models #702

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/dockerfile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ RUN if [ "$INSTALL_DISTRIBUTED_EMBEDDINGS" == "true" ]; then \
cd /distributed_embeddings && git checkout ${TFDE_VER} && git submodule update --init --recursive && \
make pip_pkg && pip install artifacts/*.whl && make clean; \
fi

ENV FORCE_TF_AVAILABLE=true
Copy link
Member

Choose a reason for hiding this comment

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

maybe worth adding a comment here providing some background on this - That the env var is for the transformers package to look up. And required because importlib.metadata.version("tensorflow") doesn't work (raises PackageNotFoundError) for our custom version of tensorflow that ships in the container

Copy link
Member

Choose a reason for hiding this comment

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

Now that I mentioned this, I realised that checking if this also applies in the image where we're getting tensorflow from might be worthwhile. (nvcr.io/nvidia/tensorflow:22.08-tf2-py3). The metadata version import works there. And this is because the dist-info directory for tensorflow is present in the dist-packages directory there.

An alternative (or additional change to this env var) could be to copy over the dist-info directory along with the package perhaps

Copy link
Member

Choose a reason for hiding this comment

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

Opened a PR here to add dist-info #704