ddlBoJack / emotion2vec

[ACL 2024] Official PyTorch code for extracting features and training downstream models with emotion2vec: Self-Supervised Pre-Training for Speech Emotion Representation
637 stars 47 forks source link

ModuleNotFoundError: No module named 'addict' #49

Closed shivamtawari closed 2 weeks ago

shivamtawari commented 3 weeks ago

Hi

I am facing this issue:

Code:

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

inference_pipeline = pipeline(
    task=Tasks.emotion_recognition,
    model="iic/emotion2vec_plus_large")  # Alternative: iic/emotion2vec_plus_seed, iic/emotion2vec_plus_base, iic/emotion2vec_plus_large and iic/emotion2vec_base_finetuned

rec_result = inference_pipeline('https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav', output_dir="./outputs", granularity="utterance", extract_embedding=False)
print(rec_result)

Error:

[<ipython-input-1-36961c819417>](https://localhost:8080/#) in <cell line: 22>()
     20 '''
     21 
---> 22 from modelscope.pipelines import pipeline
     23 from modelscope.utils.constant import Tasks
     24 

7 frames
[/usr/local/lib/python3.10/dist-packages/modelscope/pipelines/__init__.py](https://localhost:8080/#) in <module>
      2 
      3 from . import audio, cv, multi_modal, nlp
----> 4 from .base import Pipeline
      5 from .builder import pipeline

[/usr/local/lib/python3.10/dist-packages/modelscope/pipelines/base.py](https://localhost:8080/#) in <module>
     13 from packaging import version
     14 
---> 15 from modelscope.models.base import Model
     16 from modelscope.msdatasets import MsDataset
     17 from modelscope.outputs import TASK_OUTPUTS, ModelOutputBase

[/usr/local/lib/python3.10/dist-packages/modelscope/models/__init__.py](https://localhost:8080/#) in <module>
      6 from modelscope.utils.import_utils import is_torch_available
      7 from . import audio, cv, multi_modal, nlp
----> 8 from .base import Head, Model
      9 from .builder import BACKBONES, HEADS, MODELS, build_model
     10 

[/usr/local/lib/python3.10/dist-packages/modelscope/models/base/__init__.py](https://localhost:8080/#) in <module>
      2 
      3 from modelscope.utils.import_utils import is_torch_available
----> 4 from .base_head import *  # noqa F403
      5 from .base_model import *  # noqa F403
      6 

[/usr/local/lib/python3.10/dist-packages/modelscope/models/base/base_head.py](https://localhost:8080/#) in <module>
      3 from typing import Any, Dict, Union
      4 
----> 5 from modelscope.models.base.base_model import Model
      6 from modelscope.utils.config import ConfigDict
      7 from modelscope.utils.logger import get_logger

[/usr/local/lib/python3.10/dist-packages/modelscope/models/base/base_model.py](https://localhost:8080/#) in <module>
      7 from modelscope.hub.snapshot_download import snapshot_download
      8 from modelscope.metainfo import Tasks
----> 9 from modelscope.models.builder import build_backbone, build_model
     10 from modelscope.utils.automodel_utils import (can_load_by_ms,
     11                                               try_to_load_hf_model)

[/usr/local/lib/python3.10/dist-packages/modelscope/models/builder.py](https://localhost:8080/#) in <module>
      1 # Copyright (c) Alibaba, Inc. and its affiliates.
      2 from modelscope.metainfo import Models
----> 3 from modelscope.utils.config import ConfigDict
      4 from modelscope.utils.constant import Tasks
      5 from modelscope.utils.import_utils import INDEX_KEY, LazyImportModule

[/usr/local/lib/python3.10/dist-packages/modelscope/utils/config.py](https://localhost:8080/#) in <module>
     15 from typing import Dict, Union
     16 
---> 17 import addict
     18 import json
     19 

ModuleNotFoundError: No module named 'addict'
ddlBoJack commented 2 weeks ago

Hi, please try again with the FunASR pipline.

shivamtawari commented 2 weeks ago

Thanks! Was able to do with FunASR.