(self, context, context_length)
| 133 | return contexts |
| 134 | |
| 135 | def encode_and_trim(self, context, context_length): |
| 136 | tokens = self.enc.encode(context) |
| 137 | if len(tokens) > context_length: |
| 138 | context = self.enc.decode(tokens[:context_length]) |
| 139 | return context |
| 140 | |
| 141 | def create_contexts(self, needle_rnd_number, insert_needle, random_city, trim_context, context_length, depth_percent, seed): |
| 142 | if self.save_results: |