PlayChessVsAI / app.py
mzimm003
prepare space.
e7988f7
raw
history blame
654 Bytes
from my_chess.scripts.scripts import HumanVsBot
from my_chess.learner.environments import Chess
from chessmodels import DCMinMax
import streamlit as st
def play(bot_select):
modelminmax = DCMinMax.from_pretrained("mzimm003/{}".format(bot_select))
play = HumanVsBot(
model=modelminmax,
environment=Chess(render_mode="rgb_array"),
extra_model_environment_context=lambda env: {"board":env.board}
)
play.run()
def main(kwargs=None):
bot_select = st.selectbox(
options=["DeepChessReplicationMinMax"]
)
st.button("Play bot!", on_click=play, args=bot_select)
if __name__ == "__main__":
main()