apple muncy commited on
Commit
1e82c99
Β·
1 Parent(s): f183375

adding Dashboard code

Browse files

Signed-off-by: apple muncy <[email protected]>

Files changed (1) hide show
  1. app.py +41 -1
app.py CHANGED
@@ -527,11 +527,51 @@ def create_gradio_app():
527
 
528
  return demo
529
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
 
531
  # Mount Gradio app
532
  gradio_app = create_gradio_app()
 
533
  app = gr.mount_gradio_app(my_app, gradio_app, path="/gradio")
534
-
535
 
536
  if __name__ == "__main__":
537
  logger.info('πŸš€ Starting HF Tagging Bot...')
 
527
 
528
  return demo
529
 
530
+ def create_dashboard():
531
+ """Create Gradio interface"""
532
+ with gr.Blocks(title="HF Tagging Bot", theme=gr.themes.Soft()) as demo:
533
+ gr.Markdown("# 🏷️ HF Tagging Bot Additional Dashboard")
534
+ gr.Markdown("*Display MCP data*")
535
+
536
+ gr.Markdown("""
537
+ ## How it works:
538
+ - Monitors HuggingFace Hub discussions
539
+ - Detects tag mentions in comments (e.g., "tag: pytorch",
540
+ "#transformers")
541
+ - Automatically adds recognized tags to the model repository
542
+ - Supports common ML tags like: pytorch, tensorflow,
543
+ text-generation, etc.
544
+ """)
545
+
546
+ with gr.Column():
547
+ sim_repo = gr.Textbox(
548
+ label="Repository",
549
+ value="burtenshaw/play-mcp-repo-bot",
550
+ placeholder="username/model-name",
551
+ )
552
+ sim_title = gr.Textbox(
553
+ label="Discussion Title",
554
+ value="Add pytorch tag",
555
+ placeholder="Discussion title",
556
+ )
557
+ sim_comment = gr.Textbox(
558
+ label="Comment",
559
+ lines=3,
560
+ value="This model should have tags: pytorch, text-generation",
561
+ placeholder="Comment mentioning tags...",
562
+ )
563
+ sim_btn = gr.Button("🏷️ Test Tag Detection")
564
+
565
+ return demo
566
+
567
+
568
+
569
 
570
  # Mount Gradio app
571
  gradio_app = create_gradio_app()
572
+ dashboard_ui = create_dasboad()
573
  app = gr.mount_gradio_app(my_app, gradio_app, path="/gradio")
574
+ app2 = gr.mount_gradio_app(my_app, dashboard_ui, path="/dashboard")
575
 
576
  if __name__ == "__main__":
577
  logger.info('πŸš€ Starting HF Tagging Bot...')