def significant(x: Number, ndigits: int = 2) -> Number:
    """
    Cut the number up to its `ndigits` after the most significant
    """
    if isinstance(x, torch.Tensor):
        x = x.item()

    if not isinstance(x, Number) or x == 0:
        return x

    return round(x, ndigits - int(math.floor(math.log10(abs(x)))))

    Cut the number up to its `ndigits` after the most significant
    
minillm/minillm/utils.py