Spaces:
Sleeping
Sleeping
Update ai_agent.py
Browse files- ai_agent.py +2 -2
ai_agent.py
CHANGED
@@ -33,8 +33,8 @@ def pandas_agent(file, agent_input):
|
|
33 |
# Check if the file extension is CSV
|
34 |
if file.endswith('.csv'):
|
35 |
df = pd.read_csv(file)
|
36 |
-
# Check if the file extension is
|
37 |
-
elif file.endswith('.
|
38 |
df = pd.read_excel(file)
|
39 |
else:
|
40 |
return "Unsupported file format. Only CSV, XLS, or XLSX files are supported."
|
|
|
33 |
# Check if the file extension is CSV
|
34 |
if file.endswith('.csv'):
|
35 |
df = pd.read_csv(file)
|
36 |
+
# Check if the file extension is XLSX or XLS
|
37 |
+
elif file.endswith('.xlsx') or file.endswith('.xls'):
|
38 |
df = pd.read_excel(file)
|
39 |
else:
|
40 |
return "Unsupported file format. Only CSV, XLS, or XLSX files are supported."
|