Spaces:
Sleeping
Sleeping
File size: 719 Bytes
d288960 770f950 0154f58 e7988f7 770f950 e7988f7 770f950 a7af915 770f950 e7988f7 3c554b8 e7988f7 39de071 e7988f7 770f950 39de071 |
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 |
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")
|