Upload folder using huggingface_hub
Browse files- modeling_resnet.py +3 -0
modeling_resnet.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
from transformers import PreTrainedModel
|
| 2 |
from timm.models.resnet import BasicBlock, Bottleneck, ResNet
|
|
|
|
|
|
|
|
|
|
| 3 |
from .configuration_resnet import ResnetConfig
|
| 4 |
import torch
|
| 5 |
|
|
|
|
| 1 |
from transformers import PreTrainedModel
|
| 2 |
from timm.models.resnet import BasicBlock, Bottleneck, ResNet
|
| 3 |
+
# NOTE: below line must use relative import, as this file and configuration_resnet.py will be downloaded into a directory.
|
| 4 |
+
# NOTE: export_files_for_hf.py etc must put outside of dir of this file. otherwise, when run 'python export_files_for_hf.py', will get error: ImportError: attempted relative import with no known parent package.
|
| 5 |
+
# Note: for why, see https://github.com/zhangfaen/python-pytorch-tips/blob/main/relative_import_key_tips.md
|
| 6 |
from .configuration_resnet import ResnetConfig
|
| 7 |
import torch
|
| 8 |
|