Commit
Β·
69aa356
1
Parent(s):
89d5d61
improve description
Browse files
app.py
CHANGED
@@ -250,26 +250,47 @@ def open_prs(profile: gr.OAuthProfile | None, user_or_org: str = None):
|
|
250 |
return f"Opened {len([r for r in results if r['opened_pr']])} PRs"
|
251 |
|
252 |
|
253 |
-
description_text = """
|
254 |
-
## Welcome to the Librarian Bot Metadata Request Service
|
255 |
|
256 |
-
⭐ The Librarian Bot Metadata Request Service allows you to request metadata updates for your models on the Hugging Face Hub. ⭐
|
257 |
|
258 |
-
Currently this app allows you to request for librarian bot to add metadata for the `base_model` field, situated in the `YAML` block of your model's `README.md`.
|
259 |
|
260 |
-
|
261 |
|
262 |
-
We performed a regular expression match on your `README.md` file to determine the connection.
|
263 |
|
264 |
-
###
|
265 |
|
266 |
-
|
267 |
-
- **Boosts Discoverability** - It becomes straightforward to trace the relationships between various models on the Hugging Face Hub.
|
268 |
-
- **Highlights Impact** - It showcases the contributions and influences different models have within the community.
|
269 |
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
"""
|
274 |
|
275 |
|
@@ -281,12 +302,22 @@ with gr.Blocks() as demo:
|
|
281 |
"""<div style='text-align:center;'><img src='https://huggingface.co/spaces/davanstrien/librarian_bot_request_metadata/resolve/main/image.png' style='display:block;margin-left:auto;margin-right:auto;width:150px;'></div><p>"""
|
282 |
)
|
283 |
gr.Markdown(description_text)
|
|
|
284 |
with gr.Row():
|
285 |
-
gr.Markdown(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
with gr.Row():
|
287 |
gr.LoginButton()
|
288 |
gr.LogoutButton()
|
289 |
-
user = gr.Textbox(
|
|
|
|
|
290 |
button = gr.Button(value="Open Pull Requests")
|
291 |
results = gr.Markdown()
|
292 |
button.click(open_prs, [user], results)
|
|
|
250 |
return f"Opened {len([r for r in results if r['opened_pr']])} PRs"
|
251 |
|
252 |
|
253 |
+
# description_text = """
|
254 |
+
# ## Welcome to the Librarian Bot Metadata Request Service
|
255 |
|
256 |
+
# ⭐ The Librarian Bot Metadata Request Service allows you to request metadata updates for your models on the Hugging Face Hub. ⭐
|
257 |
|
258 |
+
# Currently this app allows you to request for librarian bot to add metadata for the `base_model` field, situated in the `YAML` block of your model's `README.md`.
|
259 |
|
260 |
+
# This app will allow you to request metadata for all your models or for another user or org. If you request metadata for another user or org, librarian bot will randomly select 5 models to request metadata for.
|
261 |
|
|
|
262 |
|
263 |
+
# ### How does librarian bot know what metadata to add to your model card?
|
264 |
|
265 |
+
# Librarian bot will perform a regular expression match on your `README.md` file to determine whether your model may have bene fine-tuned from another model. This model is known as the `base_model`.
|
|
|
|
|
266 |
|
267 |
+
# ### Why add this info to Model Cards?
|
268 |
+
|
269 |
+
# Enhancing your model's metadata in this way:
|
270 |
+
# - 🚀 **Boosts Discoverability** - It becomes straightforward to trace the relationships between various models on the Hugging Face Hub.
|
271 |
+
# - 🏆**Highlights Impact** - It showcases the contributions and influences different models have within the community.
|
272 |
+
|
273 |
+
# For a hands-on example of how such metadata can play a pivotal role in mapping model connections, take a look at [librarian-bots/base_model_explorer](https://huggingface.co/spaces/librarian-bots/base_model_explorer).
|
274 |
+
|
275 |
+
# """
|
276 |
+
|
277 |
+
description_text = """
|
278 |
+
## Enhance Your Model's Metadata with Librarian Bot!
|
279 |
|
280 |
+
Welcome to the Librarian Bot Metadata Request Service. With a few clicks, enrich your Hugging Face models with key metadata!
|
281 |
+
|
282 |
+
π― **Purpose of this App**
|
283 |
+
- Request metadata updates for your models on the Hugging Face Hub, specifically to add or update the `base_model` field in the `YAML` section of your model's `README.md`.
|
284 |
+
- Optionally, request metadata for models belonging to another user or organization. If doing so, the bot will randomly pick 5 models for metadata addition.
|
285 |
+
|
286 |
+
π€ **How Does Librarian Bot Determine Metadata?**
|
287 |
+
- It scans your `README.md` to try to determine if your model has been fine-tuned from another model. This original model is identified as the `base_model`.
|
288 |
+
|
289 |
+
π **Benefits of Metadata Enhancement**
|
290 |
+
- **Boosts Discoverability**: Easier tracing of relationships between Hugging Face Hub models.
|
291 |
+
- **Highlights Impact**: Demonstrates the influence and contribution of different models.
|
292 |
+
|
293 |
+
π‘ Explore the [librarian-bots/base_model_explorer](https://huggingface.co/spaces/librarian-bots/base_model_explorer) for a hands-on look at the significance of this `base_model` metadata.
|
294 |
"""
|
295 |
|
296 |
|
|
|
302 |
"""<div style='text-align:center;'><img src='https://huggingface.co/spaces/davanstrien/librarian_bot_request_metadata/resolve/main/image.png' style='display:block;margin-left:auto;margin-right:auto;width:150px;'></div><p>"""
|
303 |
)
|
304 |
gr.Markdown(description_text)
|
305 |
+
|
306 |
with gr.Row():
|
307 |
+
gr.Markdown(
|
308 |
+
"""
|
309 |
+
## How to Use the Librarian Bot Metadata Request Service
|
310 |
+
|
311 |
+
1. **Login to Hugging Face**: Use the login button below to sign in. If you don't have an account, [create one here](https://huggingface.co/join).
|
312 |
+
2. **Specify Target User/Organization**: Enter a username or organization name if you wish the Librarian Bot to search metadata for someone other than yourself. Leaving this blank will prompt the bot to look for metadata for your own models and make PRs when a match is found.
|
313 |
+
3. **Initiate Metadata Enhancement**: Click the "Open Pull Requests" button. The bot will then search for `base_model` metadata and create Pull Requests for models lacking this information."""
|
314 |
+
)
|
315 |
with gr.Row():
|
316 |
gr.LoginButton()
|
317 |
gr.LogoutButton()
|
318 |
+
user = gr.Textbox(
|
319 |
+
value=None, label="(Optional) user or org to open pull requests for"
|
320 |
+
)
|
321 |
button = gr.Button(value="Open Pull Requests")
|
322 |
results = gr.Markdown()
|
323 |
button.click(open_prs, [user], results)
|