mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-28 07:57:44 +00:00
Fix a small bug in model value evaluation (#142)
* Value evaluation feedback not correct. We should give different feedback when target tensor or gt tensor is not available. * fix CI
This commit is contained in:
@@ -47,8 +47,10 @@ def value_evaluator(
|
||||
prediction: torch.Tensor,
|
||||
target: torch.Tensor,
|
||||
) -> Tuple[torch.Tensor, bool]:
|
||||
if target is None or prediction is None:
|
||||
return "No output generated from the model. No value evaluation conducted.", False
|
||||
if prediction is None:
|
||||
return "No output generated from the model. Skip value evaluation", False
|
||||
elif target is None:
|
||||
return "No ground truth output provided. Value evaluation not impractical", False
|
||||
else:
|
||||
# Calculate the mean absolute difference
|
||||
diff = torch.mean(torch.abs(target - prediction)).item()
|
||||
|
||||
Reference in New Issue
Block a user