Update utils.py
Browse files
utils.py
CHANGED
@@ -330,11 +330,11 @@ def grade_documents_direct(prompt, documents):
|
|
330 |
filtered_docs = []
|
331 |
|
332 |
for d in documents:
|
333 |
-
|
|
|
334 |
print("hier1..................................")
|
335 |
-
|
336 |
-
|
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:
|