dar-tau commited on
Commit
c934897
1 Parent(s): 81e81d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -40,7 +40,6 @@ suggested_interpretation_prompts = [
40
  def initialize_gpu():
41
  pass
42
 
43
-
44
  def reset_model(model_name, *extra_components):
45
  # extract model info
46
  model_args = deepcopy(model_info[model_name])
@@ -133,7 +132,7 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
133
  '''
134
  **👾 This space is a simple introduction to the emerging trend of models interpreting their OWN hidden states in free form natural language!!👾**
135
  This idea was investigated in the paper **Patchscopes** ([Ghandeharioun et al., 2024](https://arxiv.org/abs/2401.06102)) and was further explored in **SelfIE** ([Chen et al., 2024](https://arxiv.org/abs/2403.10949)).
136
- An honorary mention of **Speaking Probes** ([Dar, 2023](https://towardsdatascience.com/speaking-probes-self-interpreting-models-7a3dc6cb33d6) - my own work 🥳) which was less mature but had the same idea in mind.
137
  We will follow the SelfIE implementation in this space for concreteness. Patchscopes are so general that they encompass many other interpretation techniques too!!!
138
  ''', line_breaks=True)
139
 
@@ -204,10 +203,11 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
204
  model_chooser.change(reset_model, [model_chooser, *extra_components], extra_components)
205
 
206
  for i, btn in enumerate(tokens_container):
207
- btn.click(partial(run_interpretation, i=i), [interpretation_prompt,
208
- num_tokens, do_sample, temperature,
209
- top_k, top_p, repetition_penalty, length_penalty,
210
- ], [progress_dummy, *interpretation_bubbles])
 
211
 
212
  original_prompt_btn.click(get_hidden_states,
213
  [original_prompt_raw],
 
40
  def initialize_gpu():
41
  pass
42
 
 
43
  def reset_model(model_name, *extra_components):
44
  # extract model info
45
  model_args = deepcopy(model_info[model_name])
 
132
  '''
133
  **👾 This space is a simple introduction to the emerging trend of models interpreting their OWN hidden states in free form natural language!!👾**
134
  This idea was investigated in the paper **Patchscopes** ([Ghandeharioun et al., 2024](https://arxiv.org/abs/2401.06102)) and was further explored in **SelfIE** ([Chen et al., 2024](https://arxiv.org/abs/2403.10949)).
135
+ Honorary mention: **Speaking Probes** ([Dar, 2023](https://towardsdatascience.com/speaking-probes-self-interpreting-models-7a3dc6cb33d6) - my own work 🥳). It was less mature but had the same idea in mind. I think it's can be a great introduction to the subject!
136
  We will follow the SelfIE implementation in this space for concreteness. Patchscopes are so general that they encompass many other interpretation techniques too!!!
137
  ''', line_breaks=True)
138
 
 
203
  model_chooser.change(reset_model, [model_chooser, *extra_components], extra_components)
204
 
205
  for i, btn in enumerate(tokens_container):
206
+ btn.click(partial(run_interpretation, i=i), dict(intepretation_prompt_raw=interpretation_prompt,
207
+ max_new_tokens=num_tokens, do_sample=do_sample, temperature=temperature,
208
+ top_k=top_k, top_p=top_p, repetition_penalty=repetition_penalty,
209
+ length_penalty=length_penalty,
210
+ ), [progress_dummy, *interpretation_bubbles])
211
 
212
  original_prompt_btn.click(get_hidden_states,
213
  [original_prompt_raw],