Update app.py
Browse files
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 |
-
|
| 100 |
-
|
|
|
|
| 101 |
input_ids = tokenizer(message, return_tensors='pt').input_ids
|
| 102 |
-
st.text("Using Hugging Face
|
| 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():
|