zeerd commited on
Commit
3db2c83
·
verified ·
1 Parent(s): 844faae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -32,7 +32,7 @@ except Exception as e:
32
  def answer_question(question):
33
  try:
34
  question_embedding = embeddings.embed_query(question)
35
- question_embedding_np = "\n".join(question_embedding)
36
  docs_and_scores = db.similarity_search_with_score(question_embedding_np)
37
  # 正确处理 docs_and_scores 列表
38
  context = "\n".join([doc.page_content for doc, _ in docs_and_scores]) # 使用 join() 方法
 
32
  def answer_question(question):
33
  try:
34
  question_embedding = embeddings.embed_query(question)
35
+ question_embedding_np = "\n".join(map(str, question_embedding))
36
  docs_and_scores = db.similarity_search_with_score(question_embedding_np)
37
  # 正确处理 docs_and_scores 列表
38
  context = "\n".join([doc.page_content for doc, _ in docs_and_scores]) # 使用 join() 方法