patpizio commited on
Commit
624cb8c
1 Parent(s): 4bc4fd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -23,7 +23,7 @@ def plot_word_scores(top_token_ids, outputs, tokenizer, boolq=False, width=600):
23
  for step, candidates in enumerate(top_token_ids):
24
  fig.append_trace(
25
  go.Bar(
26
- y=tokenizer.convert_ids_to_tokens(candidates),
27
  x=outputs['scores'][step][0][candidates],
28
  orientation='h'
29
  ),
@@ -51,7 +51,7 @@ with col2:
51
  top_p = st.slider('Top p:', min_value=0.5, max_value=1.0, value=0.99)
52
  # max_tokens = st.number_input('Max output length:', min_value=1, max_value=64, format='%i')
53
  max_tokens = st.slider('Max output length: ', min_value=1, max_value=64)
54
- threshold = st.number_input('Min token score:: ', value=-100.0)
55
 
56
 
57
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
 
23
  for step, candidates in enumerate(top_token_ids):
24
  fig.append_trace(
25
  go.Bar(
26
+ y=[w[1:] for w in tokenizer.convert_ids_to_tokens(candidates)],
27
  x=outputs['scores'][step][0][candidates],
28
  orientation='h'
29
  ),
 
51
  top_p = st.slider('Top p:', min_value=0.5, max_value=1.0, value=0.99)
52
  # max_tokens = st.number_input('Max output length:', min_value=1, max_value=64, format='%i')
53
  max_tokens = st.slider('Max output length: ', min_value=1, max_value=64)
54
+ # threshold = st.number_input('Min token score:: ', value=-10.0)
55
 
56
 
57
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)