lvwerra HF staff commited on
Commit
d827a2c
1 Parent(s): 1514fdb
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -129,7 +129,8 @@ norm_probs, sorted_token_ids = calculate_scores(probs.numpy(), inputs["input_ids
129
 
130
  if len(inputs['input_ids'])>1024:
131
  st.warning("Your input is longer than the maximum 1024 tokens and will be truncated.")
132
-
 
133
  st.sidebar.title("Settings:")
134
  if st.sidebar.radio("Highlight mode:", ["Probability heuristics", "Scaled loss per token"]) == "Probability heuristics":
135
  scores = norm_probs
 
129
 
130
  if len(inputs['input_ids'])>1024:
131
  st.warning("Your input is longer than the maximum 1024 tokens and will be truncated.")
132
+ st.sidebar.title("Info:")
133
+ st.sidebar.markdown("This demo uses CodeParrot to highlight the parts of code with low probability. Since CodeParrot is an autoregressive model the tokens at the beginning tend to have a lower probability. E.g. the model can't know what you want to import because it has no access to information later in the code. However, as you can see in the example on the right it still can highlight bugs or unconventional naming. Below is an example of how a correct solution might look like. Try to copy paste it below and press **CMD + Enter** to update the highlights.")
134
  st.sidebar.title("Settings:")
135
  if st.sidebar.radio("Highlight mode:", ["Probability heuristics", "Scaled loss per token"]) == "Probability heuristics":
136
  scores = norm_probs