yonikremer commited on
Commit
a0650fb
1 Parent(s): 4267129

disabled huggingface hub progress bar

Browse files
Files changed (1) hide show
  1. on_server_start.py +4 -3
on_server_start.py CHANGED
@@ -2,14 +2,16 @@
2
  A script that is run when the server starts.
3
  """
4
  from download_repo import download_repository
 
 
5
 
6
 
7
  def disable_progress_bar():
8
  """
9
  Disables the progress bar when downloading models.
10
  """
11
- import transformers
12
- transformers.logging.disable_progress_bar()
13
 
14
 
15
  def download_useful_models():
@@ -25,7 +27,6 @@ def download_useful_models():
25
  for model_name in useful_models:
26
  download_repository(
27
  model_name,
28
-
29
  )
30
 
31
 
 
2
  A script that is run when the server starts.
3
  """
4
  from download_repo import download_repository
5
+ from transformers import logging as transformers_logging
6
+ from huggingface_hub import logging as huggingface_hub_logging
7
 
8
 
9
  def disable_progress_bar():
10
  """
11
  Disables the progress bar when downloading models.
12
  """
13
+ transformers_logging.disable_progress_bar()
14
+ huggingface_hub_logging.disable_propagation()
15
 
16
 
17
  def download_useful_models():
 
27
  for model_name in useful_models:
28
  download_repository(
29
  model_name,
 
30
  )
31
 
32