Skip to content

Commit

Permalink
update core interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Sep 11, 2021
1 parent bf87e7d commit 24dd6bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions example/python/core.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ from libcpp cimport bool
cdef extern from "core.h":
bool c_initialize "initialize" (
char *root_dir_path,
char* yukarin_s_forwarder_path,
char* yukarin_sa_forwarder_path,
char* decode_forwarder_path,
bool use_gpu
)

const char *c_metas "metas" ()

bool c_yukarin_s_forward "yukarin_s_forward" (
int length,
long *phoneme_list,
Expand Down
13 changes: 5 additions & 8 deletions example/python/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ from libcpp cimport bool

cpdef initialize(
str root_dir_path,
str yukarin_s_forwarder_path,
str yukarin_sa_forwarder_path,
str decode_forwarder_path,
bool use_gpu
bool use_gpu,
):
cdef bool success = c_initialize(
root_dir_path.encode(),
yukarin_s_forwarder_path.encode(),
yukarin_sa_forwarder_path.encode(),
decode_forwarder_path.encode(),
use_gpu
use_gpu,
)
assert success

cpdef metas():
return c_metas().decode()

cpdef numpy.ndarray[numpy.float32_t, ndim=1] yukarin_s_forward(
int length,
numpy.ndarray[numpy.int64_t, ndim=1] phoneme_list,
Expand Down

0 comments on commit 24dd6bc

Please sign in to comment.