-
Notifications
You must be signed in to change notification settings - Fork 30.9k
Fix code examples for doctests #17013
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
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
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.
Thanks for fixing!
docs/source/en/pipeline_tutorial.mdx
Outdated
| >>> print(preds) | ||
| [{'score': 0.4403, 'label': 'lynx, catamount'}, {'score': 0.0343, 'label': 'cougar, puma, catamount, mountain lion, painter, panther, Felis concolor'}, {'score': 0.0321, 'label': 'snow leopard, ounce, Panthera uncia'}, {'score': 0.0235, 'label': 'Egyptian cat'}, {'score': 0.023, 'label': 'tiger cat'}] |
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.
Can we show the results as above? The doc test will pass if your replace any space by a new line, it only cares that there is whitespace.
|
Thanks for the work. Other than the For audio pipeline: (this is just a format issue I think) For vision pipeline:
|
|
I don't know why you ask me @ydshieh this is not my PR ;-) |
I know. Just to make sure you are also fine with my suggestion about |
…gface#17007) Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
) This reverts commit 4f3a14e.
* Result of new doc style with fixes * Add last two files * Bump hf-doc-builder
* Add the check * add missing ckpts * add a list to ignore * call the added check script * better regex pattern Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
* Add translating guide
* Add meta proxy * Uses meta data to trace data dependent control-flow * Remove commented class * Handles torch creating functions * Added type annotation to fix tracing * Tracing works for everything but T5 and GPT-J * Almost all previously supported models pass * All architectures can be traced except T5 * Intermediate commit to have a trace of the comparison operators for HFProxy * Everything works, except loss computation * Everything works * Removed unused import * Overriden methods do not use underlying ops (linear and torch.matmul), and model attributes are copied to the traced version * Fix torch_matmul_override * Change attributes reference to deepcopy * Remove breakpoint and add torch_index_override * Small fix * Fix typo * Replace asserts by explicit exceptions
…#17036) * [FlaxSpeechEncoderDecoder] Fix bug in `decoder_module` * [FlaxEncoderDecoder] Fix bug in `decoder_module`
* add torch.no_grad when in eval mode * make style quality
* Clean up tests * Make fixup Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
* Propagate and fix imports
…uggingface#17046) * Update all examples to properly calculate progress bar
* First draft * Add YolosForObjectDetection * Make forward pass work * Add mid position embeddings * Add interpolation of position encodings * Add expected values * Add YOLOS to tests * Add integration test * Support tiny model as well * Support all models in conversion script * Remove mid_pe_size attribute * Make more tests pass * Add model to README and fix config * Add copied from statements * Rename base_model_prefix to vit * Add missing YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP * Apply suggestions from code review * Apply more suggestions from code review * Convert remaining checkpoints * Improve docstrings * Add YolosFeatureExtractor * Add feature extractor to docs * Add corresponding tests * Fix style * Fix docs * Apply suggestion from code review * Fix bad rebase * Fix some more bad rebase * Fix missing character * Improve docs and variable names Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
* Make sacremoses optional * Pickle
* Clean up setup.py * Trigger CI * Upgrade Python used
huggingface#16990) * [T5 Tokenizer] Model has no fixed position ids - there is no hardcoded max length * [T5 Tokenizer] Model has no fixed position ids - there is no hardcoded max length * correct t5 tokenizer * correct t5 tokenizer * fix test * Apply suggestions from code review Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * finish Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* [FlaxBert] Add ForCausalLM * make style * fix output attentions * Add RobertaForCausalLM * remove comment * fix fx-to-pt model loading * remove comment * add modeling tests * add enc-dec model tests * add big_bird * add electra * make style * make repo-consitency * add to docs * remove roberta test * quality * amend cookiecutter * fix attention_mask bug in flax bert model tester * tighten pt-fx thresholds to 1e-5 * add 'copied from' statements * amend 'copied from' statements * amend 'copied from' statements * quality
* move test model folders (TODO: fix imports and others) * fix (potentially partially) imports (in model test modules) * fix (potentially partially) imports (in tokenization test modules) * fix (potentially partially) imports (in feature extraction test modules) * fix import utils.test_modeling_tf_core * fix path ../fixtures/ * fix imports about generation.test_generation_flax_utils * fix more imports * fix fixture path * fix get_test_dir * update module_to_test_file * fix get_tests_dir from wrong transformers.utils * update config.yml (CircleCI) * fix style * remove missing imports * update new model script * update check_repo * update SPECIAL_MODULE_TO_TEST_MAP * fix style * add __init__ * update self-scheduled * fix add_new_model scripts * check one way to get location back * python setup.py build install * fix import in test auto * update self-scheduled.yml * update slack notification script * Add comments about artifact names * fix for yolos Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
* Make Trainer compatible with sharded checkpoints * Add doc
…17055) * Fix RNG reload in resume training from epoch checkpoint * Fix test
This PR fixes some code examples to pass the doctests for the pipeline and
AutoClasstutorials.I was unable to pass the audio code examples on my local machine because soundfile is not supported on M1 yet. I was able to run and reproduce the code snippets in Colab though so I think they should also pass on the CI.