bluenevus commited on
Commit
5fe7c14
·
verified ·
1 Parent(s): fec5de2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -201,10 +201,13 @@ def generate_matrix(*args):
201
 
202
  file_contents = list(uploaded_files.values())
203
 
204
- current_matrix = generate_matrix_with_gpt(matrix_type, file_contents)
205
-
206
- return dbc.Table.from_dataframe(current_matrix, striped=True, bordered=True, hover=True), f"{matrix_type} generated"
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),