mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 16:17:57 +01:00
Added two ENVs in webui.py for docker (#111)
This commit is contained in:
parent
72b4ab4c82
commit
d70b8d9048
11
one_click.py
11
one_click.py
@ -98,6 +98,11 @@ def run_cmd(cmd, assert_success=False, environment=False, capture_output=False,
|
||||
|
||||
def install_webui():
|
||||
|
||||
# Select your GPU, or choose to run in CPU mode
|
||||
if "GPU_CHOICE" in os.environ:
|
||||
choice = os.environ["GPU_CHOICE"].upper()
|
||||
print_big_message(f"Selected GPU choice \"{choice}\" based on the GPU_CHOICE environment variable.")
|
||||
else:
|
||||
print("What is your GPU")
|
||||
print()
|
||||
print("A) NVIDIA")
|
||||
@ -106,11 +111,11 @@ def install_webui():
|
||||
print("D) None (I want to run models in CPU mode)")
|
||||
print()
|
||||
|
||||
# Select your GPU, or choose to run in CPU mode
|
||||
choice = input("Input> ").upper()
|
||||
while choice not in ['A', 'B', 'C', 'D']:
|
||||
print("Invalid choice. Please try again.")
|
||||
choice = input("Input> ").upper()
|
||||
|
||||
if choice == "D":
|
||||
print_big_message("Once the installation ends, make sure to open CMD_FLAGS.txt with\na text editor and add the --cpu flag.")
|
||||
|
||||
@ -261,6 +266,10 @@ if __name__ == "__main__":
|
||||
install_webui()
|
||||
os.chdir(script_dir)
|
||||
|
||||
if os.environ.get("LAUNCH_AFTER_INSTALL", "").lower() in ("no", "n", "false", "0", "f", "off"):
|
||||
print_big_message("Install finished successfully and will now exit due to LAUNCH_AFTER_INSTALL.")
|
||||
sys.exit()
|
||||
|
||||
# Check if a model has been downloaded yet
|
||||
if len([item for item in glob.glob('models/*') if not item.endswith(('.txt', '.yaml'))]) == 0:
|
||||
print_big_message("WARNING: You haven't downloaded any model yet.\nOnce the web UI launches, head over to the \"Model\" tab and download one.")
|
||||
|
Loading…
Reference in New Issue
Block a user