Add support for Q8 in DType (#103)

This commit is contained in:
Jamjamjon
2025-05-27 22:19:39 +08:00
committed by GitHub
parent 86533d9c41
commit cfb92105ee
2 changed files with 3 additions and 24 deletions

View File

@ -15,27 +15,3 @@ The official repository can be found on:
## Example
Refer to the [example](../../../examples/yolo)
## TODO
- [x] YOLOv5-det
- [x] YOLOv5-cls
- [x] YOLOv5-seg
- [x] YOLOv6
- [x] YOLOv7
- [x] YOLOv8-det
- [x] YOLOv8-cls
- [x] YOLOv8-pose
- [x] YOLOv8-seg
- [x] YOLOv8-obb
- [x] YOLOv8-world
- [x] YOLOv8-rtdetr
- [x] YOLOv9
- [x] YOLOv10
- [x] YOLO11-det
- [x] YOLO11-cls
- [x] YOLO11-pose
- [x] YOLO11-seg
- [x] YOLO11-obb
- [x] FastSam
- [ ] YOLO-NAS

View File

@ -20,6 +20,7 @@ pub enum DType {
Bnb4,
Q4,
Q4f16,
Q8,
}
impl TryFrom<&str> for DType {
@ -43,6 +44,7 @@ impl TryFrom<&str> for DType {
"b16" | "bf16" => Ok(Self::Bf16),
"q4f16" => Ok(Self::Q4f16),
"q4" => Ok(Self::Q4),
"q8" => Ok(Self::Q8),
"bnb4" => Ok(Self::Bnb4),
x => anyhow::bail!("Unsupported DType: {}", x),
}
@ -71,6 +73,7 @@ impl std::fmt::Display for DType {
Self::Bnb4 => "bnb4",
Self::Q4 => "q4",
Self::Q4f16 => "q4f16",
Self::Q8 => "q8",
};
write!(f, "{}", x)
}