Antoine Chaffin
commited on
Commit
·
43764a8
1
Parent(s):
a3e9331
remove req
Browse files- app.py +5 -3
- requirements.txt +1 -2
app.py
CHANGED
@@ -13,6 +13,7 @@ subprocess.run(
|
|
13 |
from typing import Any, Dict, List, Optional
|
14 |
|
15 |
from core import MCPyLate
|
|
|
16 |
from mcp.server.fastmcp import FastMCP
|
17 |
|
18 |
|
@@ -20,10 +21,10 @@ def register_tools(mcp: FastMCP, pylate: MCPyLate):
|
|
20 |
"""Register all tools with the MCP server."""
|
21 |
|
22 |
@mcp.tool(
|
23 |
-
name="
|
24 |
-
description="Perform a multi-vector search on the
|
25 |
)
|
26 |
-
def
|
27 |
query: str, k: int = 10, index_name: Optional[str] = None
|
28 |
) -> List[Dict[str, Any]]:
|
29 |
"""
|
@@ -59,6 +60,7 @@ def register_tools(mcp: FastMCP, pylate: MCPyLate):
|
|
59 |
|
60 |
def main():
|
61 |
"""Main entry point for the server."""
|
|
|
62 |
try:
|
63 |
mcp = FastMCP("pylate-search-server")
|
64 |
|
|
|
13 |
from typing import Any, Dict, List, Optional
|
14 |
|
15 |
from core import MCPyLate
|
16 |
+
from huggingface_hub import snapshot_download
|
17 |
from mcp.server.fastmcp import FastMCP
|
18 |
|
19 |
|
|
|
21 |
"""Register all tools with the MCP server."""
|
22 |
|
23 |
@mcp.tool(
|
24 |
+
name="pylate_search_leetcode",
|
25 |
+
description="Perform a multi-vector search on the leetcode index. Returns top‑k hits with docid, score, and snippet.",
|
26 |
)
|
27 |
+
def pylate_search_leetcode(
|
28 |
query: str, k: int = 10, index_name: Optional[str] = None
|
29 |
) -> List[Dict[str, Any]]:
|
30 |
"""
|
|
|
60 |
|
61 |
def main():
|
62 |
"""Main entry point for the server."""
|
63 |
+
snapshot_download(repo_id="leetcode_Reason-ModernColBERT", local_dir="indexes/")
|
64 |
try:
|
65 |
mcp = FastMCP("pylate-search-server")
|
66 |
|
requirements.txt
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
gradio
|
2 |
-
git+https://github.com/lightonai/pylate/.git@MCPyLate
|
3 |
-
lightonai/pylate/tree/MCPyLate
|
|
|
1 |
gradio
|
2 |
+
git+https://github.com/lightonai/pylate/.git@MCPyLate
|
|