(prompts, batch_size=1)
| 124 | return None |
| 125 | |
| 126 | def 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 | |
| 138 | def resize_prompt(tokenizer, model_max_context, prompt): |
| 139 |