alexkueck commited on
Commit
1ab9d49
1 Parent(s): 0fca2bc

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +4 -4
utils.py CHANGED
@@ -330,11 +330,11 @@ def grade_documents_direct(prompt, documents):
330
  filtered_docs = []
331
 
332
  for d in documents:
333
- score = chain.invoke({"question": prompt, "context": d.page_content})
 
334
  print("hier1..................................")
335
- grade = score[0].binary_score
336
- print("hier2..................................")
337
- if grade == "ja":
338
  print("---Bewertung: Dokument ist relevant---")
339
  filtered_docs.append(d)
340
  else:
 
330
  filtered_docs = []
331
 
332
  for d in documents:
333
+ llm_chain = LLMChain(llm = model, prompt = grade_prompt)
334
+ score = llm_chain.run({"question": prompt, "context": d.page_content}})
335
  print("hier1..................................")
336
+
337
+ if not score == "nein":
 
338
  print("---Bewertung: Dokument ist relevant---")
339
  filtered_docs.append(d)
340
  else: