Instructions to use hf-internal-testing/test_dynamic_model_with_util with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/test_dynamic_model_with_util with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="hf-internal-testing/test_dynamic_model_with_util", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hf-internal-testing/test_dynamic_model_with_util", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| from transformers import BertModel | |
| from .configuration import NewModelConfig | |
| from .util import ImportLayer | |
| class NewModel(BertModel): | |
| config_class = NewModelConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.last_layer = ImportLayer(config.hidden_size, config.new_hidden_size) |