Upload folder using huggingface_hub
Browse files- modeling_interfuser.py +22 -12
- 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 |
-
|
5 |
-
|
6 |
-
import
|
7 |
-
|
8 |
-
from functools import partial
|
9 |
import math
|
10 |
-
from collections import OrderedDict
|
11 |
import copy
|
|
|
|
|
|
|
|
|
12 |
from typing import Optional, List
|
13 |
-
from
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
from InterFuser.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
3 |
size 212282626
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:79d241b35c9a15d1cfea3d24a90df036c72398dc12b7378ae56f9030fe1a2c89
|
3 |
size 212282626
|