Download modeling.py from InteI/test: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/InteI/test/resolve/main/modeling.py
- Command line
-
hf download hf://InteI/test/modeling.py
-
curl -L -o modeling.py https://huggingface.co/InteI/test/resolve/main/modeling.py
579 Bytes
| # modeling.py | |
| from transformers import PreTrainedModel | |
| import torch.nn as nn | |
| class SimpleWarningConfig: | |
| def __init__(self, hidden_size=8): | |
| self.hidden_size = hidden_size | |
| class SimpleModel(PreTrainedModel): | |
| config_class = SimpleWarningConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| print("⚠️ WARNING: You are loading a model with trust_remote_code=True! Be careful with remote code execution!") | |
| self.linear = nn.Linear(config.hidden_size, config.hidden_size) | |
| def forward(self, x): | |
| return self.linear(x) | |