MCPcopy
hub / github.com/XPixelGroup/DiffBIR / get_tokenize_len

Function get_tokenize_len

llava/train/train.py:637–638  ·  view source on GitHub ↗
(prompts)

Source from the content-addressed store, hash-verified

635 conversations.append(conversation)
636 # tokenize conversations
637 def get_tokenize_len(prompts):
638 return [len(tokenizer_image_token(prompt, tokenizer)) for prompt in prompts]
639
640 if has_image:
641 input_ids = [tokenizer_image_token(prompt, tokenizer, return_tensors='pt') for prompt in conversations]

Callers 1

preprocessFunction · 0.85

Calls 1

tokenizer_image_tokenFunction · 0.90

Tested by

no test coverage detected