-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
feat: adding mplugdocowl #31059
Draft
danaaubakirova
wants to merge
55
commits into
huggingface:main
Choose a base branch
from
danaaubakirova:mplugdocowl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: adding mplugdocowl #31059
Changes from 7 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
b311e5e
feat: adding mplugdocowl
danaaubakirova aa0ec04
feat: added separate file for the mPLUGDocOwl language model
danaaubakirova cc7e9b3
feat: added vision encoder for mplugdocowl
danaaubakirova 204daba
fix: changed the attention mechanism in clip vision, renamed to MPLUG…
danaaubakirova 6e144e5
feat: added hreducer and new things in config, changed vision embeddi…
danaaubakirova 9f94d2c
fix: converted hreducer module related tensors to contiguous
danaaubakirova 19ffc83
feat: added shape adaptive module
danaaubakirova 85dce8d
feat: added new image_processing script
danaaubakirova 0f5fb87
Update src/transformers/models/mplugdocowl/image_processing_mplugdoco…
danaaubakirova 53aca6d
fix: small fix
danaaubakirova cb25b05
Merge branch 'mplugdocowl' of github.com:danaaubakirova/transformers …
danaaubakirova 1debae3
feat: added the additional keys to the output of the data
danaaubakirova 66b849d
feat: made major modifications to image_processing script. added the …
danaaubakirova 1716668
feat: refactored shape_adaptive_cropping function and resolved the is…
danaaubakirova 452ebf5
feat: testing forward
danaaubakirova 1e7f386
feat: corrected image tag
danaaubakirova 8577f35
fix: attention mask handling is fixed, .forward works
danaaubakirova f546fbc
feat: updates in vision architecture
danaaubakirova edc358d
Update src/transformers/models/mplugdocowl/language_modeling_mplugdoc…
danaaubakirova 9003d59
fix: renaming the model
danaaubakirova 9f688d9
grand fix: fixed hreducer, the firstgenerated token is correct. forw…
danaaubakirova 30c8a2b
fix: need to fix prepare_inputs_for_generation()
danaaubakirova 5483f82
fix: fixed prepare_inputs_for_generation()
danaaubakirova 413ddad
Merge branch 'main' into mplugdocowl
danaaubakirova 7546063
testing phase
danaaubakirova e3cc222
removed copied from ..
danaaubakirova 4f4f219
small fixes
danaaubakirova 661bd75
removed some things from the config
danaaubakirova 8aded38
small fixes
danaaubakirova 19e0a35
update
danaaubakirova 8300463
small fix
danaaubakirova f0c87d8
Update tests/models/mplugdocowl/test_modeling_mplugdocowl.py
danaaubakirova b75b2b9
Update src/transformers/models/mplugdocowl/modeling_mplugdocowl.py
danaaubakirova 2aae5ca
Update tests/models/mplugdocowl/test_modeling_mplugdocowl.py
danaaubakirova 105b5e1
Update tests/models/mplugdocowl/test_modeling_mplugdocowl.py
danaaubakirova 7a2f434
Update tests/models/mplugdocowl/test_modeling_mplugdocowl.py
danaaubakirova 205e345
Update tests/models/mplugdocowl/test_modeling_mplugdocowl.py
danaaubakirova 0f5ba22
Update src/transformers/models/mplugdocowl/processing_mplugdocowl.py
danaaubakirova c0e241a
Update src/transformers/models/mplugdocowl/processing_mplugdocowl.py
danaaubakirova 1555e04
Update src/transformers/models/mplugdocowl/processing_mplugdocowl.py
danaaubakirova 219d866
Update src/transformers/models/mplugdocowl/image_processing_mplugdoco…
danaaubakirova 4600f75
Update src/transformers/models/mplugdocowl/convert_mplugdocowl_weight…
danaaubakirova cb55d49
Update src/transformers/models/mplugdocowl/language_modeling_mplugdoc…
danaaubakirova c4c711c
model card is updated. tips to be added
danaaubakirova 3007178
fix
danaaubakirova cdcf2f6
added documentation,updated rotary embedding function, added ModelTest
danaaubakirova cc7681f
updated
danaaubakirova c8c8b14
fixes
danaaubakirova 6897da5
update
danaaubakirova 0f0e517
deleted test.py
danaaubakirova 046e2bd
filled in the types and docstrings
danaaubakirova 1c498fc
nit
danaaubakirova 6b5af5e
fixes
danaaubakirova e8cebb5
update
danaaubakirova dd0f8ce
new
danaaubakirova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!--Copyright 2024 The HuggingFace Team. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations under the License. | ||
|
||
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be | ||
rendered properly in your Markdown viewer. | ||
|
||
--> | ||
|
||
# mPLUGDocOwl | ||
|
||
## Overview | ||
|
||
The mPLUGDocOwl model was proposed in [<INSERT PAPER NAME HERE>](<INSERT PAPER LINK HERE>) by <INSERT AUTHORS HERE>. | ||
<INSERT SHORT SUMMARY HERE> | ||
|
||
The abstract from the paper is the following: | ||
|
||
*<INSERT PAPER ABSTRACT HERE>* | ||
|
||
Tips: | ||
|
||
<INSERT TIPS ABOUT MODEL HERE> | ||
|
||
This model was contributed by [INSERT YOUR HF USERNAME HERE](https://huggingface.co/<INSERT YOUR HF USERNAME HERE>). | ||
The original code can be found [here](<INSERT LINK TO GITHUB REPO HERE>). | ||
|
||
|
||
## MPLUGDocOwlConfig | ||
|
||
[[autodoc]] MPLUGDocOwlConfig | ||
|
||
## MPLUGDocOwlProcessor | ||
|
||
[[autodoc]] MPLUGDocOwlProcessor | ||
|
||
## MPLUGDocOwlForConditionalGeneration | ||
|
||
[[autodoc]] MPLUGDocOwlForConditionalGeneration | ||
- forward |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,7 @@ | |
lilt, | ||
llama, | ||
llava, | ||
mplugdocowl, | ||
llava_next, | ||
longformer, | ||
longt5, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2024 The HuggingFace Team. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
from typing import TYPE_CHECKING | ||
|
||
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available | ||
|
||
|
||
_import_structure = { | ||
"configuration_mplugdocowl": ["MPLUGDocOwlConfig"], | ||
"processing_mplugdocowl": ["MPLUGDocOwlProcessor"], | ||
} | ||
|
||
|
||
try: | ||
if not is_torch_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
_import_structure["modeling_mplugdocowl"] = [ | ||
"MPLUGDocOwlForConditionalGeneration", | ||
"MPLUGDocOwlPreTrainedModel", | ||
] | ||
|
||
|
||
if TYPE_CHECKING: | ||
from .configuration_mplugdocowl import MPLUGDocOwlConfig | ||
from .processing_mplugdocowl import MPLUGDocOwlProcessor | ||
|
||
try: | ||
if not is_torch_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
from .modeling_mplugdocowl import ( | ||
MPLUGDocOwlForConditionalGeneration, | ||
MPLUGDocOwlPreTrainedModel, | ||
) | ||
|
||
else: | ||
import sys | ||
|
||
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Todo
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.
still todo, add the paper authors, abstract, tips, your contributor hf handle, original gh repo
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.
almost done, tips need to be added