[PR #781] [CLOSED] add speech to text, use funasr #22685

Closed
opened 2026-02-21 20:19:31 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify/pull/781
Author: @lingfengchencn
Created: 8/8/2023
Status: Closed

Base: mainHead: main


📝 Commits (8)

📊 Changes

42 files changed (+824 additions, -177 deletions)

View changed files

📝 api/Dockerfile (+3 -2)
📝 api/app.py (+5 -2)
📝 api/constants/model_template.py (+4 -0)
📝 api/controllers/console/admin.py (+9 -8)
📝 api/controllers/console/app/app.py (+4 -0)
📝 api/controllers/console/app/audio.py (+14 -6)
📝 api/controllers/console/universal_chat/audio.py (+12 -6)
📝 api/controllers/service_api/app/audio.py (+14 -6)
📝 api/controllers/web/audio.py (+12 -5)
📝 api/controllers/web/passport.py (+5 -1)
api/core/asr/base.py (+14 -0)
api/core/asr/para_asr.py (+84 -0)
📝 api/core/asr/whisper.py (+9 -6)
📝 api/core/embedding/cached_embedding.py (+2 -2)
📝 api/requirements.txt (+3 -1)
📝 api/services/audio_service.py (+30 -13)
api/tests/core/__init__.py (+0 -0)
api/tests/core/asr/__init__.py (+0 -0)
api/tests/core/asr/test_funasr.py (+16 -0)
📝 docker/docker-compose.yaml (+60 -86)

...and 22 more files

📄 Description

use funasr onnx to transcribe audio file

add python requirements.txt

funasr_onnx
funasr

use models from modelscope funasr:

damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch
damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch
damo/speech_fsmn_vad_zh-cn-16k-common-pytorch

test code:

python -m unittest tests/core/asr/test_funasr.py

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify/pull/781 **Author:** [@lingfengchencn](https://github.com/lingfengchencn) **Created:** 8/8/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (8) - [`2796971`](https://github.com/langgenius/dify/commit/279697187b43ac4ca50afdcd19ec1c3805f2160f) add speed to text , use funasr。 - [`ca18ce7`](https://github.com/langgenius/dify/commit/ca18ce79c54d125851120c89dbd4d998bd87dd47) Merge branch 'langgenius:main' into main - [`8e73aab`](https://github.com/langgenius/dify/commit/8e73aabd61cddd7954b68b46319d56273e44d703) Merge branch 'langgenius:main' into main - [`e48e13f`](https://github.com/langgenius/dify/commit/e48e13fc93bfdd25ee46fcbd1f58268520f938d2) fix install recommendedapp desc、copyright、privacy none bug - [`161db2f`](https://github.com/langgenius/dify/commit/161db2f5df9af2c48abda5e71b85fe46c87d8fa3) add anonymous user - [`f82b4e6`](https://github.com/langgenius/dify/commit/f82b4e6d614c6d9db9e0bbd32bf807afcd7b381e) Merge branch 'main' of https://github.com/lingfengchencn/dify into main - [`8b6f03b`](https://github.com/langgenius/dify/commit/8b6f03b08d59c82a388e3537f60400aae1ad55fd) Revert "Merge branch 'langgenius:main' into main" - [`8ed6e91`](https://github.com/langgenius/dify/commit/8ed6e9130ecba1b3e1436e3bada557e96b131fac) Revert "Merge branch 'langgenius:main' into main" ### 📊 Changes **42 files changed** (+824 additions, -177 deletions) <details> <summary>View changed files</summary> 📝 `api/Dockerfile` (+3 -2) 📝 `api/app.py` (+5 -2) 📝 `api/constants/model_template.py` (+4 -0) 📝 `api/controllers/console/admin.py` (+9 -8) 📝 `api/controllers/console/app/app.py` (+4 -0) 📝 `api/controllers/console/app/audio.py` (+14 -6) 📝 `api/controllers/console/universal_chat/audio.py` (+12 -6) 📝 `api/controllers/service_api/app/audio.py` (+14 -6) 📝 `api/controllers/web/audio.py` (+12 -5) 📝 `api/controllers/web/passport.py` (+5 -1) ➕ `api/core/asr/base.py` (+14 -0) ➕ `api/core/asr/para_asr.py` (+84 -0) 📝 `api/core/asr/whisper.py` (+9 -6) 📝 `api/core/embedding/cached_embedding.py` (+2 -2) 📝 `api/requirements.txt` (+3 -1) 📝 `api/services/audio_service.py` (+30 -13) ➕ `api/tests/core/__init__.py` (+0 -0) ➕ `api/tests/core/asr/__init__.py` (+0 -0) ➕ `api/tests/core/asr/test_funasr.py` (+16 -0) 📝 `docker/docker-compose.yaml` (+60 -86) _...and 22 more files_ </details> ### 📄 Description use `funasr onnx` to transcribe audio file add python requirements.txt ``` funasr_onnx funasr ``` use models from `modelscope` funasr: ``` damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch damo/speech_fsmn_vad_zh-cn-16k-common-pytorch ``` test code: ```python python -m unittest tests/core/asr/test_funasr.py ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-21 20:19:31 -05:00
yindo closed this issue 2026-02-21 20:19:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22685