mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
* add cmakelist * add paraformer-torch * add debug for funasr-onnx-offline * fix redefinition of jieba StdExtension.hpp * add loading torch models * update funasr-onnx-offline * add SwitchArg for wss-server * add SwitchArg for funasr-onnx-offline * update cmakelist * update funasr-onnx-offline-rtf * add define condition * add gpu define for offlne-stream * update com define * update offline-stream * update cmakelist * update func CompileHotwordEmbedding * add timestamp for paraformer-torch * add C10_USE_GLOG for paraformer-torch * update paraformer-torch * fix func FunASRWfstDecoderInit * update model.h * fix func FunASRWfstDecoderInit * fix tpass_stream * update paraformer-torch * add bladedisc for funasr-onnx-offline * update comdefine * update funasr-wss-server * add log for torch * fix GetValue BLADEDISC * fix log * update cmakelist * update warmup to 10 * update funasrruntime * add batch_size for wss-server * add batch for bins * add batch for offline-stream * add batch for paraformer * add batch for offline-stream * fix func SetBatchSize * add SetBatchSize for model * add SetBatchSize for model * fix func Forward * fix padding * update funasrruntime * add dec reset for batch * set batch default value * add argv for CutSplit * sort frame_queue * sorted msgs * fix FunOfflineInfer * add dynamic batch for fetch * fix FetchDynamic * update run_server.sh * update run_server.sh * cpp http post server support (#1739) * add cpp http server * add some comment * remove some comments * del debug infos * restore run_server.sh * adapt to new model struct * 修复了onnxruntime在macos下编译失败的错误 (#1748) * Add files via upload 增加macos的编译支持 * Add files via upload 增加macos支持 * Add files via upload target_link_directories(funasr PUBLIC ${ONNXRUNTIME_DIR}/lib) target_link_directories(funasr PUBLIC ${FFMPEG_DIR}/lib) 添加 if(APPLE) 限制 --------- Co-authored-by: Yabin Li <wucong.lyb@alibaba-inc.com> * Delete docs/images/wechat.png * Add files via upload * fixed the issues about seaco-onnx timestamp * fix bug (#1764) 当语音识别结果包含 `http` 时,标点符号预测会把它会被当成 url * fix empty asr result (#1765) 解码结果为空的语音片段,text 用空字符串 * docs * docs * docs * docs * docs * keep empty speech result (#1772) * docs * docs * update wechat QRcode * Add python funasr api support for websocket srv (#1777) * add python funasr_api supoort * change little to README.md * add core tools stream * modified a little * fix bug for timeout * support for buffer decode * add ffmpeg decode for buffer * auto frontend * auto frontend --------- Co-authored-by: 雾聪 <wucong.lyb@alibaba-inc.com> Co-authored-by: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com> Co-authored-by: szsteven008 <97944818+szsteven008@users.noreply.github.com> Co-authored-by: Ephemeroptera <605686962@qq.com> Co-authored-by: 彭震东 <zhendong.peng@qq.com> Co-authored-by: Shi Xian <40013335+R1ckShi@users.noreply.github.com> Co-authored-by: 维石 <shixian.shi@alibaba-inc.com>
93 lines
3.3 KiB
CMake
93 lines
3.3 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(FunASROnnx)
|
|
|
|
option(ENABLE_GLOG "Whether to build glog" ON)
|
|
option(ENABLE_FST "Whether to build openfst" ON) # ITN need openfst compiled
|
|
option(GPU "Whether to build with GPU" OFF)
|
|
|
|
# set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ version to be used.")
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
include(TestBigEndian)
|
|
test_big_endian(BIG_ENDIAN)
|
|
if(BIG_ENDIAN)
|
|
message("Big endian system")
|
|
else()
|
|
message("Little endian system")
|
|
endif()
|
|
|
|
# json
|
|
include(FetchContent)
|
|
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third_party/json/ChangeLog.md )
|
|
FetchContent_Declare(json
|
|
URL https://github.com/nlohmann/json/archive/refs/tags/v3.11.2.tar.gz
|
|
SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/json
|
|
)
|
|
|
|
FetchContent_MakeAvailable(json)
|
|
endif()
|
|
|
|
# for onnxruntime
|
|
IF(WIN32)
|
|
file(REMOVE ${PROJECT_SOURCE_DIR}/third_party/glog/src/config.h
|
|
${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/export.h
|
|
${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/logging.h
|
|
${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/raw_logging.h
|
|
${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/stl_logging.h
|
|
${PROJECT_SOURCE_DIR}/third_party/glog/src/glog/vlog_is_on.h)
|
|
ELSE()
|
|
link_directories(${ONNXRUNTIME_DIR}/lib)
|
|
link_directories(${FFMPEG_DIR}/lib)
|
|
endif()
|
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/kaldi-native-fbank)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/yaml-cpp/include)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/jieba/include)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/jieba/include/limonp/include)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/kaldi)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/json/include)
|
|
|
|
if(GPU)
|
|
add_definitions(-DUSE_GPU)
|
|
set(TORCH_DIR "/usr/local/lib/python3.8/dist-packages/torch")
|
|
set(TORCH_BLADE_DIR "/usr/local/lib/python3.8/dist-packages/torch_blade")
|
|
include_directories(${TORCH_DIR}/include)
|
|
include_directories(${TORCH_DIR}/include/torch/csrc/api/include)
|
|
link_directories(${TORCH_DIR}/lib)
|
|
link_directories(${TORCH_BLADE_DIR})
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0")
|
|
endif()
|
|
|
|
if(ENABLE_GLOG)
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/glog/src)
|
|
set(BUILD_TESTING OFF)
|
|
add_subdirectory(third_party/glog)
|
|
include_directories(${glog_BINARY_DIR})
|
|
|
|
endif()
|
|
|
|
if(ENABLE_FST)
|
|
# fst depend on glog and gflags
|
|
include_directories(${PROJECT_SOURCE_DIR}/third_party/gflags)
|
|
add_subdirectory(third_party/gflags)
|
|
include_directories(${gflags_BINARY_DIR}/include)
|
|
|
|
# the following openfst if cloned from https://github.com/kkm000/openfst.git
|
|
# with some patch to fix the make errors.
|
|
add_subdirectory(third_party/openfst)
|
|
include_directories(${openfst_SOURCE_DIR}/src/include)
|
|
if(WIN32)
|
|
include_directories(${openfst_SOURCE_DIR}/src/lib)
|
|
endif()
|
|
|
|
endif()
|
|
|
|
add_subdirectory(third_party/yaml-cpp)
|
|
add_subdirectory(third_party/kaldi-native-fbank/kaldi-native-fbank/csrc)
|
|
add_subdirectory(third_party/kaldi)
|
|
add_subdirectory(src)
|
|
add_subdirectory(bin)
|