Update app.py
Browse files
app.py
CHANGED
|
@@ -174,13 +174,13 @@ def main():
|
|
| 174 |
if st.checkbox("Spell Corrections for English"):
|
| 175 |
st.success(TextBlob(text).correct())
|
| 176 |
if st.checkbox("Text Generation"):
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
if st.checkbox("Mark here, Text Summarization for English or Bangla!"):
|
| 185 |
st.subheader("Summarize Your Text for English and Bangla Texts!")
|
| 186 |
message = st.text_area("Enter the Text","Type please ..")
|
|
|
|
| 174 |
if st.checkbox("Spell Corrections for English"):
|
| 175 |
st.success(TextBlob(text).correct())
|
| 176 |
if st.checkbox("Text Generation"):
|
| 177 |
+
ok = st.button("Generate")
|
| 178 |
+
if ok:
|
| 179 |
+
tokenizer, model = load_models()
|
| 180 |
+
input_ids = tokenizer(text, return_tensors='pt').input_ids
|
| 181 |
+
st.text("Using Hugging Face Transformer, Contrastive Search ..")
|
| 182 |
+
output = model.generate(input_ids, max_length=128)
|
| 183 |
+
st.success(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 184 |
if st.checkbox("Mark here, Text Summarization for English or Bangla!"):
|
| 185 |
st.subheader("Summarize Your Text for English and Bangla Texts!")
|
| 186 |
message = st.text_area("Enter the Text","Type please ..")
|