Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from ai_models import
|
| 3 |
-
from ansys_simulation import run_ansys_simulation
|
| 4 |
from visualization import generate_graph
|
| 5 |
import os
|
| 6 |
|
|
@@ -16,7 +17,7 @@ def ai_and_simulation_workflow(thickness, hole_diameter, force):
|
|
| 16 |
|
| 17 |
if pre_screen == 0:
|
| 18 |
return "AI predicts failure. Adjust parameters.", None
|
| 19 |
-
|
| 20 |
# ANSYS Simulation
|
| 21 |
try:
|
| 22 |
max_stress, max_deformation = run_ansys_simulation(thickness, hole_diameter, force)
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
import gradio as gr
|
| 3 |
+
from ai_models import load_models
|
| 4 |
+
from ansys_simulation import run_ansys_simulation # Import this function only once
|
| 5 |
from visualization import generate_graph
|
| 6 |
import os
|
| 7 |
|
|
|
|
| 17 |
|
| 18 |
if pre_screen == 0:
|
| 19 |
return "AI predicts failure. Adjust parameters.", None
|
| 20 |
+
|
| 21 |
# ANSYS Simulation
|
| 22 |
try:
|
| 23 |
max_stress, max_deformation = run_ansys_simulation(thickness, hole_diameter, force)
|