From 7e89e79867759b86c36e69ec8a74d9057f7f4b44 Mon Sep 17 00:00:00 2001 From: Nayef Ahmed Date: Tue, 30 Aug 2022 01:01:58 -0400 Subject: [PATCH] Fix type conversion from py::object to STL container --- torchtext/csrc/vocab_factory.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/torchtext/csrc/vocab_factory.h b/torchtext/csrc/vocab_factory.h index a23a8264a5..f512b5ecff 100644 --- a/torchtext/csrc/vocab_factory.h +++ b/torchtext/csrc/vocab_factory.h @@ -1,11 +1,12 @@ #include +#include #include // @manual namespace py = pybind11; namespace torchtext { -Vocab _build_vocab_from_text_file_using_python_tokenizer( +TORCHTEXT_API Vocab _build_vocab_from_text_file_using_python_tokenizer( const std::string& file_path, const int64_t min_freq, py::object tokenizer); @@ -14,6 +15,7 @@ TORCHTEXT_API Vocab _load_vocab_from_file( const std::string& file_path, const int64_t min_freq, const int64_t num_cpus); + TORCHTEXT_API Vocab _build_vocab_from_text_file( const std::string& file_path, const int64_t min_freq,