Hi, im having a problem with the text_inpts in a while loop, the inputs are like null strings that are making a infinite loop, heres the part of the code that is makking me problems
st.write("ChatBot: Hola este es el chatbot de la cafetería ¿En qué puedo ayudarte?")
while True:
inp = st.text_input("Tú: ", key=llave, autocomplete=None)
llave += 1
tag, maxscore = instancer(inp, model_NI, NI)
if maxscore > 0.8 or inp == 'salir':
break
else:
st.write("ChatBot: Lo siento, pero no entendí tu petición, ¿Podrías decirlo de otra forma?")
Hi @Diego_Garcia 
Streamlit works with a reactive model, which means that every time an input changes, the whole script reruns. This is probably why you are experiencing an infinite loop.
Can you try this code instead:
import streamlit as st
st.write("ChatBot: Hola, este es el chatbot de la cafetería ¿En qué puedo ayudarte?")
if 'input_history' not in st.session_state:
st.session_state.input_history = []
inp = st.text_input("Tú: ", autocomplete=None)
if inp and (len(st.session_state.input_history) == 0 or inp != st.session_state.input_history[-1]):
st.session_state.input_history.append(inp)
tag, maxscore = instancer(inp, model_NI, NI)
if maxscore > 0.8 or inp == 'salir':
st.write(f"ChatBot: {tag}") # or however you want to respond
else:
st.write("ChatBot: Lo siento, pero no entendí tu petición, ¿Podrías decirlo de otra forma?")