patrickvonplaten commited on
Commit
090ea4d
1 Parent(s): da69cd8

add update model card script

Browse files
Files changed (2) hide show
  1. README.md +10 -2
  2. update_model_card_mass_pr.py +12 -0
README.md CHANGED
@@ -1,4 +1,12 @@
1
- # Confidence Scoring
 
 
 
2
 
3
  Read https://x-lance.sjtu.edu.cn/papers/zhc00-chen-icassp17.pdf
4
- Run create_confidence_scores.py
 
 
 
 
 
1
+ # This repo contains some useful scripts
2
+
3
+
4
+ ## Confidence Scoring
5
 
6
  Read https://x-lance.sjtu.edu.cn/papers/zhc00-chen-icassp17.pdf
7
+
8
+ Run `create_confidence_scores.py`
9
+
10
+ ## Mass PR to update README
11
+
12
+ Run `update_model_card_mass_pr.py` . Make sure you use the following branch: https://github.com/huggingface/huggingface_hub/pull/884
update_model_card_mass_pr.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from huggingface_hub import hf_api
3
+ from huggingface_hub.repocard import metadata_update
4
+
5
+ hf_api = hf_api.HfApi()
6
+
7
+ all_marian_models = hf_api.list_models(filter="marian")
8
+ all_new_marian_models = [x.modelId for x in all_marian_models if x.modelId.startswith("Helsinki-NLP/opus-mt-tc")]
9
+
10
+ for repo_id in all_new_marian_models:
11
+ print(f"Opening PR for {repo_id}")
12
+ metadata_update(repo_id, {"tags": ["translation", "opus-mt-tc"]}, create_pr=True, pr_commit_summary="Add `opus-mt-tc` tag", pr_commit_description="Add `opus-mt-tc` tag so that this new marian models can be found more easily")