Skip to content

Consolidate TokenIndex definition #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
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
5 changes: 0 additions & 5 deletions include/pytorch/tokenizers/llama2c_tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@

namespace tokenizers {

struct TokenIndex {
const char* str;
int32_t id;
};

// A simple Byte Pair Encoding (BPE) Tokenizer. Note that the current C++ code
// won't work with this class, it needs to go through tokenizer.py first.
class Llama2cTokenizer : public Tokenizer {
Expand Down
5 changes: 0 additions & 5 deletions include/pytorch/tokenizers/sentencepiece.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
#include "sentencepiece_processor.h"
namespace tokenizers {

struct TokenIndex {
const char* str;
int32_t id;
};

class SPTokenizer : public Tokenizer {
public:
explicit SPTokenizer();
Expand Down
5 changes: 5 additions & 0 deletions include/pytorch/tokenizers/tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

namespace tokenizers {

struct TokenIndex {
const char* str;
int32_t id;
};

class Tokenizer {
public:
explicit Tokenizer() {}
Expand Down