Spaces:
Sleeping
Sleeping
Update app.py
#1
by JanviMl - opened
5 unmodified lines6789101112131415161718195 unmodified linesdef get_response(user_input, mode="honest"):if mode == "honest":# Regular chatbot responseresponse = chatbot(user_input, max_length=50, do_sample=True, top_k=50)return response[0]["generated_text"]elif mode == "echo":# Echo chamber mode - agrees with user inputreturn f"You're absolutely right! {user_input}"# Streamlit UIst.title("Echo Chamber AI vs Honest AI")5 unmodified lines67891011121314151617181920212223245 unmodified linesdef get_response(user_input, mode="honest"):if mode == "honest":response = chatbot(user_input,max_length=100, # Increase the length to allow complete responsesdo_sample=True,top_k=50,top_p=0.95, # More natural responsestemperature=0.7 # Avoid too much randomness)return response[0]["generated_text"]elif mode == "echo":return f"You're absolutely right! {user_input}"# Streamlit UIst.title("Echo Chamber AI vs Honest AI")
app.py+10-5