Skip to content

Commit

Permalink
msvc test6: try claude
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonwin committed Apr 11, 2024
1 parent e4b14c5 commit a8f447d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tiktoken.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,18 @@ class tiktoken {

if (allowed_special.count(special) == 1) {
#if ! defined(_WIN32)
// return { std::move(special), re2::StringPiece(start, input.begin() - start - special.size()) };
return { std::move(special), re2::StringPiece(reinterpret_cast<const char*>(start), input.begin() - start - special.size()) };
return { std::move(special), re2::StringPiece(start, input.begin() - start - special.size()) };
// return { special, re2::StringPiece(start, input.begin() - start - special.size()) };

#else
// build but not work correctly
// return { std::move(special), re2::StringPiece(input.data(), input.begin() - start - special.size()) };

// can work on linux, but msvc?
// return { std::move(special), re2::StringPiece(reinterpret_cast<const char*>(start), input.begin() - start - special.size()) };
// return { std::move(special), re2::StringPiece(reinterpret_cast<const char*>(start), static_cast<size_t>(input.begin() - start - special.size())) };
return { std::move(special), re2::StringPiece(start, std::distance(start, input.begin()) - special.size()) };
// return { special, re2::StringPiece(start, input.begin() - start - special.size()) };
return { special, re2::StringPiece(start, input.begin() - start - special.size()) };
#endif
}
}
Expand Down

0 comments on commit a8f447d

Please sign in to comment.