Spaces:
Configuration error
Configuration error
Update crew.py
Browse files
crew.py
CHANGED
|
@@ -357,12 +357,12 @@ def run_crew(question, file_path):
|
|
| 357 |
# Process
|
| 358 |
|
| 359 |
if file_path:
|
| 360 |
-
|
| 361 |
|
| 362 |
-
if
|
| 363 |
-
question = f"{question} File
|
| 364 |
else:
|
| 365 |
-
question = f"{question} File
|
| 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))
|