• Daniel Stancl's avatar
    Add `examples/run_ner_no_trainer.py` (#10902) · d7b50ce4
    Daniel Stancl authored
    * Add NER example with accelerate library
    
    * This commit contains the first (yet really unfinished)
    version of a script for showing how to train HuggingFace model
    with their new accelerate library.
    
    * Fix metric calculation
    
    * make style quality
    
    * mv ner_no_trainer to token-classification dir
    
    * Delete --debug flag from running script
    
    * hf_datasets -> raw_datasets
    
    * Make a few slight adjustments
    
    * Add an informative comment + rewrite a help comment
    
    * Change header
    
    * Fix a few things
    
    * Enforce to use fast tokenizers only
    
    * DataCollatorWithPadding -> DataCollatorForTokenClassification
    
    * Change bash script: python3 -> accelerate launch
    
    * make style
    
    * Add a few missing things (see below)
    
    * Add a max-lenghth padding to predictions and labels to
    enable accelerate gather functionality
    
    * Add PyTorch no trainer example to the example README.md
    
    * Remove --do-train from args as being redundant for now
    
    * DataCollatorWithPadding -> DataCollatorForTokenClassification
    
    * Remove some obsolete args.do_train conditions from the script
    
    * Delete --do_train from bash running script
    
    * Delete use_slow_tokenizer from args
    
    * Add unintentionally removed flag --label_all_tokens
    
    * Delete --debug flag from running script
    d7b50ce4
run_no_trainer.sh 828 Bytes