lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.67k stars 174 forks source link

Fix invalid argumentless function call to get_onnxruntime_source_for_… #427

Closed ochen1 closed 3 months ago

ochen1 commented 3 months ago

Description

Line 616 of this file tries to execute the function without arguments:

run_pip(f"install {get_onnxruntime_source_for_rocm()}", "onnxruntime-training")

Line 684 of this file defines a positional (mandatory) argument:

def get_onnxruntime_source_for_rocm(rocm_ver):

However, this code is perfectly capable of handling None when passed in as rocm_ver:

if rocm_ver is None:
    command = subprocess.run('hipconfig --version', shell=True, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    rocm_ver = command.stdout.decode(encoding="utf8", errors="ignore").split('.')

As such, we should make the argument optional, like so:

def get_onnxruntime_source_for_rocm(rocm_ver=None):

Screenshots/videos:

Checklist:

lshqqytiger commented 3 months ago

Thank you for contribution. However, I introduced a package index for onnxruntime built with ROCm. https://github.com/vladmandic/automatic/commit/ba86730f528c8c7b8c531e3cd9a93a8561042dfe I applied this changes at a2568ed02b9a55287bfced48e7028bca426401d2

ochen1 commented 3 months ago

Thank you for the credit and for resolving the issue in such a timely manner!