Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ def run_interpretation(global_state, raw_interpretation_prompt, max_new_tokens,
|
|
77 |
}
|
78 |
|
79 |
# create an InterpretationPrompt object from raw_interpretation_prompt (after putting it in the right template)
|
80 |
-
interpretation_prompt = interpretation_prompt_template.format(prompt=raw_interpretation_prompt)
|
81 |
interpretation_prompt = InterpretationPrompt(tokenizer, interpretation_prompt)
|
82 |
|
83 |
# generate the interpretations
|
@@ -235,10 +235,9 @@ with gr.Blocks(theme=gr.themes.Default(), css=css) as demo:
|
|
235 |
top_k = gr.Slider(1, 1000, value=50, step=1, label='top k')
|
236 |
top_p = gr.Slider(0., 1., value=0.95, label='top p')
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
for i in range(model.config.num_hidden_layers)]
|
242 |
|
243 |
for i, btn in enumerate(tokens_container):
|
244 |
btn.click(partial(run_interpretation, i=i), [global_state, interpretation_prompt,
|
|
|
77 |
}
|
78 |
|
79 |
# create an InterpretationPrompt object from raw_interpretation_prompt (after putting it in the right template)
|
80 |
+
interpretation_prompt = interpretation_prompt_template.format(prompt=raw_interpretation_prompt, repeat=1)
|
81 |
interpretation_prompt = InterpretationPrompt(tokenizer, interpretation_prompt)
|
82 |
|
83 |
# generate the interpretations
|
|
|
235 |
top_k = gr.Slider(1, 1000, value=50, step=1, label='top k')
|
236 |
top_p = gr.Slider(0., 1., value=0.95, label='top p')
|
237 |
|
238 |
+
interpretation_bubbles = [gr.Textbox('', container=False, visible=False, elem_classes=['bubble',
|
239 |
+
'even_bubble' if i % 2 == 0 else 'odd_bubble'])
|
240 |
+
for i in range(model.config.num_hidden_layers)]
|
|
|
241 |
|
242 |
for i, btn in enumerate(tokens_container):
|
243 |
btn.click(partial(run_interpretation, i=i), [global_state, interpretation_prompt,
|