Abnawax commited on
Commit
9402b65
1 Parent(s): ecc03d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -43,13 +43,14 @@ def calculate_power_factor_correction(load_kw, pf_initial, pf_target):
43
 
44
  plt.tight_layout()
45
  plt.savefig("power_factor_correction.png")
 
46
 
47
  return (f"Required Capacitor Size: {capacitor_size:.2f} kVAR",
48
  f"Corrected Power Factor: {pf_corrected:.2f}",
49
- gr.Image.update(value="power_factor_correction.png"))
50
 
51
  except Exception as e:
52
- return str(e), "", None
53
 
54
  # Create Gradio interface
55
  def power_factor_correction_ui(load_kw, pf_initial, pf_target):
 
43
 
44
  plt.tight_layout()
45
  plt.savefig("power_factor_correction.png")
46
+ plt.close(fig)
47
 
48
  return (f"Required Capacitor Size: {capacitor_size:.2f} kVAR",
49
  f"Corrected Power Factor: {pf_corrected:.2f}",
50
+ "power_factor_correction.png")
51
 
52
  except Exception as e:
53
+ return str(e), "", ""
54
 
55
  # Create Gradio interface
56
  def power_factor_correction_ui(load_kw, pf_initial, pf_target):