SenseVoice icon indicating copy to clipboard operation
SenseVoice copied to clipboard

TypeError: 'NoneType' object is not callable

Open cxshnl opened this issue 3 months ago • 0 comments

question

I first followed the README and ran
pip install -r requirements.txt
to set up the environment.

Then, I continued following the README under Usage → Inference and ran the code shown there, but I got the following error.

I also ran demo1.py, and the output was the same error.
  Cell In[18], line 5
    Then, I continued following the README under Usage → Inference and ran the code shown there, but I got the following error.
                                                       ^
SyntaxError: invalid character '→' (U+2192)

code

from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
model_dir = "iic/SenseVoiceSmall"


model = AutoModel(
    model=model_dir,
    trust_remote_code=True,
    remote_code="./model.py",    
    vad_model="fsmn-vad",
    vad_kwargs={"max_single_segment_time": 30000},
    device="cuda:0",
)
funasr version: 1.2.7.
Check update of funasr, and it would cost few times. You may disable it by set `disable_update=True` in AutoModel
You are using the latest version of funasr-1.2.7
Downloading Model from https://www.modelscope.cn to directory: /home/cxshnl/.cache/modelscope/hub/models/iic/SenseVoiceSmall


WARNING:root:trust_remote_code: True


Loading remote code successfully: ./model.py



---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

Cell In[17], line 4
      1 model_dir = "iic/SenseVoiceSmall"
----> 4 model = AutoModel(
      5     model=model_dir,
      6     trust_remote_code=True,
      7     remote_code="./model.py",    
      8     vad_model="fsmn-vad",
      9     vad_kwargs={"max_single_segment_time": 30000},
     10     device="cuda:0",
     11 )


File /data/cxshnl/minaconda3/envs/sensevoice/lib/python3.11/site-packages/funasr/auto/auto_model.py:125, in AutoModel.__init__(self, **kwargs)
    122 log_level = getattr(logging, kwargs.get("log_level", "INFO").upper())
    123 logging.basicConfig(level=log_level)
--> 125 model, kwargs = self.build_model(**kwargs)
    127 # if vad_model is not None, build vad model else None
    128 vad_model = kwargs.get("vad_model", None)


File /data/cxshnl/minaconda3/envs/sensevoice/lib/python3.11/site-packages/funasr/auto/auto_model.py:228, in AutoModel.build_model(**kwargs)
    225     tokenizer_conf["seg_dict"] = seg_dicts[i]
    226 ### === only for kws ===
--> 228 tokenizer = tokenizer_class(**tokenizer_conf)
    229 tokenizers_build.append(tokenizer)
    230 token_list = tokenizer.token_list if hasattr(tokenizer, "token_list") else None


TypeError: 'NoneType' object is not callable

environment

OS: CentOS Linux release 7.5.1804 (Core), Kernel 3.10.0-862.el7.x86_64
FunASR Version: 1.2.7
ModelScope Version: 1.30.0
PyTorch Version: 2.3.0+cu121
How you installed funasr: pip
Python Version: 3.11.13
GPU: NVIDIA A100 80GB PCIe (81920 MiB)
CUDA/cuDNN Version: CUDA 12.1 / cuDNN 8902 (nvcc 12.4)
Docker Version: 23.0.2
Any other relevant information: -


cxshnl avatar Sep 26 '25 03:09 cxshnl