Update README.md
#2
by
bertugmirasyedi
- opened
README.md
CHANGED
|
@@ -72,7 +72,11 @@ from model import CustomBertModel
|
|
| 72 |
tokenizer = BertTokenizer.from_pretrained('Berketarak/Product-Matching-Classifier')
|
| 73 |
model = CustomBertModel.from_pretrained('Berketarak/Product-Matching-Classifier')
|
| 74 |
|
|
|
|
|
|
|
|
|
|
| 75 |
|
|
|
|
| 76 |
product1 = 'X brand Pegasus Sneakers'
|
| 77 |
product2 = 'Y brand Shoes'
|
| 78 |
|
|
@@ -91,4 +95,3 @@ if output > 0.5:
|
|
| 91 |
print(f"The products are likely the SAME. Model output: {output}")
|
| 92 |
else:
|
| 93 |
print(f"The products are likely DIFFERENT. Model output: {output}")
|
| 94 |
-
|
|
|
|
| 72 |
tokenizer = BertTokenizer.from_pretrained('Berketarak/Product-Matching-Classifier')
|
| 73 |
model = CustomBertModel.from_pretrained('Berketarak/Product-Matching-Classifier')
|
| 74 |
|
| 75 |
+
# Send model to GPU
|
| 76 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 77 |
+
model.to(device)
|
| 78 |
|
| 79 |
+
# Define the products
|
| 80 |
product1 = 'X brand Pegasus Sneakers'
|
| 81 |
product2 = 'Y brand Shoes'
|
| 82 |
|
|
|
|
| 95 |
print(f"The products are likely the SAME. Model output: {output}")
|
| 96 |
else:
|
| 97 |
print(f"The products are likely DIFFERENT. Model output: {output}")
|
|
|