Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10340433master
| @@ -1 +1,3 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| from .model import CLIPForMultiModalEmbedding | from .model import CLIPForMultiModalEmbedding | ||||
| @@ -1,3 +1,18 @@ | |||||
| # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. | |||||
| # Copyright (c) 2018, NVIDIA CORPORATION. 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. | |||||
| import os | import os | ||||
| from collections import OrderedDict | from collections import OrderedDict | ||||
| from typing import Any, Dict, Iterable, List, Tuple, Union | from typing import Any, Dict, Iterable, List, Tuple, Union | ||||
| @@ -1,3 +1,5 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| from .modeling_ofa import OFADecoder, OFAEncoder, OFAModel, OFAPreTrainedModel | from .modeling_ofa import OFADecoder, OFAEncoder, OFAModel, OFAPreTrainedModel | ||||
| from .tokenization_ofa import OFATokenizer, OFATokenizerZH | from .tokenization_ofa import OFATokenizer, OFATokenizerZH | ||||
| from .tokenization_ofa_fast import OFATokenizerFast, OFATokenizerZHFast | from .tokenization_ofa_fast import OFATokenizerFast, OFATokenizerZHFast | ||||
| @@ -1,3 +1,17 @@ | |||||
| # Copyright 2022 OFA-Sys 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. | |||||
| import torch | import torch | ||||
| import torch.nn as nn | import torch.nn as nn | ||||
| @@ -0,0 +1 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| @@ -1,3 +1,5 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| import os | import os | ||||
| from typing import Any, Dict | from typing import Any, Dict | ||||
| @@ -1,3 +1,5 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| import numpy as np | import numpy as np | ||||
| import torch | import torch | ||||
| @@ -1,3 +1,5 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| import torch | import torch | ||||
| try: | try: | ||||
| @@ -1 +1,3 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| from .clip_trainer import CLIPTrainer | from .clip_trainer import CLIPTrainer | ||||
| @@ -1,3 +1,5 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| import os | import os | ||||
| from typing import Dict, Optional | from typing import Dict, Optional | ||||
| @@ -1,3 +1,5 @@ | |||||
| # Copyright (c) Alibaba, Inc. and its affiliates. | |||||
| import os | import os | ||||
| import random | import random | ||||