Skip to content

Commit

Permalink
Doc new front github actions (#14512)
Browse files Browse the repository at this point in the history
* Doc new front github actions

* Fix docstring

* Fix feature extraction utils import (#14515)

* Address Julien's comments

* Push to doc-builder

* Ready for merge
  • Loading branch information
LysandreJik authored Nov 29, 2021
1 parent 765f6a4 commit de3d874
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build documentation

on:
push:
branches:
- master

jobs:
build_and_package:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
with:
repository: 'huggingface/doc-builder'
token: ${{ secrets.HUGGINGFACE_PUSH }}

- name: Clone transformers
run: |
git clone https://github.com/huggingface/transformers
- name: Setup environment
run: |
sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
pip install -e .
pip install git+https://github.com/huggingface/transformers#egg=transformers[dev]
export TORCH_VERSION=$(python -c "from torch import version; print(version.__version__.split('+')[0])")
pip install torch-scatter -f https://data.pyg.org/whl/torch-${TORCH_VERSION}+cpu.html
pip install torchvision
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
sudo apt install tesseract-ocr
pip install pytesseract
pip install pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com
- name: Setup git
run: |
git config --global user.name "Hugging Face"
git config --global user.email transformers@huggingface.co
- name: Make documentation
run: |
python src/build.py transformers ./transformers/docs/source
- name: Push to repository
run: |
git add build
git commit -m "Updated with commit ${{ github.sha }}"
git push origin main
6 changes: 4 additions & 2 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
"DataCollatorWithPadding",
"default_data_collator",
],
"feature_extraction_sequence_utils": ["BatchFeature", "SequenceFeatureExtractor"],
"feature_extraction_sequence_utils": ["SequenceFeatureExtractor"],
"feature_extraction_utils": ["BatchFeature"],
"file_utils": [
"CONFIG_NAME",
"MODEL_CARD_NAME",
Expand Down Expand Up @@ -2059,9 +2060,10 @@
DataCollatorWithPadding,
default_data_collator,
)
from .feature_extraction_sequence_utils import SequenceFeatureExtractor

# Feature Extractor
from .feature_extraction_utils import BatchFeature, SequenceFeatureExtractor
from .feature_extraction_utils import BatchFeature

# Files and general utilities
from .file_utils import (
Expand Down
5 changes: 3 additions & 2 deletions src/transformers/models/beit/feature_extraction_beit.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ class BeitFeatureExtractor(FeatureExtractionMixin, ImageFeatureExtractionMixin):
r"""
Constructs a BEiT feature extractor.
This feature extractor inherits from :class:`~transformers.FeatureExtractionMixin` which contains most of the main
methods. Users should refer to this superclass for more information regarding those methods.
This feature extractor inherits from :class:`~transformers.feature_extraction_utils.FeatureExtractionMixin` which
contains most of the main methods. Users should refer to this superclass for more information regarding those
methods.
Args:
do_resize (:obj:`bool`, `optional`, defaults to :obj:`True`):
Expand Down

0 comments on commit de3d874

Please sign in to comment.