-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically add metadata to Hugging Face Hub repos when uploading projects #793
base: main
Are you sure you want to change the base?
Automatically add metadata to Hugging Face Hub repos when uploading projects #793
Conversation
About @osma's suggestions in #790 (comment):
|
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #793 +/- ##
==========================================
- Coverage 99.64% 99.60% -0.05%
==========================================
Files 91 93 +2
Lines 6817 7048 +231
==========================================
+ Hits 6793 7020 +227
- Misses 24 28 +4 ☔ View full report in Codecov by Sentry. |
@CodiumAI-Agent /review |
PR Reviewer Guide 🔍(Review updated until commit 845f53d)
|
) | ||
def test_upsert_modelcard_existing_card(ModelCard, _list_files_in_hf_hub, project): | ||
repo_id = "annif-user/Annif-HFH-repo" | ||
project.vocab_lang = "fi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project fixture does not provide vocab_lang
so for these tests it is just set here, not super clean maybe?
Good point by the AI, but I think the project language is always set if this point is reached...? |
Persistent review updated to latest commit 845f53d |
I added an automatically updating Projects section to the modelcard, like this: https://huggingface.co/juhoinkinen/Annif-models-upload-testing#projects |
logger.debug("Reading configuration from a string in CFG format") | ||
read_method = self._config.read_string | ||
source = projstr | ||
self._read_config(read_method, source) |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
logger.debug("Reading configuration from a string in CFG format") | ||
read_method = self._config.read_string | ||
source = projstr | ||
self._read_config(read_method, source) |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
Quality Gate passedIssues Measures |
With this PR, when running
annif upload
:README.md
(Model Card) does not exist in the destination repository, thenREADME.md
is created with default contents and some metadata of the uploaded projects,README.md
exists, its metadata are updated as necessary.Closes #790.
The metadata includes these:
The Model Card text content is very minimal; it has just the repo name as the heading and info about how to download projects from the repo, see an example in https://huggingface.co/juhoinkinen/Annif-models-upload-testing.