You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a QuestionAnswering bert model for testing (#19)
* Add matching transformers version as current tt-metal
* Remove the type conversion passes and directly call transformers to use bfloat16 when initializing the model
* Convert torch.Tensor.to to ttnn.as_tensor
* Use ttnn.full correctly instead of aten.full for certain cases
* Convert bert model to unittest
* Move transformers installation to dev
* Refactor model input and output print statement for test_bert
context='Johann Joachim Winckelmann was a German art historian and archaeologist. He was a pioneering Hellenist who first articulated the difference between Greek, Greco-Roman and Roman art. "The prophet and founding hero of modern archaeology", Winckelmann was one of the founders of scientific archaeology and first applied the categories of style on a large, systematic basis to the history of art. '
36
+
question="What discipline did Winkelmann create?"
37
+
38
+
inputs=tokenizer.encode_plus(
39
+
question,
40
+
context,
41
+
add_special_tokens=True,
42
+
return_tensors="pt",
43
+
max_length=256,
44
+
padding="max_length",
45
+
truncation=True,
46
+
)
47
+
48
+
# Run inference with the original model
49
+
withtorch.no_grad():
50
+
outputs_before=m(**inputs)
51
+
52
+
# Helper function to decode output to human-readable text
0 commit comments