1
0
Fork 0
mirror of https://gitlab.com/niansa/anyproc.git synced 2025-03-06 20:49:24 +01:00

Moved example to other dir

This commit is contained in:
niansa 2023-05-21 17:44:31 +02:00
parent e1a72334e0
commit 2c2636cef5
5 changed files with 1184 additions and 13 deletions

View file

@ -7,7 +7,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(ANYPROC_PYBIND No CACHE BOOL "If Anyproc Python bindings should be build")
set(ANYPROC_COSCHED No CACHE BOOL "If Anyproc should make use of CoSched")
set(ANYPROC_EXAMPLES Yes CACHE BOOL "If Anyproc examples should be built")
if (ANYPROC_COSCHED)
set(CMAKE_CXX_STANDARD 20)
@ -17,14 +16,6 @@ add_library(anyproc INTERFACE)
target_include_directories(anyproc INTERFACE include/)
target_link_libraries(anyproc INTERFACE justlm)
if (ANYPROC_EXAMPLES)
add_executable(dictionary dictionary.cpp)
target_link_libraries(dictionary PUBLIC anyproc)
add_executable(translator translator.cpp)
target_link_libraries(translator PUBLIC anyproc)
endif()
if (ANYPROC_COSCHED)
target_link_libraries(anyproc INTERFACE cosched)
endif()

16
examples/CMakeLists.txt Normal file
View file

@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.5)
project(anyproc LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CPM.cmake)
CPMAddPackage("gl:niansa/libjustlm@1.0")
add_subdirectory(.. anyproc)
add_executable(dictionary dictionary.cpp)
target_link_libraries(dictionary PUBLIC anyproc)
add_executable(translator translator.cpp)
target_link_libraries(translator PUBLIC anyproc)

1154
examples/CPM.cmake Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,12 @@
int main() {
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " <model file>" << std::endl;
return -1;
}
const auto progress_indicator = [](float progress) {
std::cout << unsigned(progress) << "% \r" << std::flush;
return true;
@ -15,7 +20,7 @@ int main() {
return true;
};
Dictionary dict("13B-ggml-model-quant.bin");
Dictionary dict(argv[1]);
for (;;) {
std::string what;
std::cout << "What: " << std::flush;

View file

@ -5,7 +5,12 @@
int main() {
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " <model file>" << std::endl;
return -1;
}
const auto progress_indicator = [](float progress) {
std::cout << unsigned(progress) << "% \r" << std::flush;
return true;
@ -18,7 +23,7 @@ int main() {
return true;
};
Translator translator("7B-ggml-model-quant.bin");
Translator translator(argv[1]);
for (;;) {
std::string language;
std::cout << "Language: " << std::flush;