File size: 562 Bytes
ec765f7
 
ca823ee
 
 
 
 
 
 
 
 
 
 
b342c48
ec765f7
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr

def handle_geojson_upload(file):
    if file is None:
        return "No file uploaded"
    content = file.read()
    return f"Uploaded file with size: {len(content)} bytes"

iface = gr.Interface(
    fn=handle_geojson_upload,
    inputs=gr.File(file_types=[".geojson"]),  # restrict to geojson
    outputs="text",
    title="GeoJSON Upload Example"
)

# Launch with MCP server enabled
if __name__ == "__main__":
    ui.launch(
        server_name="0.0.0.0",
        server_port=7860,
        #mcp_server=True,
        show_error=True
    )