yichang.zyc 3 years ago
parent
commit
a05f37f826
11 changed files with 46 additions and 0 deletions
  1. +2
    -0
      modelscope/models/multi_modal/clip/__init__.py
  2. +15
    -0
      modelscope/models/multi_modal/clip/model.py
  3. +2
    -0
      modelscope/models/multi_modal/ofa/__init__.py
  4. +14
    -0
      modelscope/models/multi_modal/ofa/resnet.py
  5. +1
    -0
      modelscope/models/multi_modal/ofa/utils/__init__.py
  6. +2
    -0
      modelscope/models/multi_modal/ofa_for_text_to_image_synthesis_model.py
  7. +2
    -0
      modelscope/preprocessors/ofa/utils/collate.py
  8. +2
    -0
      modelscope/preprocessors/ofa/utils/random_help.py
  9. +2
    -0
      modelscope/trainers/multi_modal/clip/__init__.py
  10. +2
    -0
      modelscope/trainers/multi_modal/clip/clip_trainer.py
  11. +2
    -0
      modelscope/trainers/multi_modal/clip/clip_trainer_utils.py

+ 2
- 0
modelscope/models/multi_modal/clip/__init__.py View File

@@ -1 +1,3 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

from .model import CLIPForMultiModalEmbedding

+ 15
- 0
modelscope/models/multi_modal/clip/model.py View File

@@ -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
from collections import OrderedDict
from typing import Any, Dict, Iterable, List, Tuple, Union


+ 2
- 0
modelscope/models/multi_modal/ofa/__init__.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

from .modeling_ofa import OFADecoder, OFAEncoder, OFAModel, OFAPreTrainedModel
from .tokenization_ofa import OFATokenizer, OFATokenizerZH
from .tokenization_ofa_fast import OFATokenizerFast, OFATokenizerZHFast

+ 14
- 0
modelscope/models/multi_modal/ofa/resnet.py View File

@@ -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.nn as nn



+ 1
- 0
modelscope/models/multi_modal/ofa/utils/__init__.py View File

@@ -0,0 +1 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

+ 2
- 0
modelscope/models/multi_modal/ofa_for_text_to_image_synthesis_model.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import os
from typing import Any, Dict



+ 2
- 0
modelscope/preprocessors/ofa/utils/collate.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import numpy as np
import torch



+ 2
- 0
modelscope/preprocessors/ofa/utils/random_help.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import torch

try:


+ 2
- 0
modelscope/trainers/multi_modal/clip/__init__.py View File

@@ -1 +1,3 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

from .clip_trainer import CLIPTrainer

+ 2
- 0
modelscope/trainers/multi_modal/clip/clip_trainer.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import os
from typing import Dict, Optional



+ 2
- 0
modelscope/trainers/multi_modal/clip/clip_trainer_utils.py View File

@@ -1,3 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.

import os
import random



Loading…
Cancel
Save