From b9a070fca6fbd722a6c4be14d897644ab8a1801a Mon Sep 17 00:00:00 2001 From: Lysandre Date: Wed, 31 Aug 2022 15:01:25 +0200 Subject: [PATCH] Update location identification --- .github/workflows/add-model-like.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/add-model-like.yml b/.github/workflows/add-model-like.yml index 2d2ab5b2e15b65..7b6e96bb874aa0 100644 --- a/.github/workflows/add-model-like.yml +++ b/.github/workflows/add-model-like.yml @@ -41,10 +41,12 @@ jobs: run: | . ~/venv/bin/activate python setup.py develop - transformer_loc=$(pip show transformers | grep "Location: " | cut -c11-) - transformer_repo_loc=$(pwd .) - if [ "$transformer_loc" != "$transformer_repo_loc/src" ]; then - echo "transformers is from $transformer_loc but it shoud be from $transformer_repo_loc/src." + transformers_install=$(pip list -e | grep transformers) + transformers_install_array=($transformers_install) + transformers_loc=${transformers_install_array[-1]} + transformers_repo_loc=$(pwd .) + if [ "$transformers_loc" != "$transformers_repo_loc" ]; then + echo "transformers is from $transformers_loc but it shoud be from $transformers_repo_loc/src." echo "A fix is required. Stop testing." exit 1 fi