• Romain Rigaux's avatar
    Docs copy button misses ... prefixed code (#6518) · cabfdfaf
    Romain Rigaux authored
    Tested in a local build of the docs.
    
    e.g. Just above https://huggingface.co/transformers/task_summary.html#causal-language-modeling
    
    Copy will copy the full code, e.g.
    
    for token in top_5_tokens:
         print(sequence.replace(tokenizer.mask_token, tokenizer.decode([token])))
    
    Instead of currently only:
    
    for token in top_5_tokens:
    
    
    >>> for token in top_5_tokens:
    ...     print(sequence.replace(tokenizer.mask_token, tokenizer.decode([token])))
    Distilled models are smaller than the models they mimic. Using them instead of the large versions would help reduce our carbon footprint.
    Distilled models are smaller than the models they mimic. Using them instead of the large versions would help increase our carbon footprint.
    Distilled models are smaller than the models they mimic. Using them instead of the large versions would help decrease our carbon footprint.
    Distilled models are smaller than the models they mimic. Using them instead of the large versions would help offset our carbon footprint.
    Distilled models are smaller than the models they mimic. Using them instead of the large versions would help improve our carbon footprint.
    
    Docs for the option fix:
    https://sphinx-copybutton.readthedocs.io/en/latest/
    cabfdfaf
conf.py 5.89 KB