Балаганский Никита Николаевич commited on
Commit
cb4bf13
1 Parent(s): 8a34322

warning about fp16

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -131,7 +131,7 @@ def main():
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:
136
  alpha = st.slider("α", min_value=-5, max_value=5 if show_pos_alpha else 0, step=1, value=0)
137
  with st.expander("Advanced settings"):
@@ -155,10 +155,16 @@ def main():
155
  figure.update_layout(paper_bgcolor="#FFFFFF", plot_bgcolor='#FFFFFF', showlegend=False)
156
  st.plotly_chart(figure, use_container_width=True)
157
  st.subheader("What is it?")
158
- st.write("""
159
- Text generation with an external classifier requires a huge amount of computation. Therefore text generating with CAIF could be slow. To overcome this issue, we can apply reweighting not for every step. Our hypothesis is that we can run reweighting only if entropy of the next token is above certain threshold. This strategy will reduce the amont of computation. Note that if entropy threshold is too high, we don't get desired attribute in generated text
160
- """)
 
 
 
 
161
  fp16 = st.checkbox("FP16", value=True)
 
 
162
  st.session_state["generated_text"] = None
163
  if "sst" in cls_model_name:
164
  prompt = st.text_input(TEXT_PROMPT_LABEL[language], "The movie")
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=-30, max_value=30 if show_pos_alpha else 0, step=1, value=0)
135
  else:
136
  alpha = st.slider("α", min_value=-5, max_value=5 if show_pos_alpha else 0, step=1, value=0)
137
  with st.expander("Advanced settings"):
155
  figure.update_layout(paper_bgcolor="#FFFFFF", plot_bgcolor='#FFFFFF', showlegend=False)
156
  st.plotly_chart(figure, use_container_width=True)
157
  st.subheader("What is it?")
158
+ st.write("Text generation with an external classifier requires a huge amount of computation. "
159
+ "Therefore text generating with CAIF could be slow. "
160
+ "To overcome this issue, we can apply reweighting not for every step. "
161
+ "Our hypothesis is that we can run reweighting only "
162
+ "if entropy of the next token is above certain threshold. "
163
+ "This strategy will reduce the amount of computation. "
164
+ "Note that if entropy threshold is too high, we don't get desired attribute in generated text")
165
  fp16 = st.checkbox("FP16", value=True)
166
+ st.write("FP16 computation is faster in comparison with full precision, "
167
+ "but sometimes could yield Nones (especially with large alphas).")
168
  st.session_state["generated_text"] = None
169
  if "sst" in cls_model_name:
170
  prompt = st.text_input(TEXT_PROMPT_LABEL[language], "The movie")