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

Function batch_data

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

Source from the content-addressed store, hash-verified

124 return None
125
126def batch_data(prompts, batch_size=1):
127 batch_data = []
128 mini_batch = []
129 for prompt in prompts:
130 mini_batch.append(prompt)
131 if len(mini_batch) == batch_size:
132 batch_data.append(mini_batch)
133 mini_batch = []
134 if len(mini_batch) != 0:
135 batch_data.append(mini_batch)
136 return batch_data
137
138def resize_prompt(tokenizer, model_max_context, prompt):
139

Callers 1

run_inferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected