mirror of
https://github.com/facebookresearch/blt.git
synced 2025-01-19 00:47:44 +00:00
revert to original patcher style, fix warning
This commit is contained in:
parent
cff0dcb7ab
commit
9e42f5dd1d
|
@ -532,7 +532,7 @@ class Patcher:
|
|||
if self.log_time:
|
||||
s = time.time()
|
||||
if entropies is not None:
|
||||
scores = torch.tensor(entropies, dtype=torch.float32)
|
||||
scores = entropies.clone().detach().to(dtype=torch.float32)
|
||||
elif preds is not None:
|
||||
scores = entropy(preds)
|
||||
else:
|
||||
|
@ -540,11 +540,7 @@ class Patcher:
|
|||
scores = calculate_entropies(
|
||||
tokens,
|
||||
self.entropy_model,
|
||||
(
|
||||
patching_batch_size
|
||||
if patching_batch_size is not None
|
||||
else self.patching_batch_size
|
||||
),
|
||||
self.patching_batch_size,
|
||||
self.device,
|
||||
)
|
||||
if self.log_time:
|
||||
|
|
Loading…
Reference in a new issue