deploy: Gemma 4 31B llama-server running on M5 Max (192.168.110.201:8081)

This commit is contained in:
Warren
2026-05-06 17:13:32 +08:00
parent 2e29780d40
commit f65ac89e6a
4 changed files with 308 additions and 43 deletions

View File

@@ -406,6 +406,31 @@ def run_experiment(config: dict) -> dict:
"dominant_speaker": next(iter(speaker_overlaps.get(t["trace_id"], {}).keys()), None) if t["trace_id"] in speaker_overlaps else None,
})
# --- Temp Identity: assign names to unbound clusters ---
temp_count = 0
for label in all_labels:
if label.get("binding") is not None:
continue # already has known identity
tids = label.get("trace_ids", [])
if len(tids) < 1:
continue
# Create temp identity for all unbound clusters (even singletons as "strangers")
if len(tids) >= 1:
temp_count += 1
if len(tids) >= 2:
temp_name = f"Person_{temp_count:03d}"
else:
temp_name = f"Stranger_{temp_count:03d}"
label["binding"] = {
"name": temp_name,
"source": "auto_temp",
"trace_count": len(tids),
}
label["binding_stage"] = "auto_temp"
if temp_count > 0:
print(f" Temp identities created: {temp_count}")
# Metrics
metrics = {
"total_traces": len(traces),
@@ -438,9 +463,10 @@ def run_experiment(config: dict) -> dict:
if row:
identity_id = row[0]
else:
source = binding.get("source", "auto")
cur2.execute(
f"INSERT INTO {SCHEMA}.identities (name, identity_type, source, status) VALUES (%s,'people','auto','pending') RETURNING id",
(identity_name,))
f"INSERT INTO {SCHEMA}.identities (name, identity_type, source, status) VALUES (%s,'people',%s,'pending') RETURNING id",
(identity_name, source))
identity_id = cur2.fetchone()[0]
# Bind all faces in each trace to the identity