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

Function batch_data

light-eval/src/eval_mmlu.py:116–126  ·  view source on GitHub ↗
(prompts, batch_size=1)

Source from the content-addressed store, hash-verified

114 return None
115
116def batch_data(prompts, batch_size=1):
117 batch_data = []
118 mini_batch = []
119 for prompt in prompts:
120 mini_batch.append(prompt)
121 if len(mini_batch) == batch_size:
122 batch_data.append(mini_batch)
123 mini_batch = []
124 if len(mini_batch) != 0:
125 batch_data.append(mini_batch)
126 return batch_data
127
128def resize_prompt(tokenizer, model_max_context, prompt):
129

Callers 1

run_inferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected