Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed Apr 23, 2024
1 parent 57eb3b8 commit 06de30d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doctr/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
" is installed and that either USE_TF or USE_TORCH is enabled."
)

if _tf_available: # Compatibility fix to make sure tf.keras stays at Keras 2
if "TF_USE_LEGACY_KERAS" not in os.environ:
os.environ["TF_USE_LEGACY_KERAS"] = "1"
elif os.environ["TF_USE_LEGACY_KERAS"] != "1":
raise ValueError(
"docTR is only compatible with Keras 2, but you have explicitly set `TF_USE_LEGACY_KERAS` to `0`. "
)
# Compatibility fix to make sure tf.keras stays at Keras 2
if "TF_USE_LEGACY_KERAS" not in os.environ:
os.environ["TF_USE_LEGACY_KERAS"] = "1"
elif os.environ["TF_USE_LEGACY_KERAS"] != "1":
raise ValueError(
"docTR is only compatible with Keras 2, but you have explicitly set `TF_USE_LEGACY_KERAS` to `0`. "
)


def requires_package(name: str, extra_message: Optional[str] = None) -> None: # pragma: no cover
Expand Down

0 comments on commit 06de30d

Please sign in to comment.