bluenevus commited on
Commit
717943b
·
verified ·
1 Parent(s): 5199415

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -173,11 +173,11 @@ def remove_file(n_clicks, existing_files):
173
  raise PreventUpdate
174
 
175
  triggered_id = ctx.triggered[0]['prop_id']
176
- removed_file = json.loads(triggered_id.split('.')[0])['index']
177
 
178
  uploaded_files.pop(removed_file, None)
179
  return [file for file in existing_files if file['props']['children'][1]['children'] != removed_file]
180
-
181
  def generate_matrix_with_gpt(matrix_type, file_contents):
182
  prompt = f"""Generate a {matrix_type} based on the following project artifacts:
183
  {' '.join(file_contents)}
 
173
  raise PreventUpdate
174
 
175
  triggered_id = ctx.triggered[0]['prop_id']
176
+ removed_file = triggered_id.split('"index":')[1].split('}')[0].strip('"')
177
 
178
  uploaded_files.pop(removed_file, None)
179
  return [file for file in existing_files if file['props']['children'][1]['children'] != removed_file]
180
+
181
  def generate_matrix_with_gpt(matrix_type, file_contents):
182
  prompt = f"""Generate a {matrix_type} based on the following project artifacts:
183
  {' '.join(file_contents)}