Skip to content

fix CI for Paddle#72862 #10897

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

Open
wants to merge 2 commits into
base: incubate/paddlenlp-fleety_20250421
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions paddlenlp/transformers/convbert/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def __init__(self, hidden_size, hidden_act):
self.act = get_activation(hidden_act)

def forward(self, discriminator_hidden_states):
discriminator_hidden_states = discriminator_hidden_states[0]
hidden_states = self.dense(discriminator_hidden_states)
hidden_states = self.act(hidden_states)
logits = self.dense_prediction(hidden_states).squeeze()
Expand Down
1 change: 1 addition & 0 deletions paddlenlp/transformers/rembert/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def __init__(self, config: RemBertConfig):
self.dropout = nn.Dropout(config.hidden_dropout_prob)

def forward(self, hidden_states, input_tensor):
hidden_states = hidden_states[0]
hidden_states = self.dense(hidden_states)
hidden_states = self.dropout(hidden_states)
hidden_states = self.layer_norm(hidden_states + input_tensor)
Expand Down
2 changes: 1 addition & 1 deletion paddlenlp/utils/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def adamw_python(
mom1 = beta1 * mom1 + (1.0 - beta1) * grad
mom2 = beta2 * mom2 + (1.0 - beta2) * (grad * grad).mean()
denom = mom2.sqrt() / (1.0 - beta2_pow).sqrt() + epsilon
p += (moment1 / denom) * (-(lr / (1.0 - beta1_pow)))
p += (mom1 / denom) * (-(lr / (1.0 - beta1_pow)))
if master_weight is not None:
master_weight[:] = p
param[:] = p.astype(param.dtype)
Expand Down
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ colorama
seqeval
dill<0.3.5
multiprocess<=0.70.12.2
datasets >= 2.0.0
datasets==3.6.0
pyarrow==20.0.0
tqdm
paddlefsl
sentencepiece
Expand All @@ -21,7 +22,7 @@ typer
rich
safetensors
fast_dataindex>=0.1.1 ; platform_system == "Linux"
aistudio-sdk>=0.1.3
aistudio-sdk>=0.3.0
jinja2
regex
numpy<=1.26.4
Expand All @@ -30,3 +31,4 @@ ml_dtypes
tokenizers<=0.20.3; python_version<="3.8"
tokenizers>=0.21,<0.22; python_version>"3.8"
omegaconf
einops>=0.7.0
4 changes: 4 additions & 0 deletions tests/transformers/bloom/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ def test_inputs_embeds(self):

with paddle.no_grad():
embeds_output = model(**inputs)
if isinstance(ids_output, tuple):
ids_output = ids_output[0]
if isinstance(embeds_output, tuple):
embeds_output = embeds_output[0]

self.assertTrue(paddle.allclose(ids_output, embeds_output, rtol=1e-4, atol=1e-4))

Expand Down
4 changes: 4 additions & 0 deletions tests/transformers/mbart/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ def test_inputs_embeds_for_mbart(self):

with paddle.no_grad():
embeds_output = model(**inputs)
if isinstance(ids_output, tuple):
ids_output = ids_output[0]
if isinstance(embeds_output, tuple):
embeds_output = embeds_output[0]

self.assertTrue(paddle.allclose(ids_output, embeds_output, rtol=1e-4, atol=1e-4))

Expand Down
Loading