Update app.py
Browse files
app.py
CHANGED
|
@@ -201,10 +201,13 @@ def generate_matrix(*args):
|
|
| 201 |
|
| 202 |
file_contents = list(uploaded_files.values())
|
| 203 |
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
|
|
|
|
|
|
|
|
|
| 208 |
@app.callback(
|
| 209 |
Output('chat-output', 'children'),
|
| 210 |
Output('matrix-preview', 'children', allow_duplicate=True),
|
|
|
|
| 201 |
|
| 202 |
file_contents = list(uploaded_files.values())
|
| 203 |
|
| 204 |
+
try:
|
| 205 |
+
current_matrix = generate_matrix_with_gpt(matrix_type, file_contents)
|
| 206 |
+
return dbc.Table.from_dataframe(current_matrix, striped=True, bordered=True, hover=True), f"{matrix_type} generated"
|
| 207 |
+
except Exception as e:
|
| 208 |
+
print(f"Error generating matrix: {str(e)}")
|
| 209 |
+
return html.Div(f"Error generating matrix: {str(e)}"), "Error"
|
| 210 |
+
|
| 211 |
@app.callback(
|
| 212 |
Output('chat-output', 'children'),
|
| 213 |
Output('matrix-preview', 'children', allow_duplicate=True),
|