Spaces:
Sleeping
Sleeping
UPDATE: YT Transcripts
Browse files
app.py
CHANGED
@@ -168,10 +168,14 @@ async def analyzeAndAnswer(query: str, file: UploadFile = File(...)):
|
|
168 |
extension = file.name.split(".")[-1]
|
169 |
if extension in ["xls", "xlsx", "xlsm", "xlsb"]:
|
170 |
df = pd.read_excel(io.BytesIO(file.read()))
|
171 |
-
return
|
|
|
|
|
172 |
elif extension == "csv":
|
173 |
df = pd.read_csv(io.BytesIO(file.read()))
|
174 |
-
return
|
|
|
|
|
175 |
else:
|
176 |
return {
|
177 |
"output": "INVALID FILE TYPE"
|
|
|
168 |
extension = file.name.split(".")[-1]
|
169 |
if extension in ["xls", "xlsx", "xlsm", "xlsb"]:
|
170 |
df = pd.read_excel(io.BytesIO(file.read()))
|
171 |
+
return {
|
172 |
+
"output": analyzeData(query = query, dataframe = df)
|
173 |
+
}
|
174 |
elif extension == "csv":
|
175 |
df = pd.read_csv(io.BytesIO(file.read()))
|
176 |
+
return {
|
177 |
+
"output": analyzeData(query = query, dataframe = df)
|
178 |
+
}
|
179 |
else:
|
180 |
return {
|
181 |
"output": "INVALID FILE TYPE"
|