fromString static method
Converts a string value to the corresponding GgmlType
enum value.
Implementation
static GgmlType fromString(String value) {
switch (value) {
case 'f32':
return GgmlType.f32;
case 'f16':
return GgmlType.f16;
case 'q4_0':
return GgmlType.q4_0;
case 'q4_1':
return GgmlType.q4_1;
case 'q4_2':
return GgmlType.q4_2;
case 'q4_3':
return GgmlType.q4_3;
case 'q5_0':
return GgmlType.q5_0;
case 'q5_1':
return GgmlType.q5_1;
case 'q8_0':
return GgmlType.q8_0;
case 'q8_1':
return GgmlType.q8_1;
case 'q2_k':
return GgmlType.q2_k;
case 'q3_k':
return GgmlType.q3_k;
case 'q4_k':
return GgmlType.q4_k;
case 'q5_k':
return GgmlType.q5_k;
case 'q6_k':
return GgmlType.q6_k;
case 'q8_k':
return GgmlType.q8_k;
case 'iq2_xxs':
return GgmlType.iq2_xxs;
case 'iq2_xs':
return GgmlType.iq2_xs;
case 'iq3_xxs':
return GgmlType.iq3_xxs;
case 'iq1_s':
return GgmlType.iq1_s;
case 'iq4_nl':
return GgmlType.iq4_nl;
case 'iq3_s':
return GgmlType.iq3_s;
case 'iq2_s':
return GgmlType.iq2_s;
case 'iq4_xs':
return GgmlType.iq4_xs;
case 'i8':
return GgmlType.i8;
case 'i16':
return GgmlType.i16;
case 'i32':
return GgmlType.i32;
case 'i64':
return GgmlType.i64;
case 'f64':
return GgmlType.f64;
case 'iq1_m':
return GgmlType.iq1_m;
case 'bf16':
return GgmlType.bf16;
case 'q4_0_4_4':
return GgmlType.q4_0_4_4;
case 'q4_0_4_8':
return GgmlType.q4_0_4_8;
case 'q4_0_8_8':
return GgmlType.q4_0_8_8;
case 'tq1_0':
return GgmlType.tq1_0;
case 'tq2_0':
return GgmlType.tq2_0;
default:
return GgmlType.f32;
}
}