Update README.md
Browse filesChanging floating point data types to match that of the model: The input types are cast to float32, but the weights themselves are float16.
README.md
CHANGED
@@ -38,12 +38,12 @@ traced_model = torch.jit.trace(wrapped_model, (dummy_input['input_ids'], dummy_i
|
|
38 |
model_from_torch = ct.convert(
|
39 |
traced_model,
|
40 |
inputs=[
|
41 |
-
ct.TensorType(name="input_ids", shape=(1, ct.RangeDim(1, 512))),
|
42 |
-
ct.TensorType(name="attention_mask", shape=(1, ct.RangeDim(1, 512)))
|
43 |
],
|
44 |
minimum_deployment_target=ct.target.iOS17,
|
45 |
convert_to="mlprogram",
|
46 |
-
compute_precision=ct.precision.
|
47 |
)
|
48 |
|
49 |
# Save the CoreML model as an mlpackage
|
|
|
38 |
model_from_torch = ct.convert(
|
39 |
traced_model,
|
40 |
inputs=[
|
41 |
+
ct.TensorType(name="input_ids", shape=(1, ct.RangeDim(1, 512)), dtype=np.float32),
|
42 |
+
ct.TensorType(name="attention_mask", shape=(1, ct.RangeDim(1, 512)), dtype=np.float32)
|
43 |
],
|
44 |
minimum_deployment_target=ct.target.iOS17,
|
45 |
convert_to="mlprogram",
|
46 |
+
compute_precision=ct.precision.FLOAT16
|
47 |
)
|
48 |
|
49 |
# Save the CoreML model as an mlpackage
|