Update app.py
Browse files
app.py
CHANGED
|
@@ -187,10 +187,7 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
|
|
| 187 |
dataset = dataset.filter(info['filter'])
|
| 188 |
dataset = dataset.shuffle(buffer_size=2000).take(num_examples)
|
| 189 |
dataset = [[row[info['text_col']]] for row in dataset]
|
| 190 |
-
gr.Examples(dataset, [original_prompt_raw],
|
| 191 |
-
# fn=lambda output: [[o[0]] + [gr.Button(visible=False) for _ in range(MAX_PROMPT_TOKENS)] for o in output],
|
| 192 |
-
# run_on_click=True,
|
| 193 |
-
cache_examples=False)
|
| 194 |
|
| 195 |
with gr.Group():
|
| 196 |
original_prompt_raw.render()
|
|
@@ -238,5 +235,6 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
|
|
| 238 |
|
| 239 |
original_prompt_btn.click(get_hidden_states,
|
| 240 |
[original_prompt_raw],
|
| 241 |
-
[progress_dummy, global_state, *tokens_container, *interpretation_bubbles])
|
|
|
|
| 242 |
demo.launch()
|
|
|
|
| 187 |
dataset = dataset.filter(info['filter'])
|
| 188 |
dataset = dataset.shuffle(buffer_size=2000).take(num_examples)
|
| 189 |
dataset = [[row[info['text_col']]] for row in dataset]
|
| 190 |
+
gr.Examples(dataset, [original_prompt_raw], cache_examples=False)
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
with gr.Group():
|
| 193 |
original_prompt_raw.render()
|
|
|
|
| 235 |
|
| 236 |
original_prompt_btn.click(get_hidden_states,
|
| 237 |
[original_prompt_raw],
|
| 238 |
+
[progress_dummy, global_state, *tokens_container, *interpretation_bubbles])
|
| 239 |
+
original_prompt_raw.change(lambda: [gr.Button(visible=False) for _ in range(MAX_PROMPT_TOKENS)], [], tokens_container)
|
| 240 |
demo.launch()
|