mohammed-aljafry commited on
Commit
8ca490f
·
verified ·
1 Parent(s): 0abf9da

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. modeling_interfuser.py +22 -12
  2. pytorch_model.bin +1 -1
modeling_interfuser.py CHANGED
@@ -1,22 +1,32 @@
1
 
2
  # -*- coding: utf-8 -*-
3
  # This file contains all custom class definitions required to run the Interfuser model.
4
- import torch
5
- from torch import nn
6
- import torch.nn.functional as F
7
- from transformers import PreTrainedModel, PretrainedConfig
8
- from functools import partial
9
  import math
10
- from collections import OrderedDict
11
  import copy
 
 
 
 
12
  from typing import Optional, List
13
- from torch import Tensor
14
 
15
- # ...
16
- # It's better to import from the original source if possible
17
- # For full portability, we define them here.
18
- from InterFuser.interfuser.timm.models.layers import to_2tuple
19
- from InterFuser.interfuser.timm.models.resnet import resnet50d, resnet26d, resnet18d
 
 
 
 
 
 
 
 
20
 
21
  # ==============================================================================
22
  # SECTION 1: ALL DEPENDENCY CLASSES FROM THE ORIGINAL CODE
 
1
 
2
  # -*- coding: utf-8 -*-
3
  # This file contains all custom class definitions required to run the Interfuser model.
4
+ !git clone https://github.com/opendilab/InterFuser.git
5
+ !pip install timm
6
+ import sys
7
+ sys.path.append('/content/InterFuser')
 
8
  import math
 
9
  import copy
10
+ import logging
11
+ import sys
12
+ from collections import OrderedDict
13
+ from functools import partial
14
  from typing import Optional, List
15
+ from huggingface_hub import HfApi
16
 
17
+ import numpy as np
18
+ import torch
19
+ from torch import nn, Tensor
20
+ import torch.nn.functional as F
21
+ from InterFuser.modeling_interfuser import InterfuserConfig, InterfuserForHuggingFace
22
+ from huggingface_hub import notebook_login
23
+ # --- هذه هي الأسطر المهمة التي يجب التأكد من وجودها ---
24
+ from InterFuser.interfuser.timm.models.layers import StdConv2dSame, StdConv2d, to_2tuple
25
+ from InterFuser.interfuser.timm.models.registry import register_model
26
+ from InterFuser.interfuser.timm.models.resnet import resnet26d, resnet50d, resnet18d, resnet26, resnet50, resnet101d
27
+ # --------------------------------------------------------
28
+ from transformers import AutoConfig, AutoModel
29
+ import os
30
 
31
  # ==============================================================================
32
  # SECTION 1: ALL DEPENDENCY CLASSES FROM THE ORIGINAL CODE
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b96a031dc969bdb3c572e0945311632e6c7737489bec69df1c418308d04506ea
3
  size 212282626
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79d241b35c9a15d1cfea3d24a90df036c72398dc12b7378ae56f9030fe1a2c89
3
  size 212282626