Skip to content
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

Tokenizer in different code version #125

Open
countytown opened this issue Mar 8, 2024 · 0 comments
Open

Tokenizer in different code version #125

countytown opened this issue Mar 8, 2024 · 0 comments

Comments

@countytown
Copy link

Hi~ Thanks a lot for the new version code which have made the framework much easier to understand. But I noticed that some details have also changed, e.g., the tokenizer part:

old version:

def tokenizer_X_token(prompt, tokenizer, X_token_index, return_tensors=None):
    prompt_chunks = [tokenizer(chunk).input_ids for chunk in prompt.split(f'<{X_INDEX_TOKEN[X_token_index].lower()}>')]
    ...

new version:

def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOKEN_INDEX, return_tensors=None):
    prompt_chunks = [tokenizer(chunk).input_ids for chunk in prompt.split('<image>')]
    ...

Should I worry about any performance degradation? Since

  1. it looks like the video and image are treated as the same?
  2. the original training samples include symbols like <image>\n and \n<video>?

In fact, I am trying to finetune with new modals like audio and depth, so is there any confict with current version (besides the languabind part)?

Thank you so much~☺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant