Spaces:
Running
on
Zero
Running
on
Zero
Add instructions
Browse files
app.py
CHANGED
@@ -18,6 +18,26 @@ CITATION_BUTTON_TEXT = """
|
|
18 |
}
|
19 |
"""
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
cached_tensor = None
|
22 |
topk_indices = None
|
23 |
|
@@ -173,9 +193,11 @@ with gr.Blocks() as demo:
|
|
173 |
"""
|
174 |
# Large Multi-modal Models Can Interpret Features in Large Multi-modal Models
|
175 |
|
176 |
-
π [ArXiv Paper](https://arxiv.org/abs/2411.14982) | π [LMMs-Lab Homepage](https://lmms-lab.framer.ai) | π€ [Huggingface Collections](https://huggingface.co/collections/lmms-lab/llava-sae-674026e4e7bc8c29c70bc3a3)
|
177 |
"""
|
178 |
)
|
|
|
|
|
179 |
|
180 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
181 |
with gr.TabItem("Visualization of Activations", elem_id="visualization", id=0):
|
|
|
18 |
}
|
19 |
"""
|
20 |
|
21 |
+
INSTRUCTIONS = """
|
22 |
+
## Instructions to use the demo
|
23 |
+
You can use this demo to :
|
24 |
+
1. Visualize the activations of the model for a given image.
|
25 |
+
2. Generate text with a specific feature clamped to a certain value.
|
26 |
+
|
27 |
+
### Visualization of Activations
|
28 |
+
1. Upload an image. (or use an example)
|
29 |
+
2. Click on the "Submit" button to visualize the activations. The top-100 features will be displayed. (It might contains lots of low level features that activates on many patterns so explainable features might not rank very high)
|
30 |
+
3. Use the slider to select a feature number.
|
31 |
+
4. Click on the "Visualize" button to see the activation of that feature.
|
32 |
+
|
33 |
+
### Steering Model
|
34 |
+
1. Use the slider to select a feature number.
|
35 |
+
2. Use the number input to select the feature strength.
|
36 |
+
3. Type the text input.
|
37 |
+
4. Upload an image. (optional)
|
38 |
+
5. Click on the "Submit" button to generate text with the selected feature clamped to the selected strength.
|
39 |
+
"""
|
40 |
+
|
41 |
cached_tensor = None
|
42 |
topk_indices = None
|
43 |
|
|
|
193 |
"""
|
194 |
# Large Multi-modal Models Can Interpret Features in Large Multi-modal Models
|
195 |
|
196 |
+
π [ArXiv Paper](https://arxiv.org/abs/2411.14982) | π [LMMs-Lab Homepage](https://lmms-lab.framer.ai) | π€ [Huggingface Collections](https://huggingface.co/collections/lmms-lab/llava-sae-674026e4e7bc8c29c70bc3a3) | [GitHub Repo](https://github.com/EvolvingLMMs-Lab/multimodal-sae)
|
197 |
"""
|
198 |
)
|
199 |
+
with gr.Accordion("βΉοΈ Instructions", open=False):
|
200 |
+
gr.Markdown(INSTRUCTIONS)
|
201 |
|
202 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
203 |
with gr.TabItem("Visualization of Activations", elem_id="visualization", id=0):
|