Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,58 +1,31 @@
|
|
1 |
-
import subprocess
|
2 |
-
from pathlib import Path
|
3 |
import gradio as gr
|
|
|
|
|
4 |
|
5 |
-
FREEZE_FILE = "requirements_full.txt"
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
try:
|
10 |
-
with open(FREEZE_FILE, "w") as f:
|
11 |
-
subprocess.run(["pip", "freeze"], stdout=f, check=True)
|
12 |
-
except Exception as e:
|
13 |
-
print(f"[ERROR] Could not write requirements: {e}")
|
14 |
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
with gr.
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
demo.launch(server_name="0.0.0.0", server_port=7860,
|
25 |
-
#mcp_server=True
|
26 |
-
)
|
27 |
-
|
28 |
-
# import gradio as gr
|
29 |
-
# import json
|
30 |
-
# from utils.main_processor import get_statistics
|
31 |
-
|
32 |
-
|
33 |
-
# # Interface
|
34 |
-
# with gr.Blocks() as ui:
|
35 |
-
|
36 |
-
# with gr.Row():
|
37 |
-
# file_input = gr.File(file_types=[".geojson"])
|
38 |
-
|
39 |
-
# with gr.Row():
|
40 |
-
# with gr.Column():
|
41 |
-
# submit_btn = gr.Button("Submit")
|
42 |
-
|
43 |
-
# with gr.Row():
|
44 |
-
# output = gr.Dataframe()
|
45 |
|
46 |
|
47 |
-
#
|
48 |
-
|
49 |
-
|
50 |
|
51 |
-
#
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
#
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import json
|
3 |
+
from utils.main_processor import get_statistics
|
4 |
|
|
|
5 |
|
6 |
+
# Interface
|
7 |
+
with gr.Blocks() as ui:
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
with gr.Row():
|
10 |
+
file_input = gr.File(file_types=[".geojson"])
|
11 |
|
12 |
+
with gr.Row():
|
13 |
+
with gr.Column():
|
14 |
+
submit_btn = gr.Button("Submit")
|
15 |
|
16 |
+
with gr.Row():
|
17 |
+
output = gr.Dataframe()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
+
# Submit button action
|
21 |
+
submit_btn.click(get_statistics,
|
22 |
+
file_input, output)
|
23 |
|
24 |
+
# Launch app
|
25 |
+
if __name__ == "__main__":
|
26 |
+
ui.launch(
|
27 |
+
server_name="0.0.0.0",
|
28 |
+
server_port=7860,
|
29 |
+
#mcp_server=True,
|
30 |
+
show_error=True
|
31 |
+
)
|