Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -4,7 +4,7 @@ import io
|
|
| 4 |
import tempfile
|
| 5 |
import torch
|
| 6 |
# FOR CPU only mode
|
| 7 |
-
#torch._dynamo.config.suppress_errors = True
|
| 8 |
# Or disable compilation entirely
|
| 9 |
# torch.backends.cudnn.enabled = False
|
| 10 |
import numpy as np
|
|
@@ -1560,7 +1560,7 @@ if atoms is not None:
|
|
| 1560 |
opt.attach(lambda: streamlit_log(opt), interval=1)
|
| 1561 |
|
| 1562 |
st.write(f"Running {task.lower()}...")
|
| 1563 |
-
opt.run(fmax=fmax, steps=max_steps)
|
| 1564 |
|
| 1565 |
energy = calc_atoms.get_potential_energy()
|
| 1566 |
forces = calc_atoms.get_forces()
|
|
@@ -1569,7 +1569,7 @@ if atoms is not None:
|
|
| 1569 |
results["Final Energy"] = f"{energy:.6f} eV"
|
| 1570 |
results["Final Maximum Force"] = f"{max_force:.6f} eV/Å"
|
| 1571 |
results["Steps Taken"] = opt.get_number_of_steps()
|
| 1572 |
-
results["Converged"] = "Yes" if
|
| 1573 |
if task == "Cell + Geometry Optimization":
|
| 1574 |
results["Final Cell Parameters"] = np.round(calc_atoms.cell.cellpar(), 4).tolist()
|
| 1575 |
|
|
|
|
| 4 |
import tempfile
|
| 5 |
import torch
|
| 6 |
# FOR CPU only mode
|
| 7 |
+
# torch._dynamo.config.suppress_errors = True
|
| 8 |
# Or disable compilation entirely
|
| 9 |
# torch.backends.cudnn.enabled = False
|
| 10 |
import numpy as np
|
|
|
|
| 1560 |
opt.attach(lambda: streamlit_log(opt), interval=1)
|
| 1561 |
|
| 1562 |
st.write(f"Running {task.lower()}...")
|
| 1563 |
+
is_converged = opt.run(fmax=fmax, steps=max_steps)
|
| 1564 |
|
| 1565 |
energy = calc_atoms.get_potential_energy()
|
| 1566 |
forces = calc_atoms.get_forces()
|
|
|
|
| 1569 |
results["Final Energy"] = f"{energy:.6f} eV"
|
| 1570 |
results["Final Maximum Force"] = f"{max_force:.6f} eV/Å"
|
| 1571 |
results["Steps Taken"] = opt.get_number_of_steps()
|
| 1572 |
+
results["Converged"] = "Yes" if is_converged else "No"
|
| 1573 |
if task == "Cell + Geometry Optimization":
|
| 1574 |
results["Final Cell Parameters"] = np.round(calc_atoms.cell.cellpar(), 4).tolist()
|
| 1575 |
|