Skip to content

Commit 557833b

Browse files
committed
add omni code
Signed-off-by: caitianchi <caitianchi@modelbest.cn>
1 parent 771e78d commit 557833b

28 files changed

+28333
-0
lines changed

tools/omni/CMakeLists.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# omni
2+
3+
find_package(Threads REQUIRED)
4+
5+
add_library(omni
6+
omni.cpp
7+
omni.h
8+
audition.cpp
9+
audition.h
10+
vision.cpp
11+
vision.h
12+
omni-impl.h
13+
token2wav/token2wav-impl.cpp
14+
token2wav/token2wav-impl.h
15+
token2wav/token2wav.cpp
16+
token2wav/token2wav.h
17+
)
18+
19+
target_link_libraries (omni PUBLIC ggml llama common)
20+
target_link_libraries (omni PRIVATE Threads::Threads)
21+
target_include_directories(omni PUBLIC .)
22+
target_include_directories(omni PRIVATE ../..)
23+
target_include_directories(omni PRIVATE ../../vendor)
24+
target_compile_features (omni PRIVATE cxx_std_17)
25+
26+
if (BUILD_SHARED_LIBS)
27+
set_target_properties (omni PROPERTIES POSITION_INDEPENDENT_CODE ON)
28+
target_compile_definitions(omni PRIVATE LLAMA_BUILD)
29+
target_compile_definitions(omni PUBLIC LLAMA_SHARED)
30+
endif()
31+
32+
set(OMNI_PUBLIC_HEADERS
33+
${CMAKE_CURRENT_SOURCE_DIR}/omni.h
34+
)
35+
36+
set_target_properties(omni
37+
PROPERTIES
38+
PUBLIC_HEADER "${MTMD_PUBLIC_HEADERS}")
39+
40+
install(TARGETS omni LIBRARY PUBLIC_HEADER)
41+
42+
if (NOT MSVC)
43+
# for stb_image.h and miniaudio.h
44+
target_compile_options(omni PRIVATE -Wno-cast-qual)
45+
endif()
46+
47+
if (TARGET BUILD_INFO)
48+
add_dependencies(omni BUILD_INFO)
49+
endif()
50+
51+
set(TARGET llama-omni-cli)
52+
add_executable (${TARGET} omni-cli.cpp)
53+
set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME llama-omni-cli)
54+
if(LLAMA_TOOLS_INSTALL)
55+
install(TARGETS ${TARGET} RUNTIME)
56+
endif()
57+
target_link_libraries (${TARGET} PRIVATE common omni Threads::Threads)
58+
target_compile_features(${TARGET} PRIVATE cxx_std_17)
59+
60+
# # TTS 推理测试程序
61+
# add_executable(test_tts_inference test/test_tts_inference.cpp)
62+
# target_link_libraries(test_tts_inference PRIVATE common omni Threads::Threads)
63+
# target_compile_features(test_tts_inference PRIVATE cxx_std_17)
64+
65+
# # Test TTS hidden states
66+
# add_executable(test_tts_hidden_states test/test_tts_hidden_states.cpp)
67+
# target_link_libraries(test_tts_hidden_states PRIVATE common omni Threads::Threads)
68+
# target_compile_features(test_tts_hidden_states PRIVATE cxx_std_17)
69+
70+
# # 纯文本输入测试 - 完整 C++ TTS 流程
71+
# add_executable(omni-text-test test/omni-cli-text-test.cpp)
72+
# target_link_libraries(omni-text-test PRIVATE common omni Threads::Threads)
73+
# target_compile_features(omni-text-test PRIVATE cxx_std_17)
74+
75+
# # Token2Wav 测试程序 - 完整 C++ 语音合成
76+
# add_executable(token2wav-example token2wav/token2wav-example.cpp)
77+
# target_link_libraries(token2wav-example PRIVATE common omni Threads::Threads)
78+
# target_compile_features(token2wav-example PRIVATE cxx_std_17)
79+

tools/omni/README.md

Whitespace-only changes.
188 KB
Binary file not shown.

0 commit comments

Comments
 (0)