Skip to content

Commit

Permalink
chore: removed unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
aaa006bd committed Sep 8, 2023
1 parent dabba51 commit c4d8bf9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ai/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def ask(repo_id: int, chat_id: str, question: str):
db = FAISS.load_local(os.path.join(repo_path, "vector_store"), embeddings)

retriever = db.as_retriever()
end = time.time()

retriever.search_kwargs["distance_metric"] = "cos"
retriever.search_kwargs["fetch_k"] = 100
Expand All @@ -58,12 +57,10 @@ def ask(repo_id: int, chat_id: str, question: str):
retriever=retriever,
return_source_documents=True,
)
end = time.time()

result = qa(question)
print(f"Answer: {result['answer']}")
print(f"Sources: {[x.metadata['source'] for x in result['source_documents']]}")
end = time.time()

return result["answer"], [x.metadata["source"] for x in result["source_documents"]]

Expand Down

0 comments on commit c4d8bf9

Please sign in to comment.