Skip to content

Commit

Permalink
Use Torch index for user requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Jan 16, 2025
1 parent dc80415 commit 9c35399
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/monobase/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require_done_or_rm,
setup_logging,
)
from monobase.uv import cuda_suffix
from monobase.uv import cuda_suffix, index_args

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -81,14 +81,15 @@ def build_user_venv(args: argparse.Namespace) -> None:
subprocess.run(cmd, check=True, env=env)

log.info(f'Compiling user requirements {args.requirements}...')
cmd = [
uv,
'pip',
'compile',
'--python-platform',
'x86_64-unknown-linux-gnu',
args.requirements,
]
cmd = [uv, 'pip', 'compile', '--python-platform', 'x86_64-unknown-linux-gnu']
# PyPI is inconsistent with Torch index and may include nvidia packages for CPU torch
# Use the same Torch index instead
tv = (
Version.parse('0.0.0')
if torch_version is None
else Version.parse(torch_version)
)
cmd = cmd + index_args(tv, cuda_version) + [args.requirements]
env['VIRTUAL_ENV'] = udir
try:
proc = subprocess.run(cmd, check=True, env=env, capture_output=True, text=True)
Expand Down

0 comments on commit 9c35399

Please sign in to comment.