Weak groupoid interpretation of type theory