Skip to content

Commit

Permalink
Added Ctranslate2-lib and Ctranslate2-python. Fixes chaquo#1239.
Browse files Browse the repository at this point in the history
  • Loading branch information
aryansharma authored and aryansharma committed Sep 28, 2024
1 parent 1b2fed5 commit 6c5d3a7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/pypi/packages/ctranslate2-lib/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Set up the build directory
mkdir -p build
cd build

cmake .. -DCMAKE_INSTALL_PREFIX=$CHAQUOPY_LIB/ctranslate2-lib \
-DCMAKE_LIBRARY_PATH=/home/aryan/llvm-project/openmp/runtime/src/libiomp5.so

# Compile the C++ library
make -j4
sudo make install
sudo ldconfig
14 changes: 14 additions & 0 deletions server/pypi/packages/ctranslate2-lib/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package:
name: "ctranslate2-lib"
version: "4.1.0"

source:
git_url: https://github.com/OpenNMT/CTranslate2.git
git_rev: v4.1.0 # Use the correct version tag

build:
number: 0

requirements:
build:
- cmake 3.30.2
8 changes: 8 additions & 0 deletions server/pypi/packages/ctranslate2-python/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Set the path to the C++ library
export CTRANSLATE2_ROOT=$CHAQUOPY_LIB/ctranslate2-lib

pip install -r install_requirements.txt
python setup.py bdist_wheel
pip install dist/*.whl
17 changes: 17 additions & 0 deletions server/pypi/packages/ctranslate2-python/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package:
name: "ctranslate2-python"
version: "4.1.0"

source:
path: /home/aryan/CTranslate2/python

build:
number: 0


requirements:
build:
- pybind11 2.11.1
host:
- ctranslate2-lib 4.1.0 # Add dependency on the C++ library

0 comments on commit 6c5d3a7

Please sign in to comment.