Update README, add ds code
Browse files
README.md
CHANGED
|
@@ -78,11 +78,9 @@ features = feature_extractor(
|
|
| 78 |
padding=True,
|
| 79 |
truncation=False)
|
| 80 |
|
| 81 |
-
# convert to tensor
|
| 82 |
inputs = torch.tensor(np.array(features['input_values']), dtype=torch.float32).to(device)
|
| 83 |
attention_mask = torch.tensor(np.array(features['attention_mask']), dtype=torch.long).to(device)
|
| 84 |
|
| 85 |
-
# apply model
|
| 86 |
prob_dict = {}
|
| 87 |
with torch.no_grad():
|
| 88 |
model_output = model(inputs, attention_mask=attention_mask)
|
|
|
|
| 78 |
padding=True,
|
| 79 |
truncation=False)
|
| 80 |
|
|
|
|
| 81 |
inputs = torch.tensor(np.array(features['input_values']), dtype=torch.float32).to(device)
|
| 82 |
attention_mask = torch.tensor(np.array(features['attention_mask']), dtype=torch.long).to(device)
|
| 83 |
|
|
|
|
| 84 |
prob_dict = {}
|
| 85 |
with torch.no_grad():
|
| 86 |
model_output = model(inputs, attention_mask=attention_mask)
|