Skip to content

Commit a857e8d

Browse files
committed
Update base for Update on "Update phi-3-mini to use the export library"
as title. Note: exporting model from HF is currently blocked by this issue, https://fburl.com/qpaapajr. We need to apply the following trick to export the model. ``` model = torch.export._trace._export( model, example_inputs, dynamic_shapes=dynamic_shape, strict=False, pre_dispatch=False, ) ``` Differential Revision: [D59503255](https://our.internmc.facebook.com/intern/diff/D59503255/) [ghstack-poisoned]
1 parent c0c0f5e commit a857e8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/models/phi-3-mini/export_phi-3-mini.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
XNNPACKQuantizer,
2121
)
2222

23-
# pyre-ignore: Undefined attribute [16]: Module `transformers` has no attribute `Phi3ForCausalLM`
2423
from transformers import Phi3ForCausalLM
2524

2625

2726
def main() -> None:
2827
torch.random.manual_seed(0)
2928

29+
# pyre-ignore: Undefined attribute [16]: Module `transformers` has no attribute `Phi3ForCausalLM`
3030
model = Phi3ForCausalLM.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
3131

3232
example_inputs = (torch.randint(0, 100, (1, 100), dtype=torch.long),)

0 commit comments

Comments
 (0)