Soumen commited on
Commit
0cb4c76
·
1 Parent(s): d2864bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -96,10 +96,11 @@ def main():
96
  st.success(TextBlob(message).correct())
97
  if st.checkbox("Text Generation"):
98
  st.subheader("Generate Text")
99
- if st.button("Generate"):
100
- tokenizer, model = load_models()
 
101
  input_ids = tokenizer(message, return_tensors='pt').input_ids
102
- st.text("Using Hugging Face Trnsformer, Contrastive Search ..")
103
  output = model.generate(input_ids, max_length=128)
104
  st.success(tokenizer.decode(output[0], skip_special_tokens=True))
105
  def change_photo_state():
 
96
  st.success(TextBlob(message).correct())
97
  if st.checkbox("Text Generation"):
98
  st.subheader("Generate Text")
99
+ ok = st.button("Generate")
100
+ tokenizer, model = load_models()
101
+ if ok:
102
  input_ids = tokenizer(message, return_tensors='pt').input_ids
103
+ st.text("Using Hugging Face Transformer, Contrastive Search ..")
104
  output = model.generate(input_ids, max_length=128)
105
  st.success(tokenizer.decode(output[0], skip_special_tokens=True))
106
  def change_photo_state():