MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / _preprocess_caption

Method _preprocess_caption

accessory/data/alpaca.py:232–243  ·  view source on GitHub ↗
(meta_l: List[Dict])

Source from the content-addressed store, hash-verified

230
231 @ staticmethod
232 def _preprocess_caption(meta_l: List[Dict]):
233 new_meta = []
234 for data_item in meta_l:
235 caption = data_item['caption']
236 if isinstance(caption, list):
237 caption = random.choice(caption)
238 new_meta.append({
239 "image": data_item['url'],
240 "output": caption
241 })
242
243 return new_meta
244
245
246class FinetuneDistSampler(Sampler):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected