mirror of
https://github.com/deepseek-ai/DeepSeek-VL.git
synced 2025-04-19 10:09:09 -04:00
automatically detect the Python version, if above 3.10 patch collections to use collections.abc
This commit is contained in:
parent
86a309683b
commit
c99e9f1184
@ -16,3 +16,14 @@
|
||||
# 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))
|
||||
|
Loading…
Reference in New Issue
Block a user