Spaces:
Running
Running
Update app.py
Browse files
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=
|
11 |
-
inputs=
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|