demo.py 505 B

12345678910111213
  1. #!/usr/bin/env python3
  2. # -*- encoding: utf-8 -*-
  3. # Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
  4. # MIT License (https://opensource.org/licenses/MIT)
  5. from funasr import AutoModel
  6. # model="damo/emotion2vec_base"
  7. model = AutoModel(model="iic/emotion2vec_base_finetuned", model_revision="v2.0.4")
  8. wav_file = f"{model.model_path}/example/test.wav"
  9. res = model.generate(wav_file, output_dir="./outputs", granularity="utterance", extract_embedding=False)
  10. print(res)