import random | |
from chat_interface_preference import ChatInterface | |
def random_response(message, history, request): | |
response = random.choice(["Yes", "No"]) | |
response_total = "" | |
for char in response: | |
response_total += char | |
yield response_total | |
style = "<style>.user-message,.system-message{display:flex;margin:10px}.user-message .message-content{background-color:#c2e3f7;color:#000}.system-message .message-content{background-color:#f5f5f5;color:#000}.message-content{padding:10px;border-radius:10px;max-width:70%;word-wrap:break-word}.container{display:flex;justify-content:space-between}.column{width:48%}</style>" | |
demo = ChatInterface( | |
random_response, | |
cache_examples=False, | |
css=style, | |
repo_id="geitje-spin-preference", | |
prefence_techniques=["kto"], | |
max_turns=10, | |
) | |
if __name__ == "__main__": | |
demo.launch() | |