mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
use heuristic to select RAM cache size during headless install; blackified
This commit is contained in:
committed by
Kent Keirsey
parent
0c97a1e7e7
commit
d59e534cad
@ -344,12 +344,12 @@ class InvokeAiInstance:
|
||||
auto_install = True
|
||||
sys.argv = new_argv
|
||||
|
||||
import requests # to catch download exceptions
|
||||
import messages
|
||||
import requests # to catch download exceptions
|
||||
|
||||
auto_install = auto_install or messages.user_wants_auto_configuration()
|
||||
if auto_install:
|
||||
sys.argv.append('--yes')
|
||||
sys.argv.append("--yes")
|
||||
else:
|
||||
messages.introduction()
|
||||
|
||||
|
@ -7,7 +7,7 @@ import os
|
||||
import platform
|
||||
from pathlib import Path
|
||||
|
||||
from prompt_toolkit import prompt, HTML
|
||||
from prompt_toolkit import HTML, prompt
|
||||
from prompt_toolkit.completion import PathCompleter
|
||||
from prompt_toolkit.validation import Validator
|
||||
from rich import box, print
|
||||
@ -97,13 +97,17 @@ def user_wants_auto_configuration() -> bool:
|
||||
padding=(1, 1),
|
||||
)
|
||||
)
|
||||
choice = prompt(HTML("Choose <b><a></b>utomatic or <b><m></b>anual configuration [a/m] (a): "),
|
||||
validator=Validator.from_callable(
|
||||
lambda n: n=='' or n.startswith(('a', 'A', 'm', 'M')),
|
||||
error_message="Please select 'a' or 'm'"
|
||||
),
|
||||
) or 'a'
|
||||
return choice.lower().startswith('a')
|
||||
choice = (
|
||||
prompt(
|
||||
HTML("Choose <b><a></b>utomatic or <b><m></b>anual configuration [a/m] (a): "),
|
||||
validator=Validator.from_callable(
|
||||
lambda n: n == "" or n.startswith(("a", "A", "m", "M")), error_message="Please select 'a' or 'm'"
|
||||
),
|
||||
)
|
||||
or "a"
|
||||
)
|
||||
return choice.lower().startswith("a")
|
||||
|
||||
|
||||
def dest_path(dest=None) -> Path:
|
||||
"""
|
||||
@ -209,7 +213,7 @@ def graphical_accelerator():
|
||||
"cpu",
|
||||
)
|
||||
idk = (
|
||||
"I'm not sure what to choose",
|
||||
"I'm not sure what to choose",
|
||||
"idk",
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user