bstraehle commited on
Commit
b7de1a2
·
verified ·
1 Parent(s): 5fa0d18

Update crew.py

Browse files
Files changed (1) hide show
  1. crew.py +5 -5
crew.py CHANGED
@@ -421,16 +421,16 @@ def run_crew(question, file_path):
421
  if file_path:
422
  if is_ext(file_path, ".csv") or is_ext(file_path, ".xls") or is_ext(file_path, ".xlsx") or is_ext(file_path, ".json") or is_ext(file_path, ".jsonl"):
423
  json_data = read_file_json(file_path)
424
- final_question = f"{question}\nJSON data:\n{json_data}."
425
  else:
426
- final_question = f"{question}\nFile path:\n{file_path}."
427
 
428
- initial_answer = crew.kickoff(inputs={"question": final_question})
429
- final_answer = get_final_answer(FINAL_ANSWER_MODEL, initial_question, str(initial_answer))
430
 
431
  print(f"=> Initial question: {question}")
432
  print(f"=> Final question: {final_question}")
433
- print(f"=> Initial answer: {initial_answer}")
434
  print(f"=> Final answer: {final_answer}")
435
 
436
  return final_answer
 
421
  if file_path:
422
  if is_ext(file_path, ".csv") or is_ext(file_path, ".xls") or is_ext(file_path, ".xlsx") or is_ext(file_path, ".json") or is_ext(file_path, ".jsonl"):
423
  json_data = read_file_json(file_path)
424
+ final_question = f"{question} JSON data:\n{json_data}."
425
  else:
426
+ final_question = f"{question} File path: {file_path}."
427
 
428
+ answer = crew.kickoff(inputs={"question": final_question})
429
+ final_answer = get_final_answer(FINAL_ANSWER_MODEL, question, str(answer))
430
 
431
  print(f"=> Initial question: {question}")
432
  print(f"=> Final question: {final_question}")
433
+ print(f"=> Initial answer: {answer}")
434
  print(f"=> Final answer: {final_answer}")
435
 
436
  return final_answer