Балаганский Никита Николаевич commited on
Commit
5b17178
1 Parent(s): aa718cd
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -125,10 +125,11 @@ def main():
125
  label_key = st.selectbox(ATTRIBUTE_LABEL[language], ["Negative"])
126
  target_label_id = 0
127
  act_type = "softmax"
128
- st.write(WARNING_TEXT[language])
129
- show_pos_alpha = st.checkbox("Show positive alphas", value=False)
130
  st.markdown(r"""In our method, we reweight the probability of the next token with the external classifier, namely, the Attribute model. If $\alpha$ parameter is equal to zero we can see that the distribution below collapses into a simple language model without any modification. If alpha is below zero then every generation step attribute model tries to minimize the probability of the desired attribute. Otherwise, the model is forced to produce text with a higher probability of the attribute.""")
131
  st.latex(r"p(x_i|x_{<i}, c) \propto p(x_i|x_{<i})p(c|x_{\leq i})^{\alpha}")
 
 
132
  if act_type == "softmax":
133
  alpha = st.slider("α", min_value=-40, max_value=40 if show_pos_alpha else 0, step=1, value=0)
134
  else:
 
125
  label_key = st.selectbox(ATTRIBUTE_LABEL[language], ["Negative"])
126
  target_label_id = 0
127
  act_type = "softmax"
128
+
 
129
  st.markdown(r"""In our method, we reweight the probability of the next token with the external classifier, namely, the Attribute model. If $\alpha$ parameter is equal to zero we can see that the distribution below collapses into a simple language model without any modification. If alpha is below zero then every generation step attribute model tries to minimize the probability of the desired attribute. Otherwise, the model is forced to produce text with a higher probability of the attribute.""")
130
  st.latex(r"p(x_i|x_{<i}, c) \propto p(x_i|x_{<i})p(c|x_{\leq i})^{\alpha}")
131
+ st.write(WARNING_TEXT[language])
132
+ show_pos_alpha = st.checkbox("Show positive alphas", value=False)
133
  if act_type == "softmax":
134
  alpha = st.slider("α", min_value=-40, max_value=40 if show_pos_alpha else 0, step=1, value=0)
135
  else: