Instructions to use valhalla/awesome-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use valhalla/awesome-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="valhalla/awesome-model", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("valhalla/awesome-model", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| import torch | |
| from transformers import PreTrainedModel | |
| from .config import AwesomeConfig | |
| class AwesomeModel(PreTrainedModel): | |
| config_class = AwesomeConfig | |
| base_model_prefix = "base" | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.linear = torch.nn.Linear(config.hidden_size, config.hidden_size) | |
| def forward(self, x): | |
| return self.linear(x) |