<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_tempi(tempi, reference=True):
 """Checks that there are two non-negative tempi. For a reference value, at least one tempo has to be greater than zero. Parameters tempi : np.ndarray length-2 array of tempo, in bpm reference : bool indicates a reference value """


    if tempi.size != 2:
        raise ValueError('tempi must have exactly two values')

    if not np.all(np.isfinite(tempi)) or np.any(tempi < 0):
        raise ValueError('tempi={} must be non-negative numbers'.format(tempi))

    if reference and np.all(tempi == 0):
        raise ValueError('reference tempi={} must have one'
                         ' value greater than zero'.format(tempi))