YSDA_TEST2 / app.py
justheuristic's picture
Update app.py
c756a23
raw
history blame contribute delete
519 Bytes
import streamlit as st
st.markdown("### Very slow string inverter")
st.markdown("<img width=200px src='https://rozetked.me/images/uploads/dwoilp3BVjlE.jpg'>", unsafe_allow_html=True)
import time
from transformers import pipeline
def process(text):
return text[::-1]
text = st.text_area("TEXT HERE")
if len(text.split()) > 0: # note: this if avoids sleep during first loading time
t = st.empty()
for i in range(len(text) + 1):
t.markdown(f"## {process(text)[0:i]}...")
time.sleep(1.0)