leavoigt commited on
Commit
beae3a1
·
verified ·
1 Parent(s): 2b289af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -9
app.py CHANGED
@@ -1,16 +1,29 @@
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
  ui = 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
 
1
  import gradio as gr
2
 
 
 
 
 
 
3
 
4
+ def placeholder_function():
5
+ print("hello!")
6
+
7
  ui = gr.Interface(
8
+ fn=placeholder_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
+ gr.Textbox(
17
+ label="Context",
18
+ lines=8,
19
+ placeholder="Paste relevant context here",
20
+ info="Provide the context/documents to use for answering. The API expects a list of dictionaries, but the UI should except anything"
21
+ ),
22
+ ],
23
+ outputs=[gr.Text(label="Generated Answer", lines=6, show_copy_button=True)],
24
+ title="ChatFed Generation Module",
25
+ description="Ask questions based on provided context. Intended for use in RAG pipelines as an MCP server with other ChatFed modules (i.e. context supplied by semantic retriever service).",
26
+ api_name="generate"
27
  )
28
 
29
  # Launch with MCP server enabled