Update README.md
Browse files
README.md
CHANGED
@@ -61,11 +61,7 @@ test_set = model.get_dataset(database_dir=database_dir, test_set_only=True)
|
|
61 |
|
62 |
# Get an example, add mini-batch dimension and move to device:
|
63 |
example = test_set[0]
|
64 |
-
for k, v in example.items()
|
65 |
-
if isinstance(v, torch.Tensor):
|
66 |
-
example[k] = v.to(device).unsqueeze(0)
|
67 |
-
else:
|
68 |
-
example[k] = [v]
|
69 |
|
70 |
# Convert the patient data in the batch into embeddings:
|
71 |
inputs_embeds, attention_mask, token_type_ids, position_ids, bos_token_ids = model.prepare_inputs(tokenizer=tokenizer, **example)
|
|
|
61 |
|
62 |
# Get an example, add mini-batch dimension and move to device:
|
63 |
example = test_set[0]
|
64 |
+
example = {k: v.to(device).unsqueeze(0) if isinstance(v, torch.Tensor) else [v] for k, v in example.items()} # Add mini-batch dimension and move to device.
|
|
|
|
|
|
|
|
|
65 |
|
66 |
# Convert the patient data in the batch into embeddings:
|
67 |
inputs_embeds, attention_mask, token_type_ids, position_ids, bos_token_ids = model.prepare_inputs(tokenizer=tokenizer, **example)
|