Spaces:
Sleeping
Sleeping
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( | |
label="bot", | |
options=["DeepChessReplicationMinMax"], | |
) | |
st.button("Play bot!", on_click=play, args=[bot_select]) | |
if __name__ == "__main__": | |
# main() | |
play("DeepChessReplicationMinMax") | |