Spaces:
Sleeping
Sleeping
mzimm003
commited on
Commit
·
e7988f7
1
Parent(s):
9fbe86e
prepare space.
Browse files- Dockerfile +8 -1
- app.py +9 -2
- requirements.txt +3 -1
Dockerfile
CHANGED
@@ -17,4 +17,11 @@ RUN git clone https://github.com/mzimm003/Chess /app/Chess
|
|
17 |
RUN pip install /app/Chess
|
18 |
|
19 |
COPY --chown=user . /app
|
20 |
-
CMD ["uvicorn", "app:main", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
RUN pip install /app/Chess
|
18 |
|
19 |
COPY --chown=user . /app
|
20 |
+
# CMD ["uvicorn", "app:main", "--host", "0.0.0.0", "--port", "7860"]
|
21 |
+
|
22 |
+
EXPOSE 7860
|
23 |
+
CMD streamlit run app.py \
|
24 |
+
--server.headless true \
|
25 |
+
--server.enableCORS false \
|
26 |
+
--server.enableXsrfProtection false \
|
27 |
+
--server.fileWatcherType none
|
app.py
CHANGED
@@ -2,9 +2,10 @@ from my_chess.scripts.scripts import HumanVsBot
|
|
2 |
from my_chess.learner.environments import Chess
|
3 |
|
4 |
from chessmodels import DCMinMax
|
|
|
5 |
|
6 |
-
def
|
7 |
-
modelminmax = DCMinMax.from_pretrained("mzimm003/
|
8 |
play = HumanVsBot(
|
9 |
model=modelminmax,
|
10 |
environment=Chess(render_mode="rgb_array"),
|
@@ -12,5 +13,11 @@ def main(kwargs=None):
|
|
12 |
)
|
13 |
play.run()
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
if __name__ == "__main__":
|
16 |
main()
|
|
|
2 |
from my_chess.learner.environments import Chess
|
3 |
|
4 |
from chessmodels import DCMinMax
|
5 |
+
import streamlit as st
|
6 |
|
7 |
+
def play(bot_select):
|
8 |
+
modelminmax = DCMinMax.from_pretrained("mzimm003/{}".format(bot_select))
|
9 |
play = HumanVsBot(
|
10 |
model=modelminmax,
|
11 |
environment=Chess(render_mode="rgb_array"),
|
|
|
13 |
)
|
14 |
play.run()
|
15 |
|
16 |
+
def main(kwargs=None):
|
17 |
+
bot_select = st.selectbox(
|
18 |
+
options=["DeepChessReplicationMinMax"]
|
19 |
+
)
|
20 |
+
st.button("Play bot!", on_click=play, args=bot_select)
|
21 |
+
|
22 |
if __name__ == "__main__":
|
23 |
main()
|
requirements.txt
CHANGED
@@ -11,4 +11,6 @@ posix_ipc==1.1.1
|
|
11 |
torchvision==0.14.1
|
12 |
huggingface_hub==0.24.0
|
13 |
lz4==4.3.3
|
14 |
-
safetensors==0.4.3
|
|
|
|
|
|
11 |
torchvision==0.14.1
|
12 |
huggingface_hub==0.24.0
|
13 |
lz4==4.3.3
|
14 |
+
safetensors==0.4.3
|
15 |
+
streamlit==1.36.0
|
16 |
+
streamlit-image-coordinates==0.1.9
|