Skip to content

Commit

Permalink
Always use tqdm for progress indicator in LIT notebook.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 690649826
  • Loading branch information
bdu91 authored and LIT team committed Oct 30, 2024
1 parent 40f74ce commit c38d8cd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lit_nlp/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@
from lit_nlp import server_config
from lit_nlp.api import layout
from lit_nlp.lib import wsgi_serving
from tqdm import notebook

JsonDict = Mapping[str, Any]

is_colab = False
try:
import google.colab # pylint: disable=g-import-not-at-top,unused-import
from google.colab import output # pylint: disable=g-import-not-at-top,unused-import # pytype: disable=import-error
is_colab = True
# Can disable import error as this package is always
# included in colab kernels.
from colabtools import interactive_widgets # pylint: disable=g-import-not-at-top # pytype: disable=import-error
progress_indicator = interactive_widgets.ProgressIter
except (ImportError, ModuleNotFoundError):
from tqdm import notebook # pylint: disable=g-import-not-at-top
progress_indicator = notebook.tqdm
is_colab = False

progress_indicator = notebook.tqdm
modules = layout.LitModuleName

LIT_NOTEBOOK_LAYOUT = layout.LitCanonicalLayout(
Expand Down

0 comments on commit c38d8cd

Please sign in to comment.