murnanedaniel commited on
Commit
e5fc855
·
verified ·
1 Parent(s): d7b87f6

sync from staging @ f46f7d67

Browse files
Files changed (2) hide show
  1. README.md +32 -5
  2. app.py +77 -0
README.md CHANGED
@@ -1,12 +1,39 @@
1
  ---
2
- title: Colliderml Model Zoo Staging
3
- emoji: 🐨
4
- colorFrom: blue
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 6.11.0
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: ColliderML Model Zoo
3
+ emoji: 🦒
4
+ colorFrom: green
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 4.44.0
8
  app_file: app.py
9
  pinned: false
10
+ license: apache-2.0
11
  ---
12
 
13
+ # ColliderML Model Zoo
14
+
15
+ Browse models tagged `colliderml` on HuggingFace. Upload your own by
16
+ adding the `colliderml` tag to your model card.
17
+
18
+ ## Curation
19
+
20
+ Models are discovered automatically via
21
+ `huggingface_hub.list_models(filter="colliderml")`. If you want your model
22
+ shown here, add the following to your model card:
23
+
24
+ ```yaml
25
+ ---
26
+ tags:
27
+ - colliderml
28
+ task_category: object-detection # or whatever applies
29
+ ---
30
+ ```
31
+
32
+ The zoo sorts by download count by default. You can also filter by task
33
+ (`tracking`, `jets`, `anomaly`).
34
+
35
+ ## Deployment
36
+
37
+ Synced automatically from `spaces/model-zoo/` on the
38
+ [OpenDataDetector/ColliderML](https://github.com/OpenDataDetector/ColliderML)
39
+ repo via the `sync-spaces.yml` workflow.
app.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ ColliderML Model Zoo — Gradio HF Space.
3
+
4
+ Thin browser over ``huggingface_hub.list_models(filter="colliderml")``.
5
+ Sortable, filterable, with direct links to each model card.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import gradio as gr
11
+ import pandas as pd
12
+ from huggingface_hub import list_models
13
+
14
+
15
+ def fetch_models(task_filter: str = "any") -> pd.DataFrame:
16
+ try:
17
+ models = list(list_models(filter="colliderml", limit=500, full=True))
18
+ except Exception as e:
19
+ return pd.DataFrame({"error": [str(e)]})
20
+
21
+ rows = []
22
+ for m in models:
23
+ tags = m.tags or []
24
+ task = next((t for t in tags if t in ("tracking", "jets", "anomaly")), "general")
25
+ if task_filter != "any" and task != task_filter:
26
+ continue
27
+ rows.append({
28
+ "model": m.modelId,
29
+ "task": task,
30
+ "downloads": getattr(m, "downloads", 0) or 0,
31
+ "likes": getattr(m, "likes", 0) or 0,
32
+ "pipeline": getattr(m, "pipeline_tag", "") or "",
33
+ "url": f"https://huggingface.co/{m.modelId}",
34
+ })
35
+
36
+ if not rows:
37
+ return pd.DataFrame(
38
+ {"info": ["No models tagged `colliderml` yet. Add the tag to your model card!"]}
39
+ )
40
+
41
+ df = pd.DataFrame(rows)
42
+ return df.sort_values("downloads", ascending=False).reset_index(drop=True)
43
+
44
+
45
+ with gr.Blocks(
46
+ title="ColliderML Model Zoo",
47
+ theme=gr.themes.Soft(primary_hue="green"),
48
+ ) as demo:
49
+ gr.Markdown(
50
+ """
51
+ # 🦒 ColliderML Model Zoo
52
+
53
+ Models tagged `colliderml` on HuggingFace. Tag your own to appear here:
54
+
55
+ ```yaml
56
+ ---
57
+ tags:
58
+ - colliderml
59
+ ---
60
+ ```
61
+ """
62
+ )
63
+ with gr.Row():
64
+ task_filter = gr.Dropdown(
65
+ ["any", "tracking", "jets", "anomaly", "general"],
66
+ value="any",
67
+ label="Filter by task",
68
+ )
69
+ refresh_btn = gr.Button("Refresh")
70
+ table = gr.DataFrame(value=fetch_models())
71
+
72
+ refresh_btn.click(fetch_models, inputs=task_filter, outputs=table)
73
+ task_filter.change(fetch_models, inputs=task_filter, outputs=table)
74
+
75
+
76
+ if __name__ == "__main__":
77
+ demo.launch(server_name="0.0.0.0", server_port=7860)