Instructions to use OpCustom/OpAI1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Adapters
How to use OpCustom/OpAI1.1 with Adapters:
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("<base-model-id>") model.load_adapter("OpCustom/OpAI1.1", set_active=True) - Notebooks
- Google Colab
- Kaggle
Download feedforward.py from OpCustom/OpAI1.1: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/OpCustom/OpAI1.1/resolve/main/feedforward.py
- Command line
-
hf download hf://OpCustom/OpAI1.1/feedforward.py
-
curl -L -o feedforward.py https://huggingface.co/OpCustom/OpAI1.1/resolve/main/feedforward.py
410 Bytes
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| class FeedForward(nn.Module): | |
| def __init__(self, d_model, ff_dim=2048): | |
| super(FeedForward, self).__init__() | |
| self.linear1 = nn.Linear(d_model, ff_dim) | |
| self.linear2 = nn.Linear(ff_dim, d_model) | |
| def forward(self, x): | |
| x = F.relu(self.linear1(x)) | |
| x = self.linear2(x) | |
| return x | |