Instructions to use AlanRobotics/rubert-siamese with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlanRobotics/rubert-siamese with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="AlanRobotics/rubert-siamese", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AlanRobotics/rubert-siamese", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
59710a6
1
Parent(s): 6bff269
Update modeling_siamese.py
Browse files- modeling_siamese.py +0 -2
modeling_siamese.py
CHANGED
|
@@ -25,10 +25,8 @@ class SiameseNN(torch.nn.Module):
|
|
| 25 |
|
| 26 |
def forward(self, x):
|
| 27 |
first_encoded = self.encoder(**x[0]).pooler_output
|
| 28 |
-
#print("First: ", first_encoded)
|
| 29 |
second_encoded = self.encoder(**x[1]).pooler_output
|
| 30 |
l1_distance = self.merged([first_encoded, second_encoded])
|
| 31 |
-
#print(l1_distance.shape)
|
| 32 |
fc1 = self.fc1(l1_distance)
|
| 33 |
fc1 = self.softmax(fc1)
|
| 34 |
return fc1
|
|
|
|
| 25 |
|
| 26 |
def forward(self, x):
|
| 27 |
first_encoded = self.encoder(**x[0]).pooler_output
|
|
|
|
| 28 |
second_encoded = self.encoder(**x[1]).pooler_output
|
| 29 |
l1_distance = self.merged([first_encoded, second_encoded])
|
|
|
|
| 30 |
fc1 = self.fc1(l1_distance)
|
| 31 |
fc1 = self.softmax(fc1)
|
| 32 |
return fc1
|