ImageReward fix, #214

pull/218/head
AlUlkesh 2023-07-14 18:02:11 +02:00
parent b2f6e4cbe5
commit 9229ed5e7e
3 changed files with 17 additions and 2 deletions

View File

@ -4,6 +4,14 @@ import os
if not launch.is_installed("send2trash"):
launch.run_pip("install Send2Trash", "Send2Trash requirement for image browser")
if not launch.is_installed("ImageReward"):
try:
import ImageReward
import dataset
import dill
import diffusers
import multiprocessing
import pyarrow
import xxhash
except ImportError as e:
req_IR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "req_IR.txt")
launch.run_pip(f'install -r "{req_IR}" --no-deps image-reward', 'ImageReward requirement for image browser')

View File

@ -1 +1,7 @@
datasets
diffusers
dill
fairscale
multiprocess
pyarrow
xxhash

View File

@ -48,8 +48,9 @@ except ImportError:
try:
import ImageReward
image_reward_installed = True
except ImportError:
except ImportError as e:
print("Image Browser: ImageReward is not installed, cannot be used.")
print(e)
image_reward_installed = False
# Force reload wib_db, as it doesn't get reloaded otherwise, if an extension update is started from webui