leavoigt commited on
Commit
ca823ee
·
verified ·
1 Parent(s): 204e727

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -1,18 +1,16 @@
1
  import gradio as gr
2
 
3
- def test_function():
4
- return "hello world"
5
-
6
- # Set up interface
7
- ui = gr.Interface(
8
- fn=test_function,
9
- inputs=[
10
- gr.Textbox(
11
- label="Query",
12
- lines=2,
13
- placeholder="Enter query here",
14
- info="The query to search for in the vector database"
15
- )]
16
  )
17
 
18
  # Launch with MCP server enabled
 
1
  import gradio as gr
2
 
3
+ def handle_geojson_upload(file):
4
+ if file is None:
5
+ return "No file uploaded"
6
+ content = file.read()
7
+ return f"Uploaded file with size: {len(content)} bytes"
8
+
9
+ iface = gr.Interface(
10
+ fn=handle_geojson_upload,
11
+ inputs=gr.File(file_types=[".geojson"]), # restrict to geojson
12
+ outputs="text",
13
+ title="GeoJSON Upload Example"
 
 
14
  )
15
 
16
  # Launch with MCP server enabled