Instructions to use sgugger/my-bert-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sgugger/my-bert-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="sgugger/my-bert-model", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("sgugger/my-bert-model", trust_remote_code=True) model = AutoModel.from_pretrained("sgugger/my-bert-model", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Fix syntax error
Browse files- modeling.py +1 -1
modeling.py
CHANGED
|
@@ -3,4 +3,4 @@ from transformers import BertModel
|
|
| 3 |
class MyBertModel(BertModel):
|
| 4 |
def forward(self, *args, **kwargs):
|
| 5 |
print("Success")
|
| 6 |
-
return super.forward(*args, **kwargs)
|
|
|
|
| 3 |
class MyBertModel(BertModel):
|
| 4 |
def forward(self, *args, **kwargs):
|
| 5 |
print("Success")
|
| 6 |
+
return super().forward(*args, **kwargs)
|