mirror of
https://github.com/deepseek-ai/DeepSeek-VL
synced 2025-06-26 18:27:43 +00:00
feat: automatically patch collections for >python 3.10 support (#21)
Co-authored-by: Bo Liu <benjaminliu.eecs@gmail.com>
This commit is contained in:
@@ -16,3 +16,16 @@
|
||||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
# check if python version is above 3.10
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
print("Python version is above 3.10, patching the collections module.")
|
||||
# Monkey patch collections
|
||||
import collections
|
||||
import collections.abc
|
||||
|
||||
for type_name in collections.abc.__all__:
|
||||
setattr(collections, type_name, getattr(collections.abc, type_name))
|
||||
|
||||
Reference in New Issue
Block a user