changed gradio route to '/gradio' and added route '/'
Browse files- README.md +17 -8
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +4 -1
README.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
-
|
| 9 |
-
short_description: add tags for models and create PRs
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: tag-a-repo bot
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.31.0
|
| 8 |
+
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
base_path: /gradio
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# HF Tagging Bot
|
| 14 |
+
|
| 15 |
+
This is a bot that tags HuggingFace models when they are mentioned in discussions.
|
| 16 |
+
|
| 17 |
+
## How it works
|
| 18 |
+
|
| 19 |
+
1. The bot listens to discussions on the HuggingFace Hub
|
| 20 |
+
2. When a discussion is created, the bot checks for tag mentions in the comment
|
| 21 |
+
3. If a tag is mentioned, the bot adds the tag to the model repository via a PR
|
__pycache__/app.cpython-311.pyc
ADDED
|
Binary file (23 kB). View file
|
|
|
app.py
CHANGED
|
@@ -382,6 +382,9 @@ Please process all {len(all_tags)} tags: {", ".join(all_tags)}
|
|
| 382 |
print(error_msg)
|
| 383 |
return error_msg
|
| 384 |
|
|
|
|
|
|
|
|
|
|
| 385 |
|
| 386 |
@app.post("/webhook")
|
| 387 |
async def webhook_handler(request: Request, background_tasks: BackgroundTasks):
|
|
@@ -514,7 +517,7 @@ def create_gradio_app():
|
|
| 514 |
|
| 515 |
# Mount Gradio app
|
| 516 |
gradio_app = create_gradio_app()
|
| 517 |
-
app = gr.mount_gradio_app(app, gradio_app, path="/")
|
| 518 |
|
| 519 |
|
| 520 |
if __name__ == "__main__":
|
|
|
|
| 382 |
print(error_msg)
|
| 383 |
return error_msg
|
| 384 |
|
| 385 |
+
@app.get("/")
|
| 386 |
+
async def root():
|
| 387 |
+
return {"message": "Hello! The server is running."}
|
| 388 |
|
| 389 |
@app.post("/webhook")
|
| 390 |
async def webhook_handler(request: Request, background_tasks: BackgroundTasks):
|
|
|
|
| 517 |
|
| 518 |
# Mount Gradio app
|
| 519 |
gradio_app = create_gradio_app()
|
| 520 |
+
app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
|
| 521 |
|
| 522 |
|
| 523 |
if __name__ == "__main__":
|