launch: installer placeholder fix, quieter plain run, flags next to --preset do not rewrite it
This commit is contained in:
1 parent
4e6a1b46be
commit
ec06637d48
4 files changed
+11
-5
No files matched your search
@@ -24,7 +24,7 @@ function Die([string]$msg) { [Console]::Error.WriteLine("strata installer: $msg"
|
||||
|
||||
$feed = if ($env:STRATA_FEED) { $env:STRATA_FEED } else { '__FEED__' }
|
||||
$feed = $feed.TrimEnd('/')
|
||||
if ($feed -eq '__FEED__' -or -not $feed) {
|
||||
if ($feed -eq ('__FE' + 'ED__') -or -not $feed) {
|
||||
Die 'this installer does not know where the Strata release folder is. Set $env:STRATA_FEED to its address and run it again, for example: $env:STRATA_FEED=''https://example.org/strata'''
|
||||
}
|
||||
if ([Environment]::OSVersion.Platform -ne 'Win32NT') { Die 'this is the Windows installer; on Linux or macOS use install.sh.' }
|
||||
|
||||
@@ -30,7 +30,7 @@ say() { printf '%s\n' "$*"; }
|
||||
die() { printf 'strata installer: %s\n' "$*" >&2; exit 1; }
|
||||
|
||||
case "$FEED" in
|
||||
__FEED__|"") die "this installer does not know where the Strata release folder is. Set STRATA_FEED to its address and run it again, for example: STRATA_FEED=https://example.org/strata sh install.sh" ;;
|
||||
"__FE""ED__"|"") die "this installer does not know where the Strata release folder is. Set STRATA_FEED to its address and run it again, for example: STRATA_FEED=https://example.org/strata sh install.sh" ;;
|
||||
esac
|
||||
|
||||
# ---- tools
|
||||
|
||||
@@ -275,6 +275,10 @@ def _printer(quiet: bool = False):
|
||||
if ev.pct < 100 and ev.pct < state["pct"] + 10 and state["stage"] == ev.stage:
|
||||
return
|
||||
state["pct"] = ev.pct
|
||||
if ev.stage == "start" and ev.text.startswith("Loading the model") and state["stage"] == "start" and not isatty:
|
||||
n = int("".join(ch for ch in ev.text.split("…")[-1] if ch.isdigit()) or 0)
|
||||
if n % 15:
|
||||
return # one line every 15 seconds when nobody is watching a live screen
|
||||
if ev.stage != state["stage"] or text != state["last"]:
|
||||
marker = {"warn": "[!] ", "error": "[X] "}.get(ev.level, " ")
|
||||
_say(f"{marker}{text}")
|
||||
@@ -464,9 +468,11 @@ def run_launch(a: argparse.Namespace) -> int:
|
||||
result = runner.run()
|
||||
except LaunchError as e:
|
||||
return fail(f"{e.text}" + (f" {e.next}" if e.next else ""), e.code)
|
||||
if a.save_preset or a.preset:
|
||||
if a.save_preset:
|
||||
saved = store.save(s, s.name)
|
||||
store.touch_used(saved.name)
|
||||
elif a.preset:
|
||||
store.touch_used(a.preset) # flags next to --preset change this start only
|
||||
if machine:
|
||||
print(json.dumps({"schema_version": 1, "ok": True, "name": s.name, "profile": result.profile, "urls": result.urls,
|
||||
"api_key": "set" if result.key else None, "tuned": result.tune_word,
|
||||
@@ -533,7 +539,7 @@ def run_connect(a: argparse.Namespace) -> int:
|
||||
_say("[!] No running Strata server was found, so this uses the default address. Start one with: strata launch")
|
||||
for f in out["files"]:
|
||||
_say("")
|
||||
_say(f"File: {f['path']}" + (" (merged into an existing file)" if f["merge"] else ""))
|
||||
_say(f"File: {f['path']}" + (" (merged with the file if it exists)" if f["merge"] else ""))
|
||||
for line in (f["text"] if shown_key else harness.mask(f["text"], key)).splitlines():
|
||||
_say(" " + line)
|
||||
if out["env"]:
|
||||
|
||||
@@ -356,7 +356,7 @@ class Runner:
|
||||
prog = cat.mcp.install_progress(lines)
|
||||
prog = cat.mcp.combined_progress(prog, {"folder": folder, "total_gb": total})
|
||||
dl = prog.get("download")
|
||||
if dl and not s.model_path:
|
||||
if dl and not s.model_path and dl.get("total_gb", 0) >= 0.05:
|
||||
self.emit("model", f"Downloading {dl['done_gb']:.1f} of {dl['total_gb']:.1f} GB", float(dl["percent"]), step=prog.get("step"))
|
||||
elif prog.get("step"):
|
||||
self.emit("model", f"Setup step {prog['step']}", None, step=prog.get("step"))
|
||||
|
||||
Reference in new issue
Block a user