m-ric HF staff commited on
Commit
45c11ea
Β·
1 Parent(s): d4bacf6

Fillna relevances with 0

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -101,7 +101,7 @@ def generate_heatmap(input_tokens, all_relevances, output_tokens):
101
 
102
  def on_generate(input_text, num_tokens):
103
  input_tokens, relevances, generated_text, generated_length, output_tokens = generate_and_visualize(input_text, num_tokens)
104
- heatmap = generate_heatmap(input_tokens, relevances, output_tokens)
105
  return (
106
  input_tokens,
107
  relevances,
 
101
 
102
  def on_generate(input_text, num_tokens):
103
  input_tokens, relevances, generated_text, generated_length, output_tokens = generate_and_visualize(input_text, num_tokens)
104
+ heatmap = generate_heatmap(input_tokens, relevances.fillna(0), output_tokens)
105
  return (
106
  input_tokens,
107
  relevances,