-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathapp.py
44 lines (36 loc) · 1.23 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
Entry point for the Outsmart Arena LLM Battle
Initialize logging, env variables and styling as needed
Check if an Arena is in the session, and if not, create a new one using Arena.default()
Delegate to a Display object to manage the drawing of the UI components
To see it in action, run:
python -m streamlit run app.py
"""
from dotenv import load_dotenv
import logging
from game.arenas import Arena
import streamlit as st
from util.setup import setup_logger, STYLE
from views.displays import Display
root = logging.getLogger()
if "root" not in st.session_state:
st.session_state.root = root
setup_logger(root)
load_dotenv()
st.set_page_config(
layout="wide",
page_title="Outsmart",
menu_items={
"About": "Outsmart is an LLM arena that pits LLMs against each other in a battle of negotiation. More at https://edwarddonner.com/2024/08/06/outsmart/"
},
page_icon="🧠",
initial_sidebar_state="collapsed",
)
st.markdown(STYLE, unsafe_allow_html=True)
if "arena" not in st.session_state:
st.session_state.arena = Arena.default()
if "auto_move" not in st.session_state:
st.session_state.auto_move = False
st.session_state.do_move = False
arena = st.session_state.arena
Display(arena).display_page()