Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
import json
|
| 3 |
-
import gradio as gr
|
| 4 |
from fastmcp import FastMCP
|
| 5 |
from huggingface_hub import HfApi, model_info
|
| 6 |
|
|
@@ -33,20 +32,6 @@ def get_current_tags(repo_id: str) -> str:
|
|
| 33 |
"error": str(e),
|
| 34 |
})
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
def gradio_tag_checker(repo_id):
|
| 38 |
-
return get_current_tags(repo_id)
|
| 39 |
-
|
| 40 |
-
demo = gr.Interface(
|
| 41 |
-
fn=gradio_tag_checker,
|
| 42 |
-
inputs=gr.Textbox(label="Enter HuggingFace Model Repo ID", placeholder="e.g. bert-base-uncased"),
|
| 43 |
-
outputs=gr.Textbox(label="Current Tags (JSON)"),
|
| 44 |
-
title="🔖 HuggingFace Tag Checker",
|
| 45 |
-
description="Uses FastMCP + HuggingFace Hub SDK to fetch current tags from any model repo."
|
| 46 |
-
)
|
| 47 |
-
|
| 48 |
-
# Run both FastMCP and Gradio safely
|
| 49 |
if __name__ == "__main__":
|
| 50 |
-
|
| 51 |
-
threading.Thread(target=mcp.run, daemon=True).start()
|
| 52 |
-
demo.launch(quiet=True, show_error=False) # ✅ Prevent uvicorn logging crash
|
|
|
|
| 1 |
import os
|
| 2 |
import json
|
|
|
|
| 3 |
from fastmcp import FastMCP
|
| 4 |
from huggingface_hub import HfApi, model_info
|
| 5 |
|
|
|
|
| 32 |
"error": str(e),
|
| 33 |
})
|
| 34 |
|
| 35 |
+
# Run MCP server only
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
if __name__ == "__main__":
|
| 37 |
+
mcp.run()
|
|
|
|
|
|