microsoft / LMOps

General technology for enabling AI capabilities w/ LLMs and MLLMs
https://aka.ms/GeneralAI
MIT License
3.56k stars 268 forks source link

[llm_retriever] It seems wrong in inference/gen_llm_score.py #260

Open zhouchang123 opened 1 week ago

zhouchang123 commented 1 week ago

from line 107 to 111

start_idx = 0 for i, doc_ids in enumerate(examples['doc_ids']): end_idx = start_idx + len(doc_ids) examples['doc_scores'][i] = llm_scores[start_idx:end_idx] start_idx = end_idx

In the line ,why could use llm_scores[start_idx:end_idx] to substitude example['doc_scores'][i] ? example['doc_scores'][i] means i_th doc_scores,is one value and llm_scores[start_idx:end_idx] are len(doc_ids) values; image

zhouchang123 commented 1 week ago

In method _map_func in llm_retriever/src/inference/gen_llm_scores.py from line 115 to 131: what's examples['doc_scores'][i][j]? examples['doc_scores'][i] is the score of each doc_id,so the j means what? image