Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Heavily improve automatic model card generation + Patch XLM-R (#28)
* Uncomment pushing to the Hub * Initial version to improve automatic model card generation * Simplify label normalization * Automatically select some eval sentences for the widget * Improve language card * Add automatic evaluation results * Use dash instead of underscore in model name * Add extra TODOs * model.predict text as the first example * Automatically set model name based on encoder & dataset * Remove accidental Dataset import * Rename examples to widget examples * Add table with label examples Also use fields instead of __dict__ * Ensure complete metadata * Add tokenizer warning if punct must be split from words * Remove dead code * Rename poor variable names * Fix incorrect warning * Add " in the model labels * Set model_id based on args if possible * Add training set metrics * Randomly select 100 samples for the widget examples Instead of taking the first 100 * Prevent duplicate widget examples * Remove completed TODO * Use title case throughout model card * Add useful comments if values not provided Also prevent crash if dataset_id is not provided * Add environmental impact with codecarbon * Ensure that the model card template is included in the install * Add training hardware section * Add Python version * Make everything title case * Add missing docstring * Add docstring for SpanMarkerModelCardData * Update CHANGELOG * Add SpanMarkerModelCardData to dunder init * Add SpanMarkerModelCardData to snippets * Resolve breaking error if hub_model_id is set * gpu_model -> hardware_used To better match what HF expects * Add "base_model" to metadata * Increment datasets min version to 2.14.0 Required for sorting on multiple columns at once * Update trainer evaluate tests * Skip old model card test for now * Fix edge case: less than 5 examples * pytest.skip -> pytest.mark.skip * Try to infer the language from the dataset * Add citations and hidden sections * Refactor inferring language * Remove unused import * Add comment explaining version * Override default Trainer create_model_card * Update model card template slightly * Add newline to model card template * Remove incorrect space * Add model card tests * Improve Trainer tests regarding model card * Remove commented out breakpoint * Add codecarbon to CI * Rename integration extra to codecarbon * Make hardware_used optional (if no GPU present) * Apply suggestions to model_card_template Co-authored-by: Daniel van Strien <[email protected]> * Update model card test pattern alongside template changes * Don't include hardware_used when no GPU present * Set "No GPU used" for GPU Model if hardware_used is None * Don't store None in yaml * Ensure that emissions is a regular float * kgs to g * support e-05 notation * Add small test case for model cards * Update model tables in docs * Link to the spaCy integration in the tokenizer warning * Update README snippet * Update outdated docs: entity_max_length default is 8 * Remove /models from URL, caused 404s * Fix outdated type hint * 🎉 Apply XLM-R patch * Remove /models from test * Remove tokenizer warning after patch * Update training docs with model card data etc. * Pad token embeddings to multiple of 8 Removes a warning since transformers 4.32.0 * Always attach list directly to header * Tackle edge case where dataset card has no metadata * Allow installing nltk for detokenizing model card examples * Add model card docs * Mention codecarbon install in docstring * overwrite the default codecarbon log level to "error" * Update CHANGELOG * Fix issue with inference example containing full quotes * Update CHANGELOG * Never print a model when printing SpanMarkerModelCardData * Try to infer the dataset_id from the training set Thanks @cakiki * Update the main docs landing page --------- Co-authored-by: Daniel van Strien <[email protected]>
- Loading branch information