Jmnn commited on
Commit
73e3842
·
verified ·
1 Parent(s): e2b9583

Upload SEARCH_GUIDE.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. SEARCH_GUIDE.md +135 -0
SEARCH_GUIDE.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hub search: URLs and Python
2
+
3
+ This guide shows how to search models, datasets, and Spaces using **URL parameters** and the **Python library** (`huggingface_hub`). Use it to find repos by tag, author (user or org), and more.
4
+
5
+ ---
6
+
7
+ ## 1. Search by URL
8
+
9
+ You can build URLs that pre-fill the Hub search. There is no UI to build these yet, so you construct the URL manually.
10
+
11
+ ### Main parameters
12
+
13
+ | Parameter | Meaning | Example |
14
+ |------------|-----------------------------------------------|----------------------------------|
15
+ | `other` | Tags (comma-separated for multiple) | `other=hunyuan` or `other=hunyuan,conversational` |
16
+ | `author` | User or org that owns the repo | `author=netflix` or `author=tencent-community` |
17
+ | `search` | Full-text search in repo name/description | `search=bert` |
18
+
19
+ ### Models
20
+
21
+ - Base URL: `https://huggingface.co/models`
22
+ - Examples:
23
+ - All models with tag **hunyuan**:
24
+ `https://huggingface.co/models?other=hunyuan`
25
+ - Models with **two tags**:
26
+ `https://huggingface.co/models?other=hunyuan,conversational`
27
+ - Models from an **org** (e.g. tencent-community):
28
+ `https://huggingface.co/models?author=tencent-community`
29
+ - **Tag + author**:
30
+ `https://huggingface.co/models?other=hunyuan,conversational&author=tencent-community`
31
+
32
+ ### Datasets
33
+
34
+ - Base URL: `https://huggingface.co/datasets`
35
+ - Same idea: `other=...` for tags, `author=...` for user/org.
36
+ Example:
37
+ `https://huggingface.co/datasets?author=netflix`
38
+
39
+ ### Spaces
40
+
41
+ - Base URL: `https://huggingface.co/spaces`
42
+ - Use `filter=...` for tags (e.g. region), `author=...` for owner.
43
+ Example:
44
+ `https://huggingface.co/spaces?author=netflix`
45
+
46
+ ---
47
+
48
+ ## 2. Search with Python
49
+
50
+ The same filters are available in `huggingface_hub`: `list_models`, `list_datasets`, `list_spaces`.
51
+ For **private** or **gated** repos, use a token (e.g. `token=True` or `token="hf_..."`).
52
+
53
+ ### List models
54
+
55
+ ```python
56
+ from huggingface_hub import list_models
57
+
58
+ # All models from an org (e.g. netflix – use token if private)
59
+ for repo in list_models(author="netflix", token=True):
60
+ print(repo.id) # e.g. netflix/mdeberta_512_v3_base, netflix/my-bert-model
61
+
62
+ # By tag
63
+ list_models(other="conversational")
64
+
65
+ # By tag + author
66
+ list_models(other="hunyuan,conversational", author="tencent-community")
67
+ ```
68
+
69
+ ### List datasets
70
+
71
+ ```python
72
+ from huggingface_hub import list_datasets
73
+
74
+ # All datasets from an org (use token if private)
75
+ for repo in list_datasets(author="netflix", token=True):
76
+ print(repo.id) # e.g. netflix/acrostic_poem, netflix/ifeval
77
+ ```
78
+
79
+ ### List Spaces
80
+
81
+ ```python
82
+ from huggingface_hub import list_spaces
83
+
84
+ list_spaces(author="netflix", token=True)
85
+ ```
86
+
87
+ ---
88
+
89
+ ## 3. Example: private org "netflix"
90
+
91
+ If your org has these repos:
92
+
93
+ - **Models:** `netflix/mdeberta_512_v3_base`, `netflix/my-bert-model`
94
+ - **Datasets:** `netflix/acrostic_poem`, `netflix/ifeval`
95
+
96
+ ### URLs (logged in)
97
+
98
+ - All models from netflix:
99
+ `https://huggingface.co/models?author=netflix`
100
+ - All datasets from netflix:
101
+ `https://huggingface.co/datasets?author=netflix`
102
+
103
+ ### Python (with token for private)
104
+
105
+ ```python
106
+ from huggingface_hub import list_models, list_datasets
107
+
108
+ # Models
109
+ for m in list_models(author="netflix", token=True):
110
+ print(m.id)
111
+ # netflix/mdeberta_512_v3_base
112
+ # netflix/my-bert-model
113
+
114
+ # Datasets
115
+ for d in list_datasets(author="netflix", token=True):
116
+ print(d.id)
117
+ # netflix/acrostic_poem
118
+ # netflix/ifeval
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 4. Discovering tags
124
+
125
+ - On a **model repo page**, the tags are listed; **clicking a tag** takes you to the models search with that tag in `other`.
126
+ - For datasets and Spaces, you can use the same tag names you see on repo cards in the `other` or `filter` param.
127
+
128
+ ---
129
+
130
+ ## 5. Full reference
131
+
132
+ - **URLs:** Build `https://huggingface.co/{models|datasets|spaces}?other=tag1,tag2&author=<namespace>`.
133
+ **`author`** is the **namespace**: the org name or username (e.g. `netflix`, `tencent-community`, or a Hub username). Use the same value in URLs and in Python.
134
+ - **Python:** [Search guide](https://huggingface.co/docs/huggingface_hub/guides/search) in the docs.
135
+ - **Token:** For private/gated repos, use `token=True` (from env or cache) or `token="hf_..."` in Python; for URLs, be logged in on the site.