Skip to content

Commit

Permalink
adding uv
Browse files Browse the repository at this point in the history
  • Loading branch information
webcoderz committed Mar 19, 2024
1 parent d7999a5 commit e40aed6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False'



def check_python_version():
is_windows = platform.system() == "Windows"
major = sys.version_info.major
Expand Down Expand Up @@ -135,8 +136,11 @@ def run_pip(command, desc=None, live=default_command_live):
return

index_url_line = f' --index-url {index_url}' if index_url != '' else ''
return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)

if "ENABLE_UV" not in os.environ:
return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
else:
return run(f'uv pip {command} --prefer-binary{index_url_line} --no-cache-dir', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)

def check_run_python(code: str) -> bool:
result = subprocess.run([python, "-c", code], capture_output=True, shell=False)
Expand Down
3 changes: 2 additions & 1 deletion webui-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@
#export RAY_ADDRESS='ray://ray-head:10001'
#export RAY_DOCKER="True"
#export RAY_DASHBOARD_PORT=8265
#export RAY_DASHBOARD_HOST="0.0.0.0"
#export RAY_DASHBOARD_HOST="0.0.0.0"
export ENABLE_UV="True"

0 comments on commit e40aed6

Please sign in to comment.