Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b927cf7

Browse files
authored
[clap] Add clap (PaddlePaddle#6028)
* Add clap * Add unitest * Add more unitests * reformat * Remove unused comments * Add copyright info * Fix return_dict bug * Update docs * Add ci requests * Fix paddle tensor * Fix floor and repeat * Fix modeling * Update comments
1 parent b088618 commit b927cf7

19 files changed

Lines changed: 6081 additions & 4 deletions

β€Žpaddlenlp/transformers/__init__.pyβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@
247247
from .chatglm.configuration import *
248248
from .chatglm.modeling import *
249249
from .chatglm.tokenizer import *
250+
from .clap.configuration import *
251+
from .clap.feature_extraction import *
252+
from .clap.modeling import *
253+
from .clap.processing import *
250254

251255
# For faster tokenizer
252256
from ..utils.import_utils import is_fast_tokenizer_available

β€Žpaddlenlp/transformers/audio_utils.pyβ€Ž

Lines changed: 694 additions & 0 deletions
Large diffs are not rendered by default.

β€Žpaddlenlp/transformers/auto/processing.pyβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
("CLIPProcessor", "clip"),
3535
("ErnieViLProcessor", "ernie_vil"),
3636
("CLIPSegProcessor", "clipseg"),
37+
("ClapProcessor", "clap"),
3738
]
3839
)
3940

β€Žpaddlenlp/transformers/blip_2/configuration.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ def __init__(
216216
encoder_hidden_size=1408,
217217
**kwargs,
218218
):
219+
kwargs["return_dict"] = kwargs.pop("return_dict", True)
219220
super().__init__(pad_token_id=pad_token_id, **kwargs)
220221

221222
self.vocab_size = vocab_size
@@ -325,7 +326,6 @@ def __init__(self, vision_config=None, qformer_config=None, text_config=None, nu
325326
self.qformer_config.encoder_hidden_size = self.vision_config.hidden_size
326327
self.use_decoder_only_language_model = self.text_config.model_type in MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
327328
# CONFIGURATION_MODEL_MAPPING = get_init_configurations()
328-
# breakpoint()
329329
# self.use_decoder_only_language_model = self.text_config.model_type in CONFIGURATION_MODEL_MAPPING
330330
self.initializer_factor = 1.0
331331
self.initializer_range = 0.02
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

β€Žpaddlenlp/transformers/clap/configuration.pyβ€Ž

Lines changed: 464 additions & 0 deletions
Large diffs are not rendered by default.

β€Žpaddlenlp/transformers/clap/feature_extraction.pyβ€Ž

Lines changed: 358 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
Β (0)