Skip to content

Build Streamlit Frontend WebUI for VizFold trace visualization Issue #41#69

Open
DevP1130 wants to merge 3 commits into
AI2Science:mainfrom
DevP1130:WebUI
Open

Build Streamlit Frontend WebUI for VizFold trace visualization Issue #41#69
DevP1130 wants to merge 3 commits into
AI2Science:mainfrom
DevP1130:WebUI

Conversation

@DevP1130

Copy link
Copy Markdown

Adds Streamlit-based frontend for VizFold allowing offline exploration of inference traces. Includes layer selection, attention head controls, and protein structure visualization support, specifically Zarr as what I was told that is being used.

Comment thread webui/trace_reader.py
return {}
path = os.path.join(
self.root, protein, "attention",
f"msa_row_attn_layer{layer_idx}.txt",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to add a bounds check just to be safe. something like:

if layer_idx >= self.n_layers(array_name):
    raise ValueError(f"Layer {layer_idx} exceeds max {self.n_layers(array_name) - 1}")

Comment thread webui/trace_reader.py

# ── Loading ───────────────────────────────────────────────────────────────

def load_attention(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this function and the next, you might wanna add error handling/recovery for file operations

Comment thread webui/app.py

# ── Branch A: Trace directory ─────────────────────────────────────────────
if source == "Trace directory":
default_trace = os.path.join(os.path.dirname(__file__), "sample_trace")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that sample_trace/ exists. It might be beneficial to have a check attach an error message? I'm not sure if text_input automatically creates the dir

@sherrylicodes

Copy link
Copy Markdown

This WebUI is a super great step towards the issue I've been working on, #41. One integration concern might be that the UI currently depends on reader outputs already being in the exact visualization format expected by the heatmap/arc/structure components. It might be helpful to add a small adapter/normalization layer between TraceReader/ZarrTraceReader and the UI that standardizes outputs into a common (source_residue, target_residue, weight) connection format. This could be helpful for standardized archive formats. Super amazing work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants