Xylor commited on
Commit
a5fcb71
·
verified ·
1 Parent(s): bc366a3

Fixed getLogger, switched level to info from debug

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -3,8 +3,8 @@ import logging
3
  import time
4
  from transformers import pipeline
5
 
6
- logger = logging.Logger("gradio_test_001")
7
- logger.setLevel(logging.DEBUG)
8
  logging.debug("Starting logging for gradio_test_001.")
9
 
10
  classifier = pipeline("zero-shot-classification",
@@ -33,12 +33,12 @@ def transform_output(res: dict) -> list:
33
  )
34
 
35
  def clf_text(txt: str | list[str]):
36
- logger.debug("Classify: " + repr(txt))
37
  t0 = time.time()
38
  res = classifier(txt, categories, multi_label=True)
39
  elapsed = time.time() - t0
40
- logger.debug(f"Done. {elapsed:.02f}s")
41
- logger.debug(f"Result(s): " + repr(res))
42
  if isinstance(res, list):
43
  return [ transform_output(dct) for dct in res ]
44
  else:
 
3
  import time
4
  from transformers import pipeline
5
 
6
+ logger = logging.getLogger("gradio_test_001")
7
+ logger.setLevel(logging.INFO)
8
  logging.debug("Starting logging for gradio_test_001.")
9
 
10
  classifier = pipeline("zero-shot-classification",
 
33
  )
34
 
35
  def clf_text(txt: str | list[str]):
36
+ logger.info("Classify: " + repr(txt))
37
  t0 = time.time()
38
  res = classifier(txt, categories, multi_label=True)
39
  elapsed = time.time() - t0
40
+ logger.info(f"Done. {elapsed:.02f}s")
41
+ logger.info(f"Result(s): " + repr(res))
42
  if isinstance(res, list):
43
  return [ transform_output(dct) for dct in res ]
44
  else: