pavansuresh commited on
Commit
a57929a
·
verified ·
1 Parent(s): 38c0370

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -177,13 +177,12 @@ with gr.Blocks(title="Smart Contract Migrator (Local Mode)") as demo:
177
  status, ai_result, updated_records, progress = process_contract(files, obj_name, manual_mappings_dict)
178
  global failed_records
179
  failed_records = updated_records
180
- upload_progress.update(value=progress)
181
- return status, ai_result if ai_result else {}
182
 
183
  process_button.click(
184
  fn=process_and_display,
185
  inputs=[uploaded_files, object_name] + [comp for comp in manual_mapping_inputs.value.values()],
186
- outputs=[status_output, ai_result_output]
187
  )
188
 
189
  # EPIC 6: Reconciliation & Retry
@@ -202,8 +201,7 @@ with gr.Blocks(title="Smart Contract Migrator (Local Mode)") as demo:
202
  result, updated_records, progress = retry_failed_record(int(index), obj_name, manual_mappings_dict)
203
  global failed_records
204
  failed_records = updated_records
205
- upload_progress.update(value=progress)
206
- return result, update_reconciliation()
207
 
208
  retry_index = gr.Number(label="Select Failed Record Index", interactive=False)
209
  retry_manual_inputs = gr.State(value={field: gr.Textbox(label=f"{field} (Retry)", interactive=True, value="") for field in manual_mapping_inputs.value.keys()})
@@ -213,7 +211,7 @@ with gr.Blocks(title="Smart Contract Migrator (Local Mode)") as demo:
213
  retry_button.click(
214
  fn=retry_and_update,
215
  inputs=[retry_index, object_name] + [comp for comp in retry_manual_inputs.value.values()],
216
- outputs=[retry_status, failed_records_output]
217
  )
218
 
219
  demo.launch()
 
177
  status, ai_result, updated_records, progress = process_contract(files, obj_name, manual_mappings_dict)
178
  global failed_records
179
  failed_records = updated_records
180
+ return status, ai_result if ai_result else {}, gr.update(value=progress)
 
181
 
182
  process_button.click(
183
  fn=process_and_display,
184
  inputs=[uploaded_files, object_name] + [comp for comp in manual_mapping_inputs.value.values()],
185
+ outputs=[status_output, ai_result_output, upload_progress]
186
  )
187
 
188
  # EPIC 6: Reconciliation & Retry
 
201
  result, updated_records, progress = retry_failed_record(int(index), obj_name, manual_mappings_dict)
202
  global failed_records
203
  failed_records = updated_records
204
+ return result, update_reconciliation(), gr.update(value=progress)
 
205
 
206
  retry_index = gr.Number(label="Select Failed Record Index", interactive=False)
207
  retry_manual_inputs = gr.State(value={field: gr.Textbox(label=f"{field} (Retry)", interactive=True, value="") for field in manual_mapping_inputs.value.keys()})
 
211
  retry_button.click(
212
  fn=retry_and_update,
213
  inputs=[retry_index, object_name] + [comp for comp in retry_manual_inputs.value.values()],
214
+ outputs=[retry_status, failed_records_output, upload_progress]
215
  )
216
 
217
  demo.launch()