Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
84beb8a4
Unverified
Commit
84beb8a4
authored
Aug 23, 2022
by
Yih-Dar
Committed by
GitHub
Aug 23, 2022
Browse files
Unpin detectron2 (#18727)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
d90a36d1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
20 deletions
+6
-20
.circleci/config.yml
.circleci/config.yml
+1
-1
docker/transformers-all-latest-gpu/Dockerfile
docker/transformers-all-latest-gpu/Dockerfile
+1
-1
docker/transformers-doc-builder/Dockerfile
docker/transformers-doc-builder/Dockerfile
+1
-1
docker/transformers-pytorch-gpu/Dockerfile
docker/transformers-pytorch-gpu/Dockerfile
+1
-1
src/transformers/models/layoutlmv2/modeling_layoutlmv2.py
src/transformers/models/layoutlmv2/modeling_layoutlmv2.py
+2
-16
No files found.
.circleci/config.yml
View file @
84beb8a4
...
@@ -1006,7 +1006,7 @@ jobs:
...
@@ -1006,7 +1006,7 @@ jobs:
# The commit `36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0` in `detectron2` break things.
# The commit `36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0` in `detectron2` break things.
# See https://github.com/facebookresearch/detectron2/commit/36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0#comments.
# See https://github.com/facebookresearch/detectron2/commit/36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0#comments.
# TODO: Revert this change back once the above issue is fixed.
# TODO: Revert this change back once the above issue is fixed.
-
run
:
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git
@5aeb252b194b93dc2879b4ac34bc51a31b5aee13
'
-
run
:
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
-
run
:
sudo apt install tesseract-ocr
-
run
:
sudo apt install tesseract-ocr
-
run
:
pip install pytesseract
-
run
:
pip install pytesseract
-
save_cache
:
-
save_cache
:
...
...
docker/transformers-all-latest-gpu/Dockerfile
View file @
84beb8a4
...
@@ -40,7 +40,7 @@ RUN python3 -m pip uninstall -y flax jax
...
@@ -40,7 +40,7 @@ RUN python3 -m pip uninstall -y flax jax
RUN
python3
-m
pip
install
--no-cache-dir
torch-scatter
-f
https://data.pyg.org/whl/torch-
$(
python3
-c
"from torch import version; print(version.__version__.split('+')[0])"
)
+
$CUDA
.html
RUN
python3
-m
pip
install
--no-cache-dir
torch-scatter
-f
https://data.pyg.org/whl/torch-
$(
python3
-c
"from torch import version; print(version.__version__.split('+')[0])"
)
+
$CUDA
.html
RUN
python3
-m
pip
install
--no-cache-dir
intel_extension_for_pytorch
==
$INTEL_TORCH_EXT
+cpu
-f
https://software.intel.com/ipex-whl-stable
RUN
python3
-m
pip
install
--no-cache-dir
intel_extension_for_pytorch
==
$INTEL_TORCH_EXT
+cpu
-f
https://software.intel.com/ipex-whl-stable
RUN
python3
-m
pip
install
--no-cache-dir
git+https://github.com/facebookresearch/detectron2.git
@5aeb252b194b93dc2879b4ac34bc51a31b5aee13
pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN
python3
-m
pip
install
--no-cache-dir
git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN
python3
-m
pip
install
-U
"itsdangerous<2.1.0"
RUN
python3
-m
pip
install
-U
"itsdangerous<2.1.0"
RUN
python3
-m
pip
install
--no-cache-dir
git+https://github.com/huggingface/accelerate@main#egg
=
accelerate
RUN
python3
-m
pip
install
--no-cache-dir
git+https://github.com/huggingface/accelerate@main#egg
=
accelerate
...
...
docker/transformers-doc-builder/Dockerfile
View file @
84beb8a4
...
@@ -11,7 +11,7 @@ RUN apt-get -y update && apt-get install -y libsndfile1-dev && apt install -y te
...
@@ -11,7 +11,7 @@ RUN apt-get -y update && apt-get install -y libsndfile1-dev && apt install -y te
RUN
python3
-m
pip
install
--no-cache-dir
./transformers[deepspeed]
RUN
python3
-m
pip
install
--no-cache-dir
./transformers[deepspeed]
RUN
python3
-m
pip
install
--no-cache-dir
torch-scatter
-f
https://data.pyg.org/whl/torch-
$(
python
-c
"from torch import version; print(version.__version__.split('+')[0])"
)
+cpu.html
RUN
python3
-m
pip
install
--no-cache-dir
torch-scatter
-f
https://data.pyg.org/whl/torch-
$(
python
-c
"from torch import version; print(version.__version__.split('+')[0])"
)
+cpu.html
RUN
python3
-m
pip
install
--no-cache-dir
torchvision git+https://github.com/facebookresearch/detectron2.git
@5aeb252b194b93dc2879b4ac34bc51a31b5aee13
pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN
python3
-m
pip
install
--no-cache-dir
torchvision git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN
python3
-m
pip
install
--no-cache-dir
pytorch-quantization
--extra-index-url
https://pypi.ngc.nvidia.com
RUN
python3
-m
pip
install
--no-cache-dir
pytorch-quantization
--extra-index-url
https://pypi.ngc.nvidia.com
RUN
python3
-m
pip
install
-U
"itsdangerous<2.1.0"
RUN
python3
-m
pip
install
-U
"itsdangerous<2.1.0"
...
...
docker/transformers-pytorch-gpu/Dockerfile
View file @
84beb8a4
...
@@ -23,7 +23,7 @@ RUN [ ${#TORCH_AUDIO} -gt 0 ] && VERSION='torchaudio=='TORCH_AUDIO'.*' || VERSI
...
@@ -23,7 +23,7 @@ RUN [ ${#TORCH_AUDIO} -gt 0 ] && VERSION='torchaudio=='TORCH_AUDIO'.*' || VERSI
RUN
python3
-m
pip uninstall
-y
tensorflow flax
RUN
python3
-m
pip uninstall
-y
tensorflow flax
RUN
python3
-m
pip
install
--no-cache-dir
torch-scatter
-f
https://data.pyg.org/whl/torch-
$(
python3
-c
"from torch import version; print(version.__version__.split('+')[0])"
)
+cu113.html
RUN
python3
-m
pip
install
--no-cache-dir
torch-scatter
-f
https://data.pyg.org/whl/torch-
$(
python3
-c
"from torch import version; print(version.__version__.split('+')[0])"
)
+cu113.html
RUN
python3
-m
pip
install
--no-cache-dir
git+https://github.com/facebookresearch/detectron2.git
@5aeb252b194b93dc2879b4ac34bc51a31b5aee13
pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN
python3
-m
pip
install
--no-cache-dir
git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
RUN
python3
-m
pip
install
-U
"itsdangerous<2.1.0"
RUN
python3
-m
pip
install
-U
"itsdangerous<2.1.0"
# When installing in editable mode, `transformers` is not recognized as a package.
# When installing in editable mode, `transformers` is not recognized as a package.
...
...
src/transformers/models/layoutlmv2/modeling_layoutlmv2.py
View file @
84beb8a4
...
@@ -43,26 +43,12 @@ from ...utils import (
...
@@ -43,26 +43,12 @@ from ...utils import (
from
.configuration_layoutlmv2
import
LayoutLMv2Config
from
.configuration_layoutlmv2
import
LayoutLMv2Config
logger
=
logging
.
get_logger
(
__name__
)
# soft dependency
# soft dependency
if
is_detectron2_available
():
if
is_detectron2_available
():
import
detectron2
import
detectron2
try
:
from
detectron2.modeling
import
META_ARCH_REGISTRY
from
detectron2.modeling
import
META_ARCH_REGISTRY
except
ImportError
:
# NOTE: This is a temporary fix because currently there are
logger
=
logging
.
get_logger
(
__name__
)
# import problems when using detectron2 from master (see issues below)
# it's better to have a silent error here in case someone imports this file
# without using the model which without this hack would break.
logger
.
warning
(
"The detectron2 import seems to be broken. See:"
"https://github.com/facebookresearch/detectron2/issues/4489 or"
"https://github.com/facebookresearch/detectron2/issues/4487"
)
pass
_CHECKPOINT_FOR_DOC
=
"microsoft/layoutlmv2-base-uncased"
_CHECKPOINT_FOR_DOC
=
"microsoft/layoutlmv2-base-uncased"
_CONFIG_FOR_DOC
=
"LayoutLMv2Config"
_CONFIG_FOR_DOC
=
"LayoutLMv2Config"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment