Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import cadquery as cq
|
| 3 |
from cadquery import exporters
|
|
@@ -5,9 +6,9 @@ import trimesh
|
|
| 5 |
import pyvista as pv
|
| 6 |
from io import BytesIO
|
| 7 |
import json
|
| 8 |
-
import os
|
| 9 |
import atexit
|
| 10 |
import glob
|
|
|
|
| 11 |
|
| 12 |
# Cleanup function to remove temporary files
|
| 13 |
def cleanup_temp_files():
|
|
@@ -128,15 +129,9 @@ def main():
|
|
| 128 |
inputs=[step_input, force_input, material_input],
|
| 129 |
outputs=[script_output, download_button]
|
| 130 |
)
|
| 131 |
-
|
| 132 |
-
app.launch(server_port=7861, debug=True)
|
| 133 |
-
|
| 134 |
-
import os
|
| 135 |
-
import gradio as gr
|
| 136 |
|
| 137 |
if __name__ == "__main__":
|
| 138 |
-
|
| 139 |
port = int(os.environ.get("GRADIO_SERVER_PORT", 7861)) # Default to 7861
|
| 140 |
app.launch(server_port=port, debug=True)
|
| 141 |
-
|
| 142 |
-
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
import cadquery as cq
|
| 4 |
from cadquery import exporters
|
|
|
|
| 6 |
import pyvista as pv
|
| 7 |
from io import BytesIO
|
| 8 |
import json
|
|
|
|
| 9 |
import atexit
|
| 10 |
import glob
|
| 11 |
+
import os
|
| 12 |
|
| 13 |
# Cleanup function to remove temporary files
|
| 14 |
def cleanup_temp_files():
|
|
|
|
| 129 |
inputs=[step_input, force_input, material_input],
|
| 130 |
outputs=[script_output, download_button]
|
| 131 |
)
|
| 132 |
+
return app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
if __name__ == "__main__":
|
| 135 |
+
app = main()
|
| 136 |
port = int(os.environ.get("GRADIO_SERVER_PORT", 7861)) # Default to 7861
|
| 137 |
app.launch(server_port=port, debug=True)
|
|
|
|
|
|