Spaces:
Runtime error
Runtime error
apple muncy
commited on
Commit
·
d50d17c
1
Parent(s):
93a3efd
change my_mcp to mcp
Browse filesSigned-off-by: apple muncy <apple@dell-deb-12-5.local>
app.py
CHANGED
|
@@ -27,10 +27,10 @@ HF_TOKEN = os.getenv("HF_TOKEN")
|
|
| 27 |
hf_api = HfApi(token=HF_TOKEN) if HF_TOKEN else None
|
| 28 |
|
| 29 |
# Create the FastMCP server
|
| 30 |
-
|
| 31 |
|
| 32 |
|
| 33 |
-
@
|
| 34 |
def get_current_tags(repo_id: str) -> str:
|
| 35 |
"""Get current tags from a HuggingFace model repository"""
|
| 36 |
print(f"🔧 get_current_tags called with repo_id: {repo_id}")
|
|
@@ -65,7 +65,7 @@ def get_current_tags(repo_id: str) -> str:
|
|
| 65 |
return json_str
|
| 66 |
|
| 67 |
|
| 68 |
-
@
|
| 69 |
def add_new_tag(repo_id: str, new_tag: str) -> str:
|
| 70 |
"""Add a new tag to a HuggingFace model repository via PR"""
|
| 71 |
print(f"🔧 add_new_tag called with repo_id: {repo_id}, new_tag: {new_tag}")
|
|
@@ -211,7 +211,7 @@ def create_gradio_app():
|
|
| 211 |
return demo
|
| 212 |
# Mount Gradio app
|
| 213 |
gradio_app = create_gradio_app()
|
| 214 |
-
#app_gradio = gr.mount_gradio_app(
|
| 215 |
|
| 216 |
|
| 217 |
|
|
|
|
| 27 |
hf_api = HfApi(token=HF_TOKEN) if HF_TOKEN else None
|
| 28 |
|
| 29 |
# Create the FastMCP server
|
| 30 |
+
mcp = FastMCP("hf-tagging-bot-server")
|
| 31 |
|
| 32 |
|
| 33 |
+
@mcp.tool()
|
| 34 |
def get_current_tags(repo_id: str) -> str:
|
| 35 |
"""Get current tags from a HuggingFace model repository"""
|
| 36 |
print(f"🔧 get_current_tags called with repo_id: {repo_id}")
|
|
|
|
| 65 |
return json_str
|
| 66 |
|
| 67 |
|
| 68 |
+
@mcp.tool()
|
| 69 |
def add_new_tag(repo_id: str, new_tag: str) -> str:
|
| 70 |
"""Add a new tag to a HuggingFace model repository via PR"""
|
| 71 |
print(f"🔧 add_new_tag called with repo_id: {repo_id}, new_tag: {new_tag}")
|
|
|
|
| 211 |
return demo
|
| 212 |
# Mount Gradio app
|
| 213 |
gradio_app = create_gradio_app()
|
| 214 |
+
#app_gradio = gr.mount_gradio_app(mcp, gradio_app, path="/gradio")
|
| 215 |
|
| 216 |
|
| 217 |
|