mistralai / mistral-common

Apache License 2.0
651 stars 69 forks source link

[cv2] Make sure broken environments don't lead to errors #58

Closed patrickvonplaten closed 1 month ago

patrickvonplaten commented 1 month ago

Sadly it often happens that cv2 is incorrectly installed: https://github.com/opencv/opencv-python/issues/884 which shouldn't bother people from using mistral_common's text encoding capabilities.

This PR makes sure that all import errors are caught and instead of raising we simply throw a warning.

cc @youkaichao as well

youkaichao commented 1 month ago

thanks for the update!