google / sentencepiece

Unsupervised text tokenizer for Neural Network-based text generation.
Apache License 2.0
10.23k stars 1.17k forks source link

trainer_interface.cc: Integer value -1 is outside the valid range of values [0, 255] for the enumeration type 'ScriptType' #1028

Open kcoul opened 4 months ago

kcoul commented 4 months ago

When building with C++ '20. Error due to default of "-1" on L221-222

  constexpr unicode_script::ScriptType kAnyType =
      static_cast<unicode_script::ScriptType>(-1);
kcoul commented 4 months ago

Temporary workaround for anyone facing the same issue:

Add to CMakeLists.txt set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion" )