mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-09-11 05:35:33 +03:00
Imports python bindings and associated sources incubated in https://github.com/jerinphilip/lemonade to bergamot-translator. Adds a pybind11 dependency for python bindings. Following the import, the python build is integrated into the existing CMake based build system here. There is a command-line application provided through python which provides the ability to fetch and prepare models from model-repositories (like browsermt/students or OPUS). Wheels built for a few common operating systems are provided via GitHub releases through automated actions configured to run at tagged semantic versions and pushes to main. The documentation for python is also integrated into our existing documentation setup. Previous documentation GitHub action is now configured to run behind python builds in Ubuntu 18.04 Python3.7, in order to pick up the packaged as a wheel bergamot module and the sphinx documentation using the python module. Formatting checks of black, isort with profile black and a pytype type checker is configured for the python component residing in this repository.
30 lines
1.2 KiB
CMake
30 lines
1.2 KiB
CMake
# marian-dev is tested elsewhere in both paths, turning off here.
|
|
set(COMPILE_TESTS OFF)
|
|
add_subdirectory(marian-dev EXCLUDE_FROM_ALL)
|
|
|
|
if(COMPILE_WASM)
|
|
# This is a bad way of adding compilation flags. Will be improved soon.
|
|
add_compile_options(${WASM_COMPILE_FLAGS})
|
|
endif(COMPILE_WASM)
|
|
|
|
add_subdirectory(ssplit-cpp EXCLUDE_FROM_ALL)
|
|
|
|
# Add include directories for 3rd party targets to be able to use it anywhere in the
|
|
# project without explicitly specifying their include directories. Once they
|
|
# fixe this problem, it can be removed.
|
|
get_property(INCDIRS DIRECTORY marian-dev/src PROPERTY INCLUDE_DIRECTORIES)
|
|
target_include_directories(marian PUBLIC ${INCDIRS})
|
|
|
|
get_property(INCLUDE_DIRECTORIES DIRECTORY ssplit-cpp/src PROPERTY INCLUDE_DIRECTORIES)
|
|
target_include_directories(ssplit PUBLIC ${INCLUDE_DIRECTORIES})
|
|
|
|
# Compilation flags
|
|
get_directory_property(CMAKE_C_FLAGS DIRECTORY marian-dev DEFINITION CMAKE_C_FLAGS)
|
|
get_directory_property(CMAKE_CXX_FLAGS DIRECTORY marian-dev DEFINITION CMAKE_CXX_FLAGS)
|
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} PARENT_SCOPE)
|
|
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
|
|
|
|
if(COMPILE_PYTHON)
|
|
add_subdirectory(pybind11)
|
|
endif(COMPILE_PYTHON)
|