Skip to content

Commit fa48eea

Browse files
committed
fix
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 067a8b0 commit fa48eea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration_tests/test_titan_fwd_vs_hf_fwd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def compare_logits(
213213
hf_val = hf_logits_cpu[pos].item()
214214
diff_val = abs_diff[pos].item()
215215
print(
216-
f" {i+1}. Position {pos}: titan={titan_val:.6f}, hf={hf_val:.6f}, diff={diff_val:.6f}"
216+
f" {i + 1}. Position {pos}: titan={titan_val:.6f}, hf={hf_val:.6f}, diff={diff_val:.6f}"
217217
)
218218

219219
return metrics
@@ -242,12 +242,12 @@ def compare_probabilities(
242242
zip(titan_top_k.values, titan_top_k.indices)
243243
):
244244
token = tokenizer.decode([token_id.item()])
245-
print(f" {i+1}. '{token}' (id={token_id.item()}): {prob.item():.6f}")
245+
print(f" {i + 1}. '{token}' (id={token_id.item()}): {prob.item():.6f}")
246246

247247
print("\nHugging Face Top-K:")
248248
for i, (prob, token_id) in enumerate(zip(hf_top_k.values, hf_top_k.indices)):
249249
token = tokenizer.decode([token_id.item()])
250-
print(f" {i+1}. '{token}' (id={token_id.item()}): {prob.item():.6f}")
250+
print(f" {i + 1}. '{token}' (id={token_id.item()}): {prob.item():.6f}")
251251

252252
# Calculate overlap in top-k predictions
253253
titan_top_tokens = set(titan_top_k.indices.tolist())

0 commit comments

Comments
 (0)