davanstrien HF Staff commited on
Commit
a87de4c
·
1 Parent(s): 5f6ba44

update descriptions

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -534,18 +534,20 @@ def search_hub(query: str, min_score=None, min_model_card_length=None):
534
 
535
  with gr.Blocks() as demo:
536
  with gr.Tab("Search"):
537
- gr.Markdown("# 🤗 Hub model search with metadata quality filters")
 
 
 
 
 
538
  gr.Markdown(
539
- """This search tool relies on the full-text search API.
540
- Your search is passed to this API and the returned models are assessed for metadata quality.
541
- If you don't specify any minimum requirements you will get back your results with metadata quality info
542
- for each result. The results are ordered by:
543
-
544
- - Metadata quality i.e. a model with 80% metadata quality will rank higher than one with 75%
545
- - Original search order i.e. if two models have the same metadata quality the one that appeared first in the original search will rank higher.
546
-
547
- If there is interest in this app I will expose more options for filtering and sorting results.
548
- """
549
  )
550
  with gr.Row():
551
  with gr.Column():
@@ -559,9 +561,12 @@ with gr.Blocks() as demo:
559
  mim_model_card_length = gr.Number(
560
  100, label="Minimum model card length"
561
  )
562
- min_metadata_score = gr.Slider(0, 100, 50, label="Minimum metadata score")
563
- filter_results = gr.Markdown("Filter results vs original search")
564
- results_markdown = gr.Markdown("Search results")
 
 
 
565
  button.click(
566
  search_hub,
567
  [query, min_metadata_score, mim_model_card_length],
 
534
 
535
  with gr.Blocks() as demo:
536
  with gr.Tab("Search"):
537
+ gr.HTML(
538
+ """
539
+ <h1 style="text-align: center;">MetaRefine </h1>
540
+ <p style="text-align: center;">&#x2728; <em>Hub model search results by metadata quality.</em> &#x2728;</p>
541
+ """
542
+ )
543
  gr.Markdown(
544
+ """This app enables you to perform full-text searches on the Hugging Face Hub for machine learning models.
545
+ You can search by keyword or phrase and filter results by metadata quality.
546
+ Optionally, you can set a minimum model card length or metadata quality score to refine your results.
547
+ Models are ranked based on metadata quality, with higher scores receiving priority.
548
+ In case of equal scores, the original search order determines the ranking.
549
+ More filtering and sorting options may be added based on user interest!
550
+ """
 
 
 
551
  )
552
  with gr.Row():
553
  with gr.Column():
 
561
  mim_model_card_length = gr.Number(
562
  100, label="Minimum model card length"
563
  )
564
+ min_metadata_score = gr.Slider(
565
+ 0, 100, 50, label="Minimum metadata score"
566
+ )
567
+ gr.Markdown("## Search results")
568
+ filter_results = gr.Markdown()
569
+ results_markdown = gr.Markdown()
570
  button.click(
571
  search_hub,
572
  [query, min_metadata_score, mim_model_card_length],