Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -145,16 +145,11 @@ def answer_question(prompt):
|
|
145 |
|
146 |
def process_inputs(llm, file, relevance, diversity, email):
|
147 |
if file is not None:
|
148 |
-
# Read questions from the uploaded file
|
149 |
try:
|
150 |
-
df = pd.
|
151 |
-
except
|
152 |
-
|
153 |
-
df = pd.read_csv(file.name, encoding='ISO-8859-1', header=None)
|
154 |
-
except Exception as e:
|
155 |
-
return f"Failed to read file: {e}"
|
156 |
-
except pd.errors.ParserError as e:
|
157 |
-
return f"Failed to parse CSV file: {e}"
|
158 |
|
159 |
# Ensure that there is only one column in the file
|
160 |
if df.shape[1] != 1:
|
|
|
145 |
|
146 |
def process_inputs(llm, file, relevance, diversity, email):
|
147 |
if file is not None:
|
148 |
+
# Read questions from the uploaded Excel file
|
149 |
try:
|
150 |
+
df = pd.read_excel(file.name)
|
151 |
+
except Exception as e:
|
152 |
+
return f"Failed to read Excel file: {e}"
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
# Ensure that there is only one column in the file
|
155 |
if df.shape[1] != 1:
|