chore: skip unnecessary key checks prior to accessing a dictionary (#4497)
This commit is contained in:
parent
aa13d14019
commit
04ad46dd31
30 changed files with 45 additions and 44 deletions
|
|
@ -124,7 +124,7 @@ class DatasetRetrieval:
|
|||
|
||||
document_score_list = {}
|
||||
for item in all_documents:
|
||||
if 'score' in item.metadata and item.metadata['score']:
|
||||
if item.metadata.get('score'):
|
||||
document_score_list[item.metadata['doc_id']] = item.metadata['score']
|
||||
|
||||
document_context_list = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue