nbpe97 commited on
Commit
9c1be6b
1 Parent(s): bf0a45c

Update README.md

Browse files

Changing floating point data types to match that of the model: The input types are cast to float32, but the weights themselves are float16.

Files changed (1) hide show
  1. README.md +3 -3
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.FLOAT32
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