bstraehle commited on
Commit
2fdd9dc
·
verified ·
1 Parent(s): de1b991

Update crew.py

Browse files
Files changed (1) hide show
  1. crew.py +4 -4
crew.py CHANGED
@@ -357,12 +357,12 @@ def run_crew(question, file_path):
357
  # Process
358
 
359
  if file_path:
360
- df = read_file(file_path)
361
 
362
- if df.empty:
363
- question = f"{question} File path: {file_path}."
364
  else:
365
- question = f"{question} File data: {df.to_string()}" # sandbox contraints
366
 
367
  initial_answer = crew.kickoff(inputs={"question": question})
368
  final_answer = get_final_answer(FINAL_ANSWER_MODEL, question, str(initial_answer))
 
357
  # Process
358
 
359
  if file_path:
360
+ file_data = read_file(file_path)
361
 
362
+ if file_data:
363
+ question = f"{question} File data: {file_data}" # sandbox contraints
364
  else:
365
+ question = f"{question} File path: {file_path}."
366
 
367
  initial_answer = crew.kickoff(inputs={"question": question})
368
  final_answer = get_final_answer(FINAL_ANSWER_MODEL, question, str(initial_answer))