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

Catch import error separately for SUMModel #2077

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

SimonYansenZhao
Copy link
Collaborator

Description

This PR resolves the issue #2064. Because TensorFlow breaking changes make the code for SUMModel not work, so the tests relating to SUMModel are disabled, and import errors on SUMModel should be separately handled, otherwise, the imports following SUMModel (such as ImplicitCF) will not be run.

try:
import tensorflow as tf
from recommenders.models.deeprec.deeprec_utils import (
download_deeprec_resources,
prepare_hparams,
)
from recommenders.models.deeprec.models.base_model import BaseModel
from recommenders.models.deeprec.models.xDeepFM import XDeepFMModel
from recommenders.models.deeprec.models.dkn import DKN
from recommenders.models.deeprec.io.iterator import FFMTextIterator
from recommenders.models.deeprec.io.dkn_iterator import DKNTextIterator
from recommenders.models.deeprec.io.sequential_iterator import SequentialIterator
from recommenders.models.deeprec.models.sequential.sli_rec import SLI_RECModel
from recommenders.models.deeprec.models.sequential.sum import SUMModel
from recommenders.datasets.amazon_reviews import (
download_and_extract,
data_preprocessing,
)
from recommenders.models.deeprec.models.graphrec.lightgcn import LightGCN
from recommenders.models.deeprec.DataModel.ImplicitCF import ImplicitCF
except ImportError:
pass # disable error while collecting tests for non-gpu environments

Related Issues

#2064

Checklist:

  • I have followed the contribution guidelines and code style for this project.
  • I have added tests covering my contributions.
  • I have updated the documentation accordingly.
  • I have signed the commits, e.g. git commit -s -m "your commit message".
  • This PR is being made to staging branch AND NOT TO main branch.

@miguelgfierro miguelgfierro merged commit a739e75 into staging Apr 4, 2024
38 checks passed
@miguelgfierro miguelgfierro deleted the simonz/issue-2064-nameerror-implicitcf branch April 4, 2024 15:49
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