MCPcopy Create free account
hub / github.com/ai4colonoscopy/IntelliScope / preprocess

Function preprocess

colongpt/util/data_utils.py:250–259  ·  view source on GitHub ↗
(
        sources: Sequence[str],
        tokenizer: transformers.PreTrainedTokenizer,
        has_image: bool = False
)

Source from the content-addressed store, hash-verified

248
249
250def preprocess(
251 sources: Sequence[str],
252 tokenizer: transformers.PreTrainedTokenizer,
253 has_image: bool = False
254) -> Dict:
255 if conversation_lib.default_conversation.sep_style == conversation_lib.SeparatorStyle.PLAIN:
256 return preprocess_plain(sources, tokenizer)
257
258 if conversation_lib.default_conversation.version == "colongpt":
259 return preprocess_colongpt(sources, tokenizer, has_image=has_image)
260
261
262class LazySupervisedDataset(Dataset):

Callers 1

__getitem__Method · 0.85

Calls 2

preprocess_plainFunction · 0.85
preprocess_colongptFunction · 0.85

Tested by

no test coverage detected