-
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
Granite language models #31502
Merged
Merged
Granite language models #31502
Changes from 4 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
750ca7f
first commit
mayank31398 3b26730
drop tokenizer
mayank31398 9c017b0
drop tokenizer
mayank31398 876f4b5
drop tokenizer
mayank31398 0f716ec
Merge branch 'main' into granite
mayank31398 e3cdcaf
drop convert
mayank31398 3e4391e
granite
mayank31398 6f0cf35
drop tokenization test
mayank31398 2d1a58c
mup
mayank31398 ac560ae
fix
mayank31398 78c81a0
reformat
mayank31398 3b6c755
reformat
mayank31398 f46bf82
reformat
mayank31398 272af5c
fix docs
mayank31398 c9b2288
stop checking for checkpoint
mayank31398 19ec830
update support
mayank31398 a9dba03
attention multiplier
mayank31398 df90fbd
update model
mayank31398 c3369a0
tiny drop
mayank31398 6a7c814
saibo drop
mayank31398 dad1e4a
skip test
mayank31398 5cba841
fix test
mayank31398 e8f5886
fix test
mayank31398 1678792
drop
mayank31398 9498556
drop useless imports
mayank31398 039b377
update docs
mayank31398 1bea763
Merge branch 'main' into granite
mayank31398 2a9d734
Merge branch 'main' into granite
mayank31398 2442492
drop flash function
mayank31398 2efe0a6
copied from
mayank31398 8da50b5
drop pretraining tp
mayank31398 73d4f2d
drop pretraining tp
mayank31398 5f02075
drop pretraining tp
mayank31398 de33d60
drop unused import
mayank31398 42035c4
drop code path
mayank31398 f833ca6
change name
mayank31398 5ca5b08
softmax scale
mayank31398 abb359d
head dim
mayank31398 cfa8210
drop legacy cache
mayank31398 b1dad99
rename params
mayank31398 79bdf6b
cleanup
mayank31398 91a0253
Merge branch 'main' into granite
mayank31398 7df943f
fix copies
mayank31398 18d577d
comments
mayank31398 90c7906
add back legacy cache
mayank31398 a765b89
multipliers
mayank31398 ce070ad
multipliers
mayank31398 8b1b7e0
multipliers
mayank31398 fcc7bf7
text fix
mayank31398 bd6bee6
Merge branch 'main' into granite
mayank31398 37eb40f
fix copies
mayank31398 d743ff7
Merge branch 'main' into granite
mayank31398 1142dbb
merge
mayank31398 c3185de
multipliers
mayank31398 6ccf5b5
attention multiplier
mayank31398 52440ad
drop unused imports
mayank31398 b39cb7d
Merge branch 'main' into granite
mayank31398 6fa1774
Merge branch 'main' into granite
mayank31398 46524c7
Merge branch 'main' into granite
mayank31398 71c2cde
fix
mayank31398 fe64841
fix
mayank31398 559204d
fix
mayank31398 b64c16d
move rope?
mayank31398 cd9a911
Update src/transformers/models/granite/configuration_granite.py
mayank31398 124065c
fix
mayank31398 02c1073
Update src/transformers/models/granite/modeling_granite.py
mayank31398 8c9112f
fix
mayank31398 9493a86
fix
mayank31398 4932097
fix
mayank31398 b7fe0d3
fix
mayank31398 fa5550a
Merge branch 'main' into granite
mayank31398 1eeab96
fix-copies
mayank31398 6a13285
Merge branch 'main' into granite
mayank31398 7d68382
torch rmsnorm
mayank31398 4a4a581
add authors
mayank31398 57a5b9e
Merge branch 'main' into granite
mayank31398 c03e395
change model path
mayank31398 ffed3d1
fix
mayank31398 a7fbd30
test
mayank31398 8f00c1b
drop static cache test
mayank31398 586fdf1
uupdate readme
mayank31398 dc9faaa
drop non-causal
mayank31398 545449c
readme
mayank31398 5e5cad9
drop useless imports
mayank31398 24029b2
Update docs/source/en/model_doc/granite.md
mayank31398 eaeff2a
Update docs/source/en/model_doc/granite.md
mayank31398 ee9c0f6
Update docs/source/en/model_doc/granite.md
mayank31398 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
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,63 @@ | ||
<!--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. | ||
|
||
--> | ||
|
||
# Granite | ||
|
||
## Overview | ||
|
||
The Granite 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>). | ||
|
||
|
||
## GraniteConfig | ||
|
||
[[autodoc]] GraniteConfig | ||
|
||
## GraniteModel | ||
|
||
[[autodoc]] GraniteModel | ||
- forward | ||
|
||
## GraniteForCausalLM | ||
|
||
[[autodoc]] GraniteForCausalLM | ||
- forward | ||
|
||
## GraniteForSequenceClassification | ||
|
||
[[autodoc]] GraniteForSequenceClassification | ||
- forward | ||
|
||
## GraniteForQuestionAnswering | ||
|
||
[[autodoc]] GraniteForQuestionAnswering | ||
- forward | ||
|
||
## GraniteForTokenClassification | ||
|
||
[[autodoc]] GraniteForTokenClassification | ||
- 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 |
---|---|---|
|
@@ -122,6 +122,7 @@ | |
levit, | ||
lilt, | ||
llama, | ||
granite, | ||
llava, | ||
llava_next, | ||
longformer, | ||
|
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,63 @@ | ||
# Copyright 2024 EleutherAI and The HuggingFace Inc. 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_granite": ["GraniteConfig"], | ||
} | ||
|
||
try: | ||
if not is_torch_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
_import_structure["modeling_granite"] = [ | ||
"GraniteForCausalLM", | ||
"GraniteModel", | ||
"GranitePreTrainedModel", | ||
"GraniteForSequenceClassification", | ||
"GraniteForQuestionAnswering", | ||
"GraniteForTokenClassification", | ||
] | ||
|
||
if TYPE_CHECKING: | ||
from .configuration_granite import GraniteConfig | ||
|
||
try: | ||
if not is_torch_available(): | ||
raise OptionalDependencyNotAvailable() | ||
except OptionalDependencyNotAvailable: | ||
pass | ||
else: | ||
from .modeling_granite import ( | ||
GraniteForCausalLM, | ||
GraniteForQuestionAnswering, | ||
GraniteForSequenceClassification, | ||
GraniteForTokenClassification, | ||
GraniteModel, | ||
GranitePreTrainedModel, | ||
) | ||
|
||
else: | ||
import sys | ||
|
||
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__) |
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.
this needs to be filled
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.
currently, the paper is not out @ArthurZucker
should we put the old Granite Code paper as a placeholder?
even though that model is using Llama class?
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.
as you want we can wait until paper is out or if you want to release the checkpoints first we can say it's a model release for now!