(prompts, batch_size=1)
| 114 | return None |
| 115 | |
| 116 | def 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 | |
| 128 | def resize_prompt(tokenizer, model_max_context, prompt): |
| 129 |