Skip to content

Commit b532723

Browse files
committed
minor fixes: add more trash vars and fix xfomers error
1 parent 277096f commit b532723

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

portablesource/Version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
__version__ = "0.1.2.post4"
2+
__version__ = "0.1.2.post5"
33

44
if __name__ == "__main__":
55
print(__version__)

portablesource/repository_installer.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,16 +1725,24 @@ def _add_install_flags_and_urls(self, install_cmd: list, install_flags: list, se
17251725
"""Add installation flags and index URLs to command"""
17261726
# Check if this is a torch installation step by looking at the command
17271727
# Only add torch index URL if ALL packages are torch-related (torch, torchvision, torchaudio)
1728-
torch_packages = ['torch', 'torchvision', 'torchaudio']
1728+
torch_packages = ['torch', 'torchvision', 'torchaudio', 'xformers']
17291729
package_args = [arg for arg in install_cmd if not arg.startswith('-') and 'pip' not in arg and 'install' not in arg and 'python' not in arg and 'uv' not in arg]
17301730

1731-
# Extract package names from version specifications like "torch>=2.4.0"
1731+
# Extract package names from version specifications like "torch>=2.4.0" and remove versions for torch packages
17321732
package_names = []
1733-
for arg in package_args:
1733+
for i, arg in enumerate(package_args):
17341734
# Split by common version operators
17351735
for op in ['>=', '<=', '==', '!=', '>', '<', '~=']:
17361736
if op in arg:
1737-
package_names.append(arg.split(op)[0].strip())
1737+
pkg_name = arg.split(op)[0].strip()
1738+
package_names.append(pkg_name)
1739+
# Remove version specification for torch packages
1740+
if pkg_name.lower() in torch_packages:
1741+
# Find the index of this package in install_cmd and replace it
1742+
for j, cmd_arg in enumerate(install_cmd):
1743+
if cmd_arg == arg:
1744+
install_cmd[j] = pkg_name
1745+
break
17381746
break
17391747
else:
17401748
package_names.append(arg.strip())
@@ -1970,6 +1978,9 @@ def _generate_startup_script(self, repo_path: Path, repo_info: Dict):
19701978
set TMP=%tmp_path%\Temp
19711979
set APPDATA=%tmp_path%\AppData\Roaming
19721980
set LOCALAPPDATA=%tmp_path%\AppData\Local
1981+
set HF_HOME=%tmp_path%\huggingface
1982+
set XDG_CACHE_HOME=%tmp_path%
1983+
set HF_DATASETS_CACHE=%HF_HOME%\datasets
19731984
19741985
REM Security and compatibility settings
19751986
set PYTHONIOENCODING=utf-8

0 commit comments

Comments
 (0)