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

Function batch_data

light-eval/src/eval_math.py:107–117  ·  view source on GitHub ↗
(prompts, batch_size=1)

Source from the content-addressed store, hash-verified

105 return None
106
107def batch_data(prompts, batch_size=1):
108 batch_data = []
109 mini_batch = []
110 for prompt in prompts:
111 mini_batch.append(prompt)
112 if len(mini_batch) == batch_size:
113 batch_data.append(mini_batch)
114 mini_batch = []
115 if len(mini_batch) != 0:
116 batch_data.append(mini_batch)
117 return batch_data
118
119def resize_prompt(tokenizer, model_max_context, prompt):
120

Callers 1

run_inferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected