nightdessert / Retrieval_Head

open-source code for paper: Retrieval Head Mechanistically Explains Long-Context Factuality
https://arxiv.org/abs/2404.15574
156 stars 13 forks source link

some typing errors #1

Closed yonghongwu closed 6 months ago

yonghongwu commented 6 months ago
  1. with open('./head_score/llama-2-7b-80k.json') as file:
    head_list = json.loads(file.readline())
  2. head_score_list = [([int(ll) for ll in l[0].split("-")],np.mean(l[1])) for l in head_list.items()]
  3. top_retrieval_heads = [[l[0],  round(np.mean(l[1]), 2)] for l in head_score_list][:10]
nightdessert commented 6 months ago
with open('./head_score/llama-2-7b-80k.json') as file:
    head_list = json.loads(file.readline())
head_score_list = [([int(ll) for ll in l[0].split("-")],np.mean(l[1])) for l in head_list.items()]
top_retrieval_heads = [[l[0],  round(np.mean(l[1]), 2)] for l in head_score_list][:10]

Thanks for pointing out! I just modified these typos.