Xin Zhang commited on
Commit
418e265
·
1 Parent(s): 0d81579

[fix]: logging level.

Browse files
Files changed (2) hide show
  1. config.py +1 -1
  2. transcribe/helpers/funasr.py +4 -4
config.py CHANGED
@@ -5,7 +5,7 @@ import json
5
 
6
 
7
  DEBUG = False
8
- LOG_LEVEL = logging.DEBUG if DEBUG else logging.INFO
9
 
10
  logging.getLogger("pywhispercpp").setLevel(logging.WARNING)
11
  logging.basicConfig(
 
5
 
6
 
7
  DEBUG = False
8
+ LOG_LEVEL = logging.DEBUG if DEBUG else logging.WARNING
9
 
10
  logging.getLogger("pywhispercpp").setLevel(logging.WARNING)
11
  logging.basicConfig(
transcribe/helpers/funasr.py CHANGED
@@ -1,11 +1,11 @@
1
- from logging import getLogger
2
 
3
  import numpy as np
4
  from funasr import AutoModel
5
 
6
  import config
7
 
8
- logger = getLogger(__name__)
9
 
10
 
11
  class FunASR:
@@ -13,7 +13,7 @@ class FunASR:
13
  self.source_lange = source_lange
14
 
15
  self.model = AutoModel(
16
- model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc"
17
  )
18
  if warmup:
19
  self.warmup()
@@ -30,5 +30,5 @@ class FunASR:
30
  output = self.model.generate(input=audio_frames, disable_pbar=True, hotword=config.hotwords_file.as_posix())
31
  return output
32
  except Exception as e:
33
- logger.error(e)
34
  return []
 
1
+ # from logging import getLogger
2
 
3
  import numpy as np
4
  from funasr import AutoModel
5
 
6
  import config
7
 
8
+ # logger = getLogger(__name__)
9
 
10
 
11
  class FunASR:
 
13
  self.source_lange = source_lange
14
 
15
  self.model = AutoModel(
16
+ model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc", log_level="ERROR",
17
  )
18
  if warmup:
19
  self.warmup()
 
30
  output = self.model.generate(input=audio_frames, disable_pbar=True, hotword=config.hotwords_file.as_posix())
31
  return output
32
  except Exception as e:
33
+ print(f"Error during transcription: {e}")
34
  return []