fix sentencepiece compile

This commit is contained in:
Disty0
2025-07-17 06:24:39 +03:00
parent 7af320ce6c
commit b315c4d1db
+7 -7
View File
@@ -1232,13 +1232,6 @@ def install_requirements():
if args.skip_requirements and not args.requirements:
return
if int(sys.version_info.minor) >= 13:
# gcc 15 patch
backup_cmake_policy = os.environ.get('CMAKE_POLICY_VERSION_MINIMUM', None)
backup_cxxflags = os.environ.get('CXXFLAGS', None)
os.environ.setdefault('CMAKE_POLICY_VERSION_MINIMUM', '3.5')
os.environ.setdefault('CXXFLAGS', '-include cstdint')
os.environ.setdefault('CMAKE_POLICY_VERSION_MINIMUM', backup_cmake_policy)
os.environ.setdefault('CXXFLAGS', backup_cxxflags)
install('audioop-lts')
if not installed('diffusers', quiet=True): # diffusers are not installed, so run initial installation
global quick_allowed # pylint: disable=global-statement
@@ -1248,7 +1241,14 @@ def install_requirements():
if args.optional:
quick_allowed = False
install_optional()
# gcc 15 patch for sentencepiece
backup_cmake_policy = os.environ.get('CMAKE_POLICY_VERSION_MINIMUM', None)
backup_cxxflags = os.environ.get('CXXFLAGS', None)
os.environ.setdefault('CMAKE_POLICY_VERSION_MINIMUM', '3.5')
os.environ.setdefault('CXXFLAGS', '-include cstdint')
install('git+https://github.com/google/sentencepiece#subdirectory=python', 'sentencepiece')
os.environ.setdefault('CMAKE_POLICY_VERSION_MINIMUM', backup_cmake_policy)
os.environ.setdefault('CXXFLAGS', backup_cxxflags)
installed('torch', reload=True) # reload packages cache
log.info('Install: verifying requirements')
with open('requirements.txt', 'r', encoding='utf8') as f: