Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/normalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Normalizer::Ptr NormalizerConfig::create() const {
return Normalizer::Ptr(new ReplaceNormalizer(*pattern, *content));
}
if (type == "Sequence") {
if (!normalizers or normalizers->empty()) {
if (!normalizers || normalizers->empty()) {
throw std::runtime_error(
"Missing normalizers for Normalizer of type Sequence");
}
Expand Down
8 changes: 7 additions & 1 deletion src/pre_tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@

// Standard
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <iterator>
#include <memory>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>

// Third Party
#include <nlohmann/json.hpp>
Expand Down Expand Up @@ -78,7 +84,7 @@ PreTokenizer::Ptr PreTokenizerConfig::create() const {
return PreTokenizer::Ptr(new ByteLevelPreTokenizer());
}
if (type == "Sequence") {
if (!pretokenizers or pretokenizers->empty()) {
if (!pretokenizers || pretokenizers->empty()) {
throw std::runtime_error(
"Missing pretokenizers for PreTokenizer of type Sequence");
}
Expand Down