Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit ac9711a

Browse files
authored
Fix type conversion from py::object to STL container (#1887)
1 parent 014f355 commit ac9711a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchtext/csrc/vocab_factory.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#include <pybind11/pybind11.h>
2+
#include <pybind11/stl.h>
23
#include <torchtext/csrc/vocab.h> // @manual
34

45
namespace py = pybind11;
56

67
namespace torchtext {
78

8-
Vocab _build_vocab_from_text_file_using_python_tokenizer(
9+
TORCHTEXT_API Vocab _build_vocab_from_text_file_using_python_tokenizer(
910
const std::string& file_path,
1011
const int64_t min_freq,
1112
py::object tokenizer);
@@ -14,6 +15,7 @@ TORCHTEXT_API Vocab _load_vocab_from_file(
1415
const std::string& file_path,
1516
const int64_t min_freq,
1617
const int64_t num_cpus);
18+
1719
TORCHTEXT_API Vocab _build_vocab_from_text_file(
1820
const std::string& file_path,
1921
const int64_t min_freq,

0 commit comments

Comments
 (0)