Skip to content
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

Diff converter v2 #30868

Merged
merged 158 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 108 commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
f02e2fb
current working example!
ArthurZucker Apr 11, 2024
564813d
commit regex and result file
ArthurZucker Apr 11, 2024
bd59e58
update
ArthurZucker Apr 12, 2024
0bb0af9
nit
ArthurZucker Apr 12, 2024
1fa297c
push the conversion file
ArthurZucker Apr 12, 2024
eb5c2e2
oups
ArthurZucker Apr 12, 2024
e08d8eb
roadmap and nits
ArthurZucker Apr 12, 2024
92b6218
attempt diffs for 3 files
ArthurZucker Apr 12, 2024
d68766a
persimmon
ArthurZucker Apr 12, 2024
022727c
nit
ArthurZucker Apr 18, 2024
740e5bd
Merge branch 'main' of github.com:huggingface/transformers into refac…
ArthurZucker May 10, 2024
7545c5f
add diff file that is the same as the modeling_llama.py
ArthurZucker May 10, 2024
e467d2f
fix rope nits
ArthurZucker May 10, 2024
1632e0f
updates
ArthurZucker May 10, 2024
22ff159
updates with converted versions
ArthurZucker May 10, 2024
1aabcc1
give some breathing space to the code
ArthurZucker May 10, 2024
2a654ec
delete
ArthurZucker May 10, 2024
8752d35
update
ArthurZucker May 10, 2024
ca181ab
update
ArthurZucker May 10, 2024
3a3510a
push the actual result
ArthurZucker May 10, 2024
0782ffd
update regex patterns
ArthurZucker May 13, 2024
580fbe1
update regex patterns
ArthurZucker May 14, 2024
a47468a
fix some issues
ArthurZucker May 14, 2024
774a4af
fix some issues
ArthurZucker May 14, 2024
8fe406f
fix some issues
ArthurZucker May 15, 2024
d5c0004
updates
ArthurZucker May 15, 2024
d3ab98e
updates
ArthurZucker May 15, 2024
eaaf34f
updates
ArthurZucker May 15, 2024
45f20f5
updates
ArthurZucker May 15, 2024
daebeea
updates
ArthurZucker May 15, 2024
3dedb93
revert changes done to llama
ArthurZucker May 15, 2024
f3fe0b3
updates
ArthurZucker May 15, 2024
35576ac
update gemma
ArthurZucker May 15, 2024
709429a
updates
ArthurZucker May 15, 2024
cdb8c6b
oups
ArthurZucker May 15, 2024
ce615ff
current state
ArthurZucker May 16, 2024
7b79b4d
current state
ArthurZucker May 16, 2024
c9fea75
update
ArthurZucker May 16, 2024
8fe59a5
ouiiii
ArthurZucker May 16, 2024
fca954d
nit
ArthurZucker May 16, 2024
c44f827
clear diffs
ArthurZucker May 16, 2024
df9e783
nit
ArthurZucker May 16, 2024
c804b4b
fixup
ArthurZucker May 16, 2024
6a5264d
update
ArthurZucker May 16, 2024
f5ebef0
doc 🚀
ArthurZucker May 16, 2024
39ec61a
:fire:
ArthurZucker May 16, 2024
24e072e
for now use gemma
ArthurZucker May 16, 2024
a5b8780
deal with comments
ArthurZucker May 17, 2024
768801c
style
ArthurZucker May 17, 2024
274ac88
handle funtions
ArthurZucker May 17, 2024
e606c51
deal with assigns
ArthurZucker May 17, 2024
075be8c
todos
ArthurZucker May 17, 2024
67471e6
process inheritage
ArthurZucker May 18, 2024
39f696e
keep decorators?
ArthurZucker May 18, 2024
e3be54c
🤗
ArthurZucker May 18, 2024
65a00ce
deal with duplicates
ArthurZucker May 18, 2024
292e573
fixup
ArthurZucker May 18, 2024
6c09d23
correctly remove duplicate code
ArthurZucker May 18, 2024
52b70fd
run ruff post script
ArthurZucker May 18, 2024
4aec181
ruff deals pretty well with imports, let's leave it to him
ArthurZucker May 18, 2024
c45466e
ah maybe not lol
ArthurZucker May 18, 2024
f8587d7
for now remove all imports from child.
ArthurZucker May 18, 2024
07a90cc
nit
ArthurZucker May 18, 2024
b036a2a
conversion of llama
ArthurZucker May 18, 2024
0ced2bc
okay
ArthurZucker May 19, 2024
4e8a23e
convert starcoder2
ArthurZucker May 19, 2024
38286ad
Merge branch 'main' of github.com:huggingface/transformers into diff-…
ArthurZucker May 19, 2024
9dbb22a
synch with main
ArthurZucker May 19, 2024
d5b10f7
update llama diff
ArthurZucker May 19, 2024
29e3381
updates
ArthurZucker May 19, 2024
262c06b
https://docs.astral.sh/ruff/rules/redefined-while-unused/ fixes the i…
ArthurZucker May 20, 2024
fdc48d8
updates
ArthurZucker May 20, 2024
43d7809
okay actual state
ArthurZucker May 20, 2024
c8e64ed
non zero exit
ArthurZucker May 20, 2024
6147d3a
update!
ArthurZucker May 20, 2024
53a4ce8
revert unrelated
ArthurZucker May 21, 2024
0c7e43e
remove other diff files
ArthurZucker May 21, 2024
10b5591
updates
ArthurZucker May 21, 2024
adc3f92
cleanup
ArthurZucker May 21, 2024
3abd9f5
update
ArthurZucker May 21, 2024
380b87f
less diff!
ArthurZucker May 21, 2024
2df4ec6
stash
ArthurZucker May 22, 2024
337321e
current updates
ArthurZucker May 24, 2024
585686e
updates
ArthurZucker May 25, 2024
91f45f8
No need for call
ArthurZucker May 25, 2024
6fb42c2
finished fining deps
ArthurZucker May 25, 2024
b0853cb
update
ArthurZucker May 27, 2024
e62a5bb
current changes
ArthurZucker May 27, 2024
40c5e6d
current state
ArthurZucker May 27, 2024
49656b3
current state
ArthurZucker May 27, 2024
8256a73
new status
ArthurZucker May 27, 2024
4ead65b
nit
ArthurZucker May 27, 2024
b888fcd
finally
ArthurZucker May 27, 2024
80363e3
fixes
ArthurZucker May 27, 2024
7898d32
nits
ArthurZucker May 27, 2024
793f638
order is now expected
ArthurZucker May 28, 2024
d6ef9e8
use logger info instead of prints
ArthurZucker May 28, 2024
1ce5c1b
fixup
ArthurZucker May 28, 2024
0990414
up
ArthurZucker May 28, 2024
54af887
nit
ArthurZucker May 28, 2024
494e6ba
update
ArthurZucker May 28, 2024
6c48657
nits
ArthurZucker May 28, 2024
df19157
Merge branch 'main' of github.com:huggingface/transformers into diff-…
ArthurZucker May 28, 2024
f0068b7
update
ArthurZucker May 28, 2024
6c423ce
correct merge
ArthurZucker May 28, 2024
9d62ba5
update
ArthurZucker May 28, 2024
d1bc03b
update
ArthurZucker May 28, 2024
28b5596
update
ArthurZucker May 28, 2024
43d8d71
add warning
ArthurZucker May 28, 2024
85bccc4
update caution message
ArthurZucker May 28, 2024
f1e1dec
update
ArthurZucker May 28, 2024
7ea9bcd
better merging strategy
ArthurZucker May 28, 2024
0faa82d
copy class statements :wink
ArthurZucker May 28, 2024
1836a75
fixups
ArthurZucker May 28, 2024
1128029
nits
ArthurZucker May 28, 2024
42f640f
update
ArthurZucker May 29, 2024
ab3d410
Apply suggestions from code review
ArthurZucker May 29, 2024
ac0dc69
nits
ArthurZucker May 29, 2024
1fd611c
Merge branch 'diff-converter' of github.com:huggingface/transformers …
ArthurZucker May 29, 2024
85d2a50
smaller header
ArthurZucker May 29, 2024
dcee16e
do cleanup some stuff
ArthurZucker May 29, 2024
0f4e05f
even simpler header?
ArthurZucker May 29, 2024
058b6fa
fixup
ArthurZucker May 29, 2024
e3e6cca
updates
ArthurZucker May 29, 2024
331d8a4
ruff
ArthurZucker May 29, 2024
9828ffc
update examples
ArthurZucker May 29, 2024
5a1cccd
nit
ArthurZucker May 29, 2024
98c0a91
TODO
ArthurZucker May 29, 2024
6207b52
state
ArthurZucker May 30, 2024
64422e5
OUUUUUUF
ArthurZucker May 30, 2024
8a85473
current state
ArthurZucker May 30, 2024
513b933
nits
ArthurZucker May 30, 2024
751c4db
final state
ArthurZucker May 30, 2024
16b6aed
add a readme
ArthurZucker May 30, 2024
2e74992
fixup
ArthurZucker May 30, 2024
fa8a86c
Merge branch 'main' of github.com:huggingface/transformers into diff-…
ArthurZucker May 30, 2024
065cd1a
remove diff llama
ArthurZucker May 30, 2024
e1b0262
fix
ArthurZucker May 30, 2024
d7355db
nit
ArthurZucker May 30, 2024
c27e85c
dummy noy funny
ArthurZucker May 30, 2024
fc3c9e7
ruff format tests src utils --check
ArthurZucker May 30, 2024
ecc0aaa
everless diffs
ArthurZucker May 30, 2024
5797c42
less diffs and fix test
ArthurZucker May 30, 2024
54764f5
fixes
ArthurZucker May 30, 2024
0422b9c
naming nit?
ArthurZucker May 30, 2024
d014449
update converter and add supper example
ArthurZucker May 31, 2024
f124cf9
nits
ArthurZucker May 31, 2024
07c2aa9
updated for function signatures
ArthurZucker May 31, 2024
2b96630
update
ArthurZucker May 31, 2024
151cd71
update
ArthurZucker May 31, 2024
03ac95c
add converted dummies
ArthurZucker May 31, 2024
e782306
autoformat
ArthurZucker May 31, 2024
1839193
single target assign fix
ArthurZucker May 31, 2024
d9e1bf4
fixup
ArthurZucker May 31, 2024
3eb121c
fix some imports
ArthurZucker May 31, 2024
63b1bc1
fixes
ArthurZucker May 31, 2024
f667a9a
don't push them
ArthurZucker May 31, 2024
969cdbf
`# noqa: F841`
ArthurZucker May 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions src/transformers/models/gemma/configuration_gemma.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
# Copyright 2024 Google Inc. 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.
Expand All @@ -12,27 +13,20 @@
# 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.
"""Gemma model configuration"""

from ...configuration_utils import PretrainedConfig
from ...utils import logging


logger = logging.get_logger(__name__)
from transformers import PretrainedConfig


class GemmaConfig(PretrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GemmaModel`]. It is used to instantiate an Gemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma-7B.

e.g. [google/gemma-7b](https://huggingface.co/google/gemma-7b)

Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.


Args:
vocab_size (`int`, *optional*, defaults to 256000):
Vocabulary size of the Gemma model. Defines the number of different tokens that can be represented by the
Expand Down Expand Up @@ -83,20 +77,15 @@ class GemmaConfig(PretrainedConfig):
Whether to use a bias in the query, key, value and output projection layers during self-attention.
attention_dropout (`float`, *optional*, defaults to 0.0):
The dropout ratio for the attention probabilities.

```python
>>> from transformers import GemmaModel, GemmaConfig

>>> # Initializing a Gemma gemma-7b style configuration
>>> configuration = GemmaConfig()

>>> # Initializing a model from the gemma-7b style configuration
>>> model = GemmaModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```"""

model_type = "gemma"
keys_to_ignore_at_inference = ["past_key_values"]

Expand Down
Loading
Loading