MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / get_original

Method get_original

lm-eval-harness/lm_eval/utils.py:195–214  ·  view source on GitHub ↗

Restores the original order of a new array based on the old array's order Args: newarr (List[Any]): The array to be restored Returns: List[Any]: The array restored to the original order

(self, newarr)

Source from the content-addressed store, hash-verified

193 return [x[1] for x in self.arr]
194
195 def get_original(self, newarr):
196 """Restores the original order of a new array based on the old array's order
197
198 Args:
199 newarr (List[Any]): The array to be restored
200
201 Returns:
202 List[Any]: The array restored to the original order
203 """
204 res = [None] * self.size
205 cov = [False] * self.size
206
207 for (inds, _), v in zip(self.arr, newarr):
208 for ind in inds:
209 res[ind] = v
210 cov[ind] = True
211
212 assert all(cov)
213
214 return res
215
216
217def make_table(result_dict, column: str = "results"):

Callers 3

_loglikelihood_tokensMethod · 0.95
_loglikelihood_tokensMethod · 0.95
generate_untilMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected